Lecture notes · Math for Computer Science · Lecture 10

Graph Theory III

MIT 6.042J Mathematics for Computer Science, lecture 10, explained in plain English

Want this lecture to stick? In LessonBound you get checked practice questions for every part, can ask about anything you don't get, and can listen with your screen off. Free, no ads.

Learn this lecture free

Watch or read the original lecture: MIT OpenCourseWare.

Part 1 · 0:00–10:00

This part introduces Euler tours, which are walks that use every edge of a graph exactly once, and starts a proof about when such a tour exists.

Key ideas

Words to know

Euler tour
A trip along the lines of a graph that uses every line exactly once and ends back where it started.
vertex
A point in a graph, like a dot or a place.
edge
A line in a graph that joins two vertices.
degree
The number of edges that touch a vertex.

Example

Imagine a set of rooms joined by doors, where each door is a graph edge. An Euler tour is a walk that goes through every door exactly once and ends in the room where you started. Each time you walk into a room, you must walk back out, so each room's doors are used in pairs.

3 checked practice questions for this part are in the app.

Part 2 · 10:00–20:00

This part shows why a connected graph where every vertex has even degree must have an Euler tour, using a proof by contradiction on the longest walk that repeats no edge.

Key ideas

Words to know

Euler tour
A trip through a graph that uses every edge exactly once and ends where it started.
walk
A route that moves from vertex to vertex along edges, where edges and vertices can repeat.
degree
The number of edges touching a vertex.
incident
Touching. An edge is incident to a vertex if the edge connects to that vertex.

Example

Imagine a mail carrier who must walk every street in a town exactly once and return to the post office. If every intersection has an even number of streets, the carrier can always arrange the route so they finish back at the start. Each time they enter an intersection, they can also leave it, so the streets pair up.

3 checked practice questions for this part are in the app.

Part 3 · 20:00–30:00

This part finishes the proof that a graph with an Euler tour must have one, then starts directed graphs and shows how adjacency matrices count walks.

Key ideas

Words to know

Euler tour
A walk through a graph that uses every edge exactly once and ends where it started.
Directed graph
A graph where each edge is a one-way connection, shown with an arrow.
Indegree
The number of edges pointing into a vertex in a directed graph.
Adjacency matrix
A grid of 1s and 0s that records which vertices are directly connected, with the direction of each connection.

Example

Think of a city with one-way streets. Each street is an edge with a direction. Counting how many streets lead into an intersection is like finding its indegree, and counting how many lead out is like finding its outdegree. An adjacency matrix is a table that records, for every pair of intersections, whether a one-way street runs directly between them.

3 checked practice questions for this part are in the app.

Part 4 · 30:00–40:00

This part shows why raising a graph's adjacency matrix to a power counts the walks of that length between points, and proves it using induction.

Key ideas

Words to know

adjacency matrix
A grid of numbers that records which points in a graph are joined by an edge. An entry is 1 if there is an edge and 0 if there is not.
walk
A route that moves from one point to another by following edges, one step at a time, where steps can repeat points or edges.
induction
A proof method. You check that the rule works for the first case, then show that if it works for some case, it must also work for the next one.
matrix multiplication
A way of combining two grids of numbers by multiplying and adding entries in a set pattern. Here it is used to turn a power k matrix times the adjacency matrix into the power k plus 1 matrix.

Example

Imagine a map of bus routes between towns, where each direct bus link is an edge. If you want to know how many ways you can get from town A to town B using exactly three bus rides, you count every route that takes three steps and ends in town B. The matrix power does this counting for you all at once.

3 checked practice questions for this part are in the app.

Part 5 · 40:00–50:00

This part explains what it means for a directed graph to be connected, introduces directed acyclic graphs (DAGs) and tournament graphs, and sets up a goal of finding a path that visits every vertex once.

Key ideas

Words to know

strongly connected
A directed graph where, for every pair of vertices, you can follow the arrows from one to the other.
directed acyclic graph (DAG)
A directed graph with arrows but no loop of arrows that brings you back to where you started.
tournament graph
A graph where every pair of vertices is joined by exactly one arrow, showing which one wins the match.
Hamiltonian path
A walk through a graph that visits every vertex exactly once.

Example

Think of a sports league where every team plays every other team once and the winner of each game is recorded as an arrow. You could try to line up all the teams so that each one beats the next one in the line, which is like finding a path that visits every team once. The lecture says this kind of path can always be found in a tournament graph.

3 checked practice questions for this part are in the app.

Part 6 · 50:00–1:00:00

This part starts a proof that every tournament graph, where every pair of nodes has exactly one arrow between them, contains a directed Hamiltonian path that visits every node exactly once.

Key ideas

Words to know

directed Hamiltonian path
A route that follows the direction of the arrows, goes from one node to the next, and visits every node exactly once.
induction
A proof method: show the claim holds for the smallest case, then show that if it holds for a size n, it also holds for size n plus 1.
induction hypothesis
The statement you assume is true for some size n, so you can use it to prove the statement for the next size up.
base case
The smallest case, which you check directly to get the induction started.

Example

Imagine a small school where every pair of students plays one game against each other, and each game has a winner. Can you line up all the students so that each one beats the next person in the line? The theorem says you always can, and the proof builds that line one student at a time.

3 checked practice questions for this part are in the app.

Part 7 · 1:00:00–1:10:00

This part shows how to fit one extra player into a line of players in a tournament, where every player beats some and loses to others, so that each player appears exactly once.

Key ideas

Words to know

tournament graph
A set of points where every pair is joined by exactly one arrow, so one always beats the other, like a round-robin where every team plays every other team once.
Hamiltonian path
A route that visits every point exactly once, with no point skipped and none visited twice.
directed edge
A one-way connection drawn as an arrow from one point to another, so it only goes one way.
contradiction
A result that cannot be true because it breaks something we already know, which shows our starting guess was wrong.

Example

Think of a line of runners in a race where every pair of runners has a clear winner in a head-to-head match. If you want to add a new runner and keep the line in order, you find the first runner in the line that the new one beats and step in just before them. Everyone else stays in order and nobody is left out.

3 checked practice questions for this part are in the app.

Part 8 · 1:10:00–1:22:45

This part explains what a king chicken is in a pecking-order graph and proves that the chicken with the most outgoing pecks is always a king.

Key ideas

Words to know

virtually peck
To peck someone indirectly, either directly or through one helper who pecks them for you.
tournament graph
A group where every pair of chickens has exactly one arrow showing who pecks whom.
outdegree
The number of arrows leaving a chicken, which here means how many chickens it pecks directly.
proof by contradiction
Assume the opposite of what you want to show, then follow the logic until you reach something impossible. That shows the assumption was wrong.

Example

Picture a group of friends where each person can either ask someone directly or ask a friend to ask for them. The friend who has the most people they can ask directly is also the one who can get the most people to do something, either alone or through a helper. In the lesson, the chicken with the most outgoing pecks is always able to reach everyone in that indirect way.

3 checked practice questions for this part are in the app.

← Lecture 6: Graph Theory and Coloring · Lecture 11: Relations, Partial Orders, and Scheduling →

Notes written by AI (Claude) from the lecture's official transcript, so check anything important against the lecture. MIT OpenCourseWare · CC BY-NC-SA 4.0 · not affiliated with or endorsed by MIT. These notes are shared under the same license.

LessonBound · Free lecture notes · Privacy · Terms · New York