Mental Model
A graph is a way to connect points (vertices) with lines (edges) that can have directions and weights.
Analogy: Think of a city map where places are points and roads are lines connecting them. Some roads go one way (directed), some both ways (undirected), and some roads have distances (weights).
Vertices: A, B, C, D
Edges:
A -> B (directed)
B ↔ C (undirected)
C -> D (directed, weight 5)
A -> B
↘
C ↔ D
Legend:
-> : directed edge
↔ : undirected edge
Numbers on edges represent weights if any