GRAPH
THEORY

The study of connection. A Graph is not a chart; it is a mathematical structure modeling pairwise relations between objects.

V = {1,2,3...}
"The Internet is just one
giant graph."

Pathfinding

How does Google Maps calculate the route from New York to LA in milliseconds? It uses graph traversal algorithms like BFS and Dijkstra to crawl the network of roads (edges) and intersections (nodes).

STARTEND
0 Explored0 Discovered
Step 0 / -1

Historic Problems

Eulerian Path

A trail that visits every edge exactly once. (The Seven Bridges Problem).

Hamiltonian Path

A path that visits every vertex exactly once. (The Traveling Salesman).

Tree

A connected graph with no cycles. The structure of file systems and HTML DOM.

Network Syntax

Vertex (Node)

The fundamental unit of a graph. Represents an object (Person, City, Router).

V
Edge (Link)

A connection between two vertices. Can be directed (one-way) or undirected (two-way).

E
Degree

The number of edges connected to a vertex.

deg(v)
Path

A sequence of edges that connects a sequence of vertices.

P
Cycle

A path that starts and ends at the same vertex.

C
Adjacency Matrix

A square matrix used to represent a finite graph. The elements indicate whether pairs of vertices are adjacent.

A[i][j]