ConceptComplete

Graph Theory Basics - Examples and Constructions

Graphs model diverse real-world systems and support powerful algorithmic techniques. These examples illustrate fundamental graph constructions and their applications.

ExampleSocial Networks

Social networks are naturally modeled as graphs where vertices represent individuals and edges represent relationships (friendship, following, collaboration). Properties like clustering coefficient, average path length, and degree distribution reveal network structure.

Small-world property: Many real networks exhibit short average path lengths (small diameter) despite large size. The famous "six degrees of separation" suggests that any two people are connected by a path of length around 6.

Scale-free networks: Degree distributions following power laws P(k)kγP(k) \propto k^{-\gamma}, with many low-degree vertices and few high-degree "hubs." Examples include the internet topology and citation networks.

ExampleGraph Coloring Applications

The Four Color Theorem (proved 1976) states that any planar graph can be colored with at most 4 colors. Applications include:

  • Map coloring: Countries as vertices, borders as edges
  • Register allocation: Variables as vertices, conflicts as edges (variables that can't share registers)
  • Scheduling: Tasks as vertices, conflicts as edges (tasks that can't run simultaneously)
  • Sudoku: Each cell is a vertex, edges connect cells in the same row, column, or 3×3 box

Finding the chromatic number is NP-hard in general, but certain graph classes (bipartite, planar, perfect graphs) have polynomial-time algorithms.

ExampleEulerian and Hamiltonian Paths

An Eulerian path visits every edge exactly once. An Eulerian circuit is an Eulerian path that starts and ends at the same vertex.

Euler's Theorem: A connected graph has an Eulerian circuit if and only if every vertex has even degree. It has an Eulerian path (but not circuit) if and only if exactly two vertices have odd degree.

A Hamiltonian path visits every vertex exactly once. A Hamiltonian cycle is a Hamiltonian path that returns to the start vertex.

Unlike Eulerian paths (polynomial-time decidable), determining whether a Hamiltonian cycle exists is NP-complete. The Traveling Salesman Problem seeks the shortest Hamiltonian cycle in a weighted graph.

ExampleMatching Theory

A matching in a graph is a set of edges with no common vertices. A perfect matching covers all vertices. Matching problems arise in:

  • Job assignment: Workers and jobs as bipartite graph vertices
  • Organ donation chains: Donors and recipients
  • Stable marriage problem: Finding stable matchings in bipartite graphs with preferences

Hall's Marriage Theorem: A bipartite graph G=(XY,E)G = (X \cup Y, E) has a matching covering XX if and only if for every subset SXS \subseteq X, the neighborhood N(S)S|N(S)| \geq |S| (the "marriage condition").

The Hungarian algorithm finds maximum-weight matchings in bipartite graphs in polynomial time.

ExampleGraph Products

New graphs can be constructed from existing ones:

Cartesian product GHG \square H: Vertices are pairs (g,h)(g,h) with gV(G)g \in V(G), hV(H)h \in V(H). Connect (g1,h1)(g_1,h_1) to (g2,h2)(g_2,h_2) if either g1=g2g_1 = g_2 and h1h2E(H)h_1h_2 \in E(H), or h1=h2h_1 = h_2 and g1g2E(G)g_1g_2 \in E(G).

Example: PmPnP_m \square P_n is the m×nm \times n grid graph. CnK2C_n \square K_2 is the nn-prism graph.

Tensor product G×HG \times H: Connect (g1,h1)(g_1,h_1) to (g2,h2)(g_2,h_2) if g1g2E(G)g_1g_2 \in E(G) AND h1h2E(H)h_1h_2 \in E(H).

Graph join G+HG + H: Disjoint union of GG and HH plus all edges between GG and HH. Example: K2+Knˉ=K1,nK_2 + \bar{K_n} = K_{1,n} (star graph).

Remark

Graphs provide a unifying language across disciplines. In chemistry, molecular graphs represent atomic bonds. In biology, phylogenetic trees model evolutionary relationships. In computer science, state machines and parse trees are directed graphs. The versatility of graph theory stems from its abstraction of pairwise relationships, making it applicable wherever such structures arise. Modern network science extends classical graph theory with tools from probability, statistics, and physics to model large-scale dynamic networks.

These examples demonstrate how graph-theoretic thinking provides powerful abstractions for understanding complex systems.