Graph Algorithms

Master GraphAlgorithms Visually

Understand graph traversal, shortest paths, and network algorithms with interactive visualizations.

12+ Graph Algorithms
Real-time Visualization
Interactive Traversal
Interactive Visualizations

Choose Your AlgorithmStart Visualizing

Click on any algorithm card to see it in action with interactive step-by-step visualization

Dijkstra's Algorithm

HardWeightedDirected

Finds shortest path from source to all vertices in weighted graphs using greedy approach.

Best/Avg:O((V+E) log V)
Worst Case:O((V+E) log V)
Visualize Now

Breadth First Search

Medium

Level-order traversal that explores all vertices at present depth before moving deeper.

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Depth First Search

Medium

Explores as far as possible along each branch before backtracking.

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Bellman-Ford

HardWeightedDirected

Computes shortest paths from source, handles negative edge weights.

Best/Avg:O(VE)
Worst Case:O(VE)
Visualize Now

A* Search

HardWeighted

Informed search algorithm using heuristics to find optimal path efficiently.

Best/Avg:O(E)
Worst Case:O(b^d)
Visualize Now

Kruskal's MST

MediumWeighted

Finds minimum spanning tree by selecting edges in increasing order of weight.

Best/Avg:O(E log E)
Worst Case:O(E log E)
Visualize Now

Prim's MST

MediumWeighted

Builds minimum spanning tree by growing tree from arbitrary starting vertex.

Best/Avg:O(E log V)
Worst Case:O(E log V)
Visualize Now

Floyd-Warshall

HardWeightedDirected

All-pairs shortest path algorithm using dynamic programming.

Best/Avg:O(V³)
Worst Case:O(V³)
Visualize Now

Topological Sort

MediumDirected

Linear ordering of vertices in directed acyclic graph (DAG).

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Tarjan's SCC

HardDirected

Finds strongly connected components in directed graph using DFS and low-link values.

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Kosaraju's Algorithm

MediumDirected

Finds strongly connected components using two DFS passes on original and transposed graph.

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Articulation Points

Hard

Finds vertices whose removal increases the number of connected components.

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Bridge Finding

Hard

Finds edges whose removal increases number of connected components (cut edges).

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Eulerian Path

Medium

Finds path that visits every edge exactly once (Hierholzer's algorithm).

Best/Avg:O(E)
Worst Case:O(E)
Visualize Now

Hamiltonian Path

Hard

Finds path that visits every vertex exactly once (NP-complete problem).

Best/Avg:O(n!)
Worst Case:O(n!)
Visualize Now

Ford-Fulkerson

HardWeightedDirected

Computes maximum flow in flow network using augmenting paths.

Best/Avg:O(E·f)
Worst Case:O(E·f)
Visualize Now

Bipartite Check

Easy

Checks if graph is bipartite (2-colorable) using BFS/DFS coloring.

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Cycle Detection

MediumDirected

Detects cycles in directed/undirected graphs using DFS coloring technique.

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Connected Components

Easy

Finds all connected components in undirected graph using DFS/BFS or Union-Find.

Best/Avg:O(V+E)
Worst Case:O(V+E)
Visualize Now

Each algorithm includes interactive visualization, code implementation, and complexity analysis

Complete Collection

All Graph AlgorithmsDetailed Overview

Explore 19 graph algorithms with complexity analysis, pros & cons, and use cases

19
Total Algorithms
7
Weighted Graph
8
Directed Graph
3
MST Algorithms

Complete AlgorithmComparison Table

Compare all 19 graph algorithms at a glance

AlgorithmTypeTimeSpaceWeightedNegative EdgesAll Pairs
Dijkstra'sShortest PathO((V+E) log V)O(V)
BFSTraversalO(V+E)O(V)
DFSTraversalO(V+E)O(V)
Bellman-FordShortest PathO(VE)O(V)
Floyd-WarshallShortest PathO(V³)O(V²)
A* SearchShortest PathO(E)O(V)
Kruskal's MSTMSTO(E log E)O(V)
Prim's MSTMSTO(E log V)O(V)
Topological SortOrderingO(V+E)O(V)
Tarjan's SCCConnectivityO(V+E)O(V)
Kosaraju'sConnectivityO(V+E)O(V)
Articulation PointsConnectivityO(V+E)O(V)
Bridge FindingConnectivityO(V+E)O(V)
Eulerian PathPathO(E)O(E)
Hamiltonian PathPathO(n!)O(V)
Ford-FulkersonFlowO(E·f)O(V)
Bipartite CheckPropertyO(V+E)O(V)
Cycle DetectionPropertyO(V+E)O(V)
Connected ComponentsConnectivityO(V+E)O(V)

Algorithm Categories & Notes

V: Number of vertices

E: Number of edges

f: Maximum flow value

Shortest Path: Find minimum distance

MST: Minimum Spanning Tree

Connectivity: Graph structure analysis

Traversal: Visit all vertices

Flow: Network flow algorithms

Property: Check graph properties