Graph

Domain: Data Structures

🎯 Motivation

When relationships between items are not hierarchical but network-like — social networks, maps, dependencies — a graph is the right structure.

📋 Concrete Example

A graph of friends: Alice is friends with Bob and Carol, Bob is friends with Dave. Each person is a node, each friendship is an edge.

🔗 Analogy

A map of Hong Kong MTR stations. Each station is a node, each train line connecting stations is an edge. You can travel in any direction.