7. Applied and Discrete Math

Graph Theory

Introduce graphs, paths, connectivity, Eulerian and Hamiltonian concepts and apply to network and routing problems.

Graph Theory

Hey students! 👋 Welcome to one of the most exciting areas of mathematics that you probably use every day without even realizing it! Graph theory is the mathematical study of networks and connections, and it's the secret behind everything from your social media feeds to GPS navigation systems. In this lesson, you'll discover how mathematicians use simple dots and lines to solve complex real-world problems. By the end, you'll understand what makes a good network design, why some routes are more efficient than others, and how to determine if you can travel through a network visiting every connection exactly once.

What Are Graphs? The Building Blocks of Networks 🏗️

Let's start with the basics, students. In graph theory, a graph isn't the kind you plot on coordinate axes - it's something much more interesting! A graph is simply a collection of vertices (also called nodes) connected by edges (also called links or arcs).

Think of vertices as cities on a map, and edges as the roads connecting them. Or imagine vertices as people in your friend group, with edges representing friendships between them. The beauty of graphs is that they can represent almost any relationship you can think of!

Here's what makes graphs so powerful: they strip away all the unnecessary details and focus purely on connections. Whether you're looking at a computer network with millions of devices or a simple family tree, the mathematical principles remain the same.

Real-world examples of graphs include:

  • Social networks (Facebook, Instagram) - vertices are people, edges are friendships
  • Transportation systems - vertices are stations, edges are routes
  • The internet - vertices are websites, edges are hyperlinks
  • Electrical circuits - vertices are components, edges are wires
  • Food webs - vertices are species, edges show who eats whom

A graph can be directed (edges have arrows showing one-way relationships) or undirected (edges work both ways). For example, following someone on Twitter is directed (you follow them, but they might not follow back), while friendship on Facebook is undirected (if you're friends, you're both friends with each other).

Paths and Connectivity: Finding Your Way Through Networks 🗺️

Now students, let's talk about how we move through these networks. A path in graph theory is a sequence of vertices where each adjacent pair is connected by an edge. Think of it as giving someone directions: "Go from vertex A to vertex B, then to vertex C, then to vertex D."

The length of a path is simply the number of edges you travel along. So if you go from A to B to C, that's a path of length 2 (two edges).

Here's where it gets interesting: a graph is connected if there's a path between every pair of vertices. Imagine you're planning a road trip - if the road network is connected, you can drive from any city to any other city (even if you have to take a really long route).

Connectivity has huge real-world implications:

  • Internet connectivity ensures you can reach any website from anywhere
  • Transportation networks need connectivity so people can travel between any two locations
  • In social networks, connectivity measures how information spreads through communities

A cycle is a special type of path that starts and ends at the same vertex. It's like taking a round trip! Cycles are incredibly important because they provide alternative routes. If one road is blocked, you can take the long way around using a different part of the cycle.

The distance between two vertices is the length of the shortest path connecting them. This concept is fundamental to GPS systems - when your phone calculates the fastest route, it's finding the shortest path in a graph where vertices are intersections and edges are road segments.

Eulerian Concepts: The Seven Bridges Problem 🌉

Here's where graph theory gets really cool, students! Back in 1736, the mathematician Leonhard Euler solved a famous puzzle about the city of Königsberg (now Kaliningrad, Russia). The city had seven bridges connecting different parts of the land, and people wondered: could you take a walk that crosses each bridge exactly once?

Euler realized this was actually a graph theory problem. He represented each land area as a vertex and each bridge as an edge. The question became: can you draw this graph without lifting your pencil, using each edge exactly once?

