What is a directed graph and how is it different from an undirected graph?

Data Structures Questions



62 Short 41 Medium 47 Long Answer Questions Question Index

What is a directed graph and how is it different from an undirected graph?

A directed graph, also known as a digraph, is a type of graph where the edges have a specific direction associated with them. Each edge in a directed graph has an arrowhead indicating the direction of the relationship between the connected vertices. This means that the relationship between two vertices in a directed graph is one-way.

On the other hand, an undirected graph is a type of graph where the edges do not have any specific direction associated with them. The edges in an undirected graph are bidirectional, meaning that the relationship between two vertices is two-way.

In summary, the main difference between a directed graph and an undirected graph is that the edges in a directed graph have a specific direction associated with them, while the edges in an undirected graph do not.