How Graph Theory Maps Networks and Hidden Connections

Graph theory began with Euler's bridge puzzle in 1736 and now powers Google PageRank, social networks, GPS routing, and solutions to the traveling salesman problem.

The InfoNexus Editorial TeamMay 20, 20269 min read

A Mathematician's Sunday Walk That Created a New Field

In 1736, Leonhard Euler published a paper about a pedestrian problem in Königsberg, Prussia. The city straddled the Pregel River with two islands connected by seven bridges. Locals wanted to know: could you walk through the city crossing each bridge exactly once? Euler proved it was impossible—and in doing so, invented graph theory. He stripped the map down to its essentials: four landmasses became vertices, seven bridges became edges. The physical geography was irrelevant. Only connections mattered. That abstraction now underpins everything from airline routing to social media algorithms.

Vertices, Edges, and the Language of Graphs

A graph in mathematics has nothing to do with bar charts or line plots. It consists of vertices (also called nodes) connected by edges (also called links). The vocabulary is precise because the applications demand it.

TermDefinitionReal-World Example
Vertex (Node)A point in the graphA person, a city, a web page
Edge (Link)A connection between two verticesA friendship, a flight route, a hyperlink
DegreeNumber of edges at a vertexNumber of friends a person has
Directed GraphEdges have directionTwitter follow (A follows B ≠ B follows A)
Weighted GraphEdges carry numerical valuesRoad distances between cities
Connected GraphA path exists between every vertex pairA single-component social network

Euler's Königsberg insight was about vertex degree. A walk crossing every edge exactly once (an Eulerian path) requires exactly zero or two vertices with odd degree. Königsberg had four odd-degree vertices. Walk impossible.

Social Networks Through a Graph Lens

Facebook's social graph contained over 3 billion vertices by 2024. Each friendship is an undirected edge; each person is a vertex. Graph theory reveals structural properties invisible to the naked eye.

  • Six degrees of separation: The average shortest path between any two Facebook users is 3.57 edges—less than the six degrees Stanley Milgram estimated in 1967
  • Clustering coefficient: Measures how likely your friends are to be friends with each other, identifying tight-knit communities
  • Betweenness centrality: Identifies bridge individuals who connect otherwise separate groups—removing them fractures the network
  • Power-law degree distribution: A few vertices (influencers) have millions of edges while most have dozens, following a scale-free pattern

These aren't just academic metrics. Epidemiologists model disease spread on contact graphs. Counterterrorism analysts map communication networks to identify cell leaders. Advertisers target high-centrality nodes for maximum information diffusion.

Google PageRank: The Graph That Organized the Internet

In 1998, Larry Page and Sergey Brin treated the entire World Wide Web as a directed graph. Each webpage was a vertex. Each hyperlink was a directed edge. Their PageRank algorithm assigned importance scores by a deceptively simple principle: a page is important if important pages link to it.

The algorithm models a "random surfer" who clicks links at random. With probability 0.85, the surfer follows a link on the current page. With probability 0.15, the surfer jumps to a completely random page. The long-run fraction of time spent on each page is its PageRank score. Mathematically, this is the dominant eigenvector of a modified adjacency matrix.

PageRank transformed a graph theory concept into a company worth over $2 trillion. The web graph it analyzes now contains over 100 billion indexed pages.

Finding the Shortest Path: Dijkstra's Algorithm

Edsger Dijkstra invented his shortest-path algorithm in 1956 while sitting at a café in Amsterdam. He wanted to demonstrate the power of a new computer, so he devised a problem: find the shortest route between two cities in the Netherlands. The algorithm he sketched on a napkin—he later said the whole thing took about twenty minutes—became one of the most implemented algorithms in computing history.

Every GPS navigation system runs a variant of Dijkstra's algorithm. Google Maps processes billions of shortest-path queries daily across a road graph with hundreds of millions of vertices. The algorithm works by maintaining a priority queue of unvisited vertices, always expanding the closest unvisited vertex first.

  • Time complexity: O((V + E) log V) with a binary heap
  • Handles only non-negative edge weights
  • The A* variant adds heuristic estimates to speed up point-to-point searches
  • Contraction hierarchies pre-process the graph for even faster real-time queries

The Traveling Salesman Problem: Simple to State, Brutal to Solve

Visit every city exactly once and return home by the shortest route. That's the entire problem statement. It is among the most studied problems in computer science and remains unsolved in the general case.

For 10 cities, there are 181,440 possible routes. Brute force works. For 20 cities, there are over 60 quadrillion routes. For 100 cities, the number exceeds the atoms in the observable universe. The traveling salesman problem (TSP) is NP-hard: no known algorithm solves all instances in polynomial time, and most computer scientists believe none exists.

Number of CitiesPossible RoutesBrute Force Time (1 GHz)
10181,440Less than 1 millisecond
1543.6 billion~44 seconds
2060.8 quadrillion~1,930 years
253.1 × 1023~9.8 billion years

Practical solutions use heuristics—nearest neighbor, simulated annealing, genetic algorithms—that find routes within 1-2% of optimal. Delivery companies like UPS and FedEx solve TSP variants with thousands of stops every day, saving millions of gallons of fuel annually.

The Four Color Theorem: Graphs Meet Cartography

In 1852, a student named Francis Guthrie noticed he could color a map of English counties using only four colors so that no adjacent counties shared a color. He conjectured that four colors suffice for any map. The conjecture resisted proof for 124 years.

In 1976, Kenneth Appel and Wolfgang Haken proved the four color theorem using a computer to check 1,936 irreducible configurations. It was the first major theorem proved with computational assistance, and mathematicians debated for years whether a proof requiring computer verification was truly a proof. The controversy has faded—the result has been independently verified multiple times, including a 2005 formal proof in the Coq proof assistant.

  • Every map corresponds to a planar graph (countries are vertices, shared borders are edges)
  • The theorem states every planar graph is 4-colorable
  • Practical applications include scheduling, register allocation in compilers, and frequency assignment for cell towers
  • Five colors were proven sufficient in 1890 by Percy Heawood, but dropping to four required another 86 years

Network Science and the Shape of the Modern World

Graph theory has evolved into network science, an interdisciplinary field that applies graph-theoretic tools to biological, technological, and social systems. Albert-László Barabási's work on scale-free networks in 1999 showed that the internet, protein interaction networks, and citation graphs all share the same structural signature: a power-law degree distribution created by preferential attachment, where new nodes preferentially connect to already well-connected nodes.

Duncan Watts and Steven Strogatz identified "small-world" networks in 1998—graphs with high local clustering but short average path lengths. The human brain is a small-world network. So is the power grid. So is the network of Hollywood actor collaborations.

From a Sunday walk in Königsberg to algorithms routing packets across a global internet, graph theory's central promise has held for nearly three centuries: strip away the surface details, keep only the connections, and the structure tells you everything you need to know.

graph-theoryapplied-mathematicsnetworksalgorithms

Related Articles