Data Structures Questions Medium
A directed graph, also known as a digraph, is a type of graph where the edges have a specific direction associated with them. In other words, each edge in a directed graph has an arrow indicating the direction of the relationship between the connected vertices. This means that the relationship between two vertices in a directed graph is asymmetric, as the edge from vertex A to vertex B does not imply the existence of an edge from vertex B to vertex A.
On the other hand, an undirected graph is a type of graph where the edges do not have any specific direction associated with them. In an undirected graph, the relationship between two vertices is symmetric, meaning that if there is an edge connecting vertex A to vertex B, there is also an edge connecting vertex B to vertex A.
In summary, the main difference between a directed graph and an undirected graph lies in the directionality of the edges. Directed graphs represent asymmetric relationships, while undirected graphs represent symmetric relationships.