Engineer Atlas
OverviewLearnVisualizerAlgorithm FinderPatternsComplexityRoadmapPracticeInterview
OverviewLearnVisualizerAlgorithm FinderPatternsComplexityRoadmapPracticeInterviewCheat SheetCompare
Data Structures
  • Fundamentals
  • Stack & Queue
  • Hashing
  • Trees
  • Heaps
  • Graphs
  • Specialized Structures
Algorithms
  • Searching
  • Sorting
  • Two Pointers
  • Sliding Window
  • Prefix Techniques
  • Recursion & Backtracking
  • Divide & Conquer
  • Greedy
  • Dynamic Programming
  • Graph Algorithms
  • String Algorithms
  • Bit Manipulation
  • Mathematical Algorithms
Learn/Data Structures/Graphs
Graphs

Graphs

Directed, undirected, weighted graphs and their representations.

Directed Graph
▶ viz

A set of vertices connected by one-way edges: an edge u→v does not imply v→u.

O(deg(u)) search · O(V + E) space
Undirected Graph
▶ viz

Vertices joined by two-way edges: {u, v} can be traversed in either direction.

O(deg(u)) search · O(V + E) space
Weighted Graph
▶ viz

A graph whose edges carry numeric weights (cost, distance, capacity), so path length is a sum of weights rather than a hop count.

O(deg(u)) search · O(V + E) space
Unweighted Graph
▶ viz

A graph where every edge counts the same, so the shortest path is the one with the fewest edges and BFS finds it in O(V + E).

O(deg(u)) search · O(V + E) space
DAG (Directed Acyclic Graph)
▶ viz

A directed graph with no cycles, guaranteeing a topological order in which every edge points forward.

O(deg(u)) search · O(V + E) space
Adjacency Matrix
▶ viz

A V×V grid where cell [u][v] stores whether (or how heavily) u connects to v, giving O(1) edge lookup at O(V²) space.

O(1) search · O(V²) space
Adjacency List
▶ viz

For each vertex, a list of its neighbors (and edge weights), giving O(V + E) space and O(deg) neighbor iteration — the default graph representation.

O(deg(u)) search · O(V + E) space
Edge List
▶ viz

The graph as a flat list of (u, v[, w]) tuples — minimal, sortable, and exactly what Kruskal and Bellman-Ford need.

O(E) search · O(E) space
Engineer Atlas
GitHub·LinkedIn