Speak Maths Β· University
Graphs: dots, lines and counting walks
A graph is dots joined by lines: the simplest picture of anything connected, from paths in a park to friendships to the internet. A small table of 0s and 1s can hold the whole picture.
Draft: written by an AI helper and not yet checked by a teacher.
The alphabet
Read each sign aloud, the way it is written under it.
- Say: G equals V and E; the size of V, the size of EMeans: A graph G is a set V of vertices (dots) and a set E of edges (lines); bars count how many.
- Say: the degree of vMeans: How many edges touch the vertex v.
- Say: u is adjacent to v (u tilde v)Means: u and v are joined by an edge: they are neighbours.
- Say: v zero is adjacent to v one, and so on to v k; if v k is v zero again, it is a cycleMeans: A path moves along edges from one vertex to another; ending where it began makes a cycle.
- Say: the number of edges is the number of vertices minus oneMeans: A connected graph with this count is a tree: joined, with no cycle.
- Say: A of u, v is one exactly when u is adjacent to vMeans: The adjacency matrix A has a 1 where there is an edge and a 0 where there is none.
- Say: A squared, entry i j, is the sum over k of A i k times A k jMeans: This entry counts the walks of length two from i to j: one for each middle vertex k.
- Say: the sum of deg v over all v in V equals two times the number of edgesMeans: Every edge has two ends, so adding all the degrees counts each edge twice.
The story: The bridges of a park
Tap a line to see its words.
- A park has some spots and the paths between them. Draw a dot for each spot and a line for each path: a graph.
- The park has five spots, called a to e, and five paths.
- Spot b is next to c and to d; spot a is not next to d.
- Three paths meet at b; only one reaches a.
- A walk from a to e that never repeats a spot: a path of three steps.
- From b to c to d and back to b: a cycle, a round trip.
- Add up the paths meeting at each spot: ten, which is twice the five paths, since each path has two ends.
- In the table of 0s and 1s, the entry for b and c is 1; for a and d it is 0.
- Multiplying the table by itself shows one walk of two steps from a to d: through b.
- The council closes the path between c and d. Now the park has one path fewer than spots: a tree.
In words this story is 749 letters long; in symbols, 104.
Read it
What does it say?
Write it
Which notation says this?
The degree of the vertex v is four.
Adding up all the degrees gives twice the number of edges.
The number of walks of length two from i to j is the entry in row i, column j of the matrix A squared.
The vertices a and b are not adjacent.
A walk of two steps: from a to b, then from b to c.
A cycle of length three: a to b to c and back to a.
The graph has seven vertices and six edges.
A graph with ten edges: its degrees add up to twenty.
The vertex v is isolated: no edge touches it.
In the adjacency matrix: there is no edge between u and v.
The number of walks of length three from i to j.
A tree with n vertices has n minus one edges.
Build it
Tap the tiles in order. One tile does not belong.
The number of edges is the number of vertices, minus one.
The entry of A at u and v is one exactly when u and v are adjacent.
The number of two-step walks from i to j: the sum over k of A at i, k times A at k, j.
A cycle of four vertices: a to b, to c, to d, and back to a.
The degree of v is the sum of row v of the adjacency matrix.
In a tree the degrees add up to twice the number of edges, and the edges are the vertices minus one.
Challenges
Creative puzzles that use every sign of this chapter. Take your time; there is no clock.
1 The park, as a table
The table is the adjacency matrix of the park from the story. Judge each sentence about the park.
| β | |||||
| β | β | β | |||
| β | β | ||||
| β | β | β | |||
| β |
A tick means the spot in the row is adjacent to the spot in the column.
Row b has three ticks, so deg b = 3. No row is empty, so no spot is isolated, yet no spot touches all the others. The ticks come in mirror pairs, which is why degrees add up to twice the edges.
2 Graph words
Five lines about a graph. Pair each with what it says.
Tap a line, then its meaning.
The look-alikes differ in one detail: βno edge touches vβ, βv and u are neighboursβ, a closed round trip, a treeβs edge count, and the two-ends rule.
3 A treeβs count
A tree on the parkβs spots must have one path fewer than spots. One tile is wrong. Find it, then fix it.
Tap the tile that is wrong.
A tree is connected with no cycle, which uses up exactly one edge fewer than there are vertices; adding one more edge would close a cycle.
4 Two ends to every path
This should say that the degrees add up to twice the number of edges. One tile is wrong. Find it, then fix it.
Tap the tile that is wrong.
The degrees count edge-ends, and each edge has two ends. The total is therefore tied to the edges, not to the vertices.
5 Walks of two steps
The matrix is the 4-cycle: four spots in a ring, each next to its two neighbours. How many walks of two steps lead from vertex 1 to vertex 3?
The entry of AΒ² counts the middle spots: from 1 to 3 one can go through 2 or through 4, so there are two walks.
6 An impossible set of degrees
Five spots have degrees 3, 3, 2, 2 and one more, x. Which value of x is impossible?
The degrees must add up to twice the number of edges, an even number. With x = 1 the sum is 11, which is odd; the other two sums, 12 and 14, can be realised.
7 A busy but not too busy park
Every spot touches at least one path, but no spot touches all the other spots. Write it in symbols.
One way:
A degree of at least 1 rules out isolated spots; a degree below the number of other spots rules out a spot joined to everyone else.
8 A friend in common
Any two different spots have a spot adjacent to both. Write it in symbols.
One way:
Read: for every pair of distinct vertices there exists a third vertex joined to each of them. A triangle of spots has this property; a long chain does not.
9 The hub
Five rooms of a house and the doors between them, as an adjacency matrix. Judge each sentence about this graph.
| β | β | β | β | ||
| β | β | ||||
| β | β | ||||
| β | |||||
| β |
A tick means the room in the row has a door to the room in the column.
Room p opens onto all four others: the hub. Rooms p, q, r form a triangle, so with five doors on five rooms this is no tree. Rooms s and t share no door, but both open onto the hub: exactly one two-step walk between them.
10 Six stations, five tracks
Six stations on a small railway and the tracks between them, as an adjacency matrix. Judge each sentence about this graph.
| β | ||||||
| β | β | |||||
| β | β | β | ||||
| β | ||||||
| β | β | |||||
| β |
A tick means a track joins the station in the row to the station in the column.
Six stations, five tracks, all connected: a tree. Station c is a junction of degree 3; a to b to c to e to f is a path of four steps; a tree has no triangle. The degrees add up to 10, twice the five tracks, not 12.
11 Reading the table
Five things one can read off an adjacency matrix. Pair each with its meaning.
Tap a line, then its meaning.
A single entry says whether an edge is there. Summing a column counts the edges at one vertex; summing everything counts every edge from both ends. Squaring the matrix counts walks through a middle vertex.
12 Five counts
Five counts about a graph. Pair each with what it counts.
Tap a line, then its meaning.
Bars count a set. A tree is as sparse as a connected graph can be; the complete graph is as dense as a simple graph can be, with one edge for each of the pairs of vertices.
13 Through the middle
This should count the two-step walks from i to j: a step from i to some k, then a step from k to j. One tile is wrong. Find it, then fix it.
Tap the tile that is wrong.
The second step must start where the first ended, at k, and finish at j. The tile A at i, j does not pass through k at all; A at k, k is a loop and A at j, j likewise.
14 Close the loop
This should be a cycle through a, b and c: three steps that return to the start. One tile is wrong. Find it, then fix it.
Tap the tile that is wrong.
A cycle ends where it began, so the last step must come back to a. Going on to d makes a path of three steps; going back to b retraces an edge and never returns to a.
15 Six spots, two paths each
Six spots in a park, each with exactly two paths. How many paths are there?
The degrees add up to 12, and that is twice the number of edges, so there are 6: six spots in a ring, for instance. Counting 12 forgets that each path has two ends.
16 A tree of ten
A tree has ten vertices. What do its degrees add up to?
A tree on ten vertices has nine edges, and every edge adds two to the degree sum: 18. Nine counts the edges once; twenty would need ten edges.
17 Out and back
Four spots, every pair joined by a path. How many walks of two steps start at spot 1 and end at spot 1?
A two-step walk from 1 back to 1 goes out along an edge and straight back. Spot 1 has three neighbours, so three such walks: the diagonal of A squared is the degree. Zero forgets that a walk may reuse an edge; nine squares the degree instead.
18 Three paths from everywhere
In this park every spot has exactly three paths. Write it in symbols, then compare.
One way:
For every vertex, the degree is three: a 3-regular graph. The handshake rule then says 3 times the number of spots is twice the number of paths, so the number of spots must be even.
19 A triangle somewhere
Somewhere in the graph three vertices are each adjacent to the other two. Write it in symbols, then compare.
One way:
A triangle is a cycle of length three: there exist three vertices with the three edges between them. The chain form and the and-form say the same thing.
Chapter finished. The symbols are yours.
Tell your own
Draw a small graph of your own (a road map, a family, a game board) and write its vertices, its edges, and the degree of one vertex.
Kept on this device only.