Search⌘ K
AI Features

Types of Graphs

Explore different types of graphs including directed, undirected, weighted, unweighted, cyclic, and acyclic graphs. Learn how these classifications affect graph representation and algorithms, and see examples implemented in C# to understand their real-world uses.

We'll cover the following...

Graphs can be classified into different types based on how their edges behave. The most common classifications are:

  • Directed vs. undirected

  • Weighted vs. unweighted

  • Cyclic vs. acyclic

Directed graphs

A directed graph, or digraph, is a graph in which each edge has a direction. This means the connection goes from one vertex to another in a specific direction.

For example, if there is an edge from A to B, that does not automatically mean there is an edge from B to A.

A directed graph can be shown like this:

Directed graph
Directed graph

When directed graphs are useful

Directed graphs are used when relationships are one-way. Some common examples include: ...