Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Graphs are versatile structures that can be customized to model almost any network. Understanding these fundamental classifications is the first step toward selecting the right algorithm for your problem.
Algorithms are often specialized. For example, Dijkstra requires non-negative weights, while Topological Sort requires an Acyclic graph (DAG).
A graph can belong to multiple categories—for instance, a Weighted Directed Acyclic Graph (WDAG) is a common model for project schedules.
In directed graphs, edges have a fixed direction (u → v), often representing one-way streets or dependencies. Undirected edges (u ↔ v) represent mutual relationships like friendships.
Weighted graphs assign numerical values (costs, distances, or capacities) to edges. In unweighted graphs, all edges are considered equal (cost = 1).
A graph is connected if a path exists between every vertex. Disconnected graphs consist of multiple isolated 'components'.
Cyclic graphs contain at least one path that loops back to its start. Acyclic graphs (like trees) have no cycles.