Tags

Graph Algorithms

Graph Algorithms

0 lessons
1 code snippet
1 question bank
1 system design
4 community items

graph-algorithms

Code Snippets

1 snippet
Code Snippet
Premium

Dijkstra in Python with heapq

Dijkstra finds the shortest path in a weighted graph with non-negative edge weights. The Python idiom is `heapq` (a binary min-heap) plus a distance dict, which gives O((V + E) log V) without external libraries. This entry covers the standard single-source template, path reconstruction, and the early-exit shortest-path-to-one-target variant.

Python
dijkstra
graph-algorithms
min-heap
algorithms

674

16

Hard

Question Banks

1 item
Question Bank
Premium

Graph Theory Essentials

Interview-grade prompts on BFS/DFS, shortest paths, connectivity, and cycle detection across directed and undirected graphs.

Python
graphs
graph-algorithms
interview-prep
algorithms

607

8

Hard

System Design

1 article
System Design
Premium

Design Google Maps

Design Google Maps: a global mapping service that renders the Earth from 256x256 tiles, computes the shortest driving route in under 200 ms, and folds live traffic into routing for 1B users issuing 5B route requests per day. The interview centerpiece is the routing engine: how Dijkstra is too slow on a continent-scale graph and how Contraction Hierarchies (CH) precompute shortcuts so the live query is logarithmic. We cover the tile pyramid (zoom 0-20, ~1 trillion possible tiles at zoom 20), how live traffic from 100M Android phones updates edge weights every minute, and how to keep navigation latency under 1 second when re-routing.

design-google-maps
case-study
ride-sharing-and-maps
google-maps
graph-algorithms
dijkstra
a-star
contraction-hierarchies
routing-engine
map-tiles
tile-rendering
real-time-traffic
cdn
geospatial
h3-hex-grid
system-design
advanced
premium

584

10

Hard