HomeMathematicsGraph Explorer: Shortest Path & Coloring

Graph Explorer: Shortest Path & Graph Coloring

Interactive 3D graph simulation: watch Dijkstra's algorithm expand a frontier to find the shortest weighted path between two nodes, or switch to greedy graph coloring and see how few colors a graph needs so no two adjacent nodes match.

Mathematics3DModerate60 FPS📱 Mobile-adapted
discrete-mathematics ↗ Open standalone

Discrete mathematics turns real networks — road maps, circuit boards, exam schedules, computer networks — into graphs: nodes and weighted edges. This simulation builds a random connected graph in 3D and runs two classic algorithms on it live. In shortest path mode, Dijkstra's algorithm expands outward from a start node, settling the closest unvisited node at each step until it reaches the end node and reveals the cheapest route. In graph coloring mode, a greedy algorithm assigns each node the lowest color number that keeps it different from all its already-colored neighbours, approximating the graph's chromatic number. Adjust node count and edge density to see how structure changes both problems.

⚙ Under the hood

Interactive 3D graph simulation that runs Dijkstra's shortest-path algorithm and a greedy graph-coloring algorithm on a randomly generated connected graph, animating the frontier expansion or color assignment step by step.

Three.jsgraph theoryalgorithmsdiscrete mathDijkstragraph coloring

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)