An Eulerian path is a path that visits every edge exactly once. An Eulerian circuit is an Eulerian path that starts and ends at the same vertex (so it's also a cycle).

Here's Euler's brilliant discovery:

  • A graph has an Eulerian circuit if and only if every vertex has an even number of edges connected to it (called even degree)
  • A graph has an Eulerian path (but not circuit) if and only if exactly two vertices have an odd number of edges connected to them

This means the Königsberg bridge problem had no solution because more than two vertices had odd degree!

Modern applications of Eulerian concepts:

  • Mail delivery routes (postal workers want to travel each street exactly once)
  • Snow plow routing (clear each road exactly once)
  • DNA sequencing (reconstruct genetic sequences from fragments)
  • Circuit board design (trace paths without lifting the pen)

Hamiltonian Concepts: Visiting Every City Once 🏙️

While Eulerian paths focus on using every edge once, Hamiltonian paths tackle a different challenge: visiting every vertex exactly once. Named after mathematician William Rowan Hamilton, these concepts are central to many optimization problems.

A Hamiltonian path visits each vertex exactly once. A Hamiltonian circuit is a Hamiltonian path that returns to its starting vertex, creating a cycle that includes every vertex.

The famous Traveling Salesman Problem (TSP) is essentially about finding the shortest Hamiltonian circuit. Imagine you're a salesperson who needs to visit customers in different cities. You want to visit each city exactly once and return home, minimizing your total travel distance.

Unlike Eulerian paths, there's no simple rule to determine if a graph has a Hamiltonian path. This makes Hamiltonian problems much harder to solve, especially for large graphs. In fact, finding the shortest Hamiltonian circuit is one of the most famous "hard" problems in computer science.

Real-world Hamiltonian applications:

  • Delivery truck routing (visit each customer once)
  • Manufacturing processes (each step performed once in optimal order)
  • DNA sequencing (visit each genetic marker once)
  • Tournament scheduling (each team plays every other team once)

Companies like UPS and FedEx spend millions on software to solve variations of these problems, saving billions in fuel and time costs.

Network and Routing Applications: Graphs in Action 📱

Now let's see how all these concepts work together in modern technology, students! The internet itself is a massive graph where routers are vertices and network connections are edges. When you send a message, it travels through this graph using sophisticated routing algorithms.

Network reliability depends heavily on connectivity and redundancy. Engineers design networks with multiple paths between important nodes, so if one connection fails, data can still flow through alternative routes. This is why you can usually still access websites even when some internet cables are damaged.

Social media algorithms use graph theory to determine what content to show you. They analyze the graph of your friendships, looking at paths of length 2 (friends of friends) to suggest new connections, or using more complex algorithms to identify communities within the larger social graph.

GPS navigation systems solve shortest path problems millions of times per day. They model road networks as graphs and use algorithms like Dijkstra's algorithm to find optimal routes. Traffic data adds weights to edges, making congested roads "longer" in the graph even if they're physically shorter.

Supply chain optimization uses Hamiltonian concepts to design efficient delivery routes. Companies like Amazon use sophisticated algorithms to determine the order in which packages should be delivered, minimizing total distance while ensuring each customer is visited exactly once.

Conclusion

Graph theory provides powerful tools for understanding and optimizing networks of all kinds. From the basic concepts of vertices and edges to advanced ideas like Eulerian and Hamiltonian paths, these mathematical principles help solve real-world problems in technology, logistics, and beyond. Whether you're designing a computer network, planning a delivery route, or analyzing social connections, graph theory gives you the framework to find efficient solutions. The next time you use GPS navigation or see a "people you may know" suggestion on social media, you'll know there's elegant mathematics working behind the scenes!

Study Notes

• Graph: Collection of vertices (nodes) connected by edges (links)

• Path: Sequence of vertices connected by edges

• Connected graph: Graph where there's a path between every pair of vertices

• Cycle: Path that starts and ends at the same vertex

• Distance: Length of shortest path between two vertices

• Eulerian path: Path using every edge exactly once

• Eulerian circuit: Eulerian path that starts and ends at same vertex

• Eulerian circuit exists: If and only if every vertex has even degree

• Eulerian path exists: If and only if exactly 0 or 2 vertices have odd degree

• Hamiltonian path: Path visiting every vertex exactly once

• Hamiltonian circuit: Hamiltonian path returning to starting vertex

• Traveling Salesman Problem: Finding shortest Hamiltonian circuit

• Degree of vertex: Number of edges connected to that vertex

• Directed graph: Edges have direction (one-way relationships)

• Undirected graph: Edges work both ways (mutual relationships)

Practice Quiz

5 questions to test your understanding

Graph Theory — High School Integrated Math | A-Warded