Can someone explain in simple terms to me what a directed acyclic graph is?

前端 未结 13 1193
暖寄归人
暖寄归人 2020-12-22 16:23

Can someone explain in simple terms to me what a directed acyclic graph is? I have looked on Wikipedia but it doesn\'t really make me see its use in programming.

13条回答
  •  轮回少年
    2020-12-22 16:42

    graph = structure consisting of nodes, that are connected to each other with edges

    directed = the connections between the nodes (edges) have a direction: A -> B is not the same as B -> A

    acyclic = "non-circular" = moving from node to node by following the edges, you will never encounter the same node for the second time.

    A good example of a directed acyclic graph is a tree. Note, however, that not all directed acyclic graphs are trees.

提交回复
热议问题