What is the difference between a directed and undirected graph

后端 未结 7 1181
花落未央
花落未央 2021-02-05 06:02

What is the difference between these fundamental types?

In drawings I see that the directed has arrows, but what exactly is meant by these arrows in the directed graph a

7条回答
  •  说谎
    说谎 (楼主)
    2021-02-05 06:41

    A directed graph is a graph in which edges have orientation (given by the arrowhead). This means that an edge (u, v) is not identical to edge (v, u). An example could be nodes representing people and edges as a gift from one person to another.

    An undirected graph is a graph in which edges don't have orientation (no arrowhead). This means that an edge (u, v) is identical to edge (v, u). An example for this type of graph could be nodes representing cities and edges representing roads between cities.

提交回复
热议问题