Mathematics of Graphs
Represent connections, read degrees and components, and distinguish walks, trails, paths, circuits and cycles.
Connections become a graph
A street map contains distances, directions and shapes. Sometimes a question needs only the connections: which region can be reached across a bridge, or which pair of students share a study group? A graph keeps the relevant objects and links while discarding irrelevant geography.
A graph
\(G=(V,E)\) consists of a set of vertices \(V\) and a collection of edges \(E\), each joining vertices. Vertices represent objects; edges represent the relation chosen for the model. In an undirected graph the endpoints have no order.
The historical Königsberg question asks for a walk crossing every bridge exactly once. Counting regions and links is more useful than measuring the drawing. We will resolve the question in the next lesson using vertex degrees.
Choose what the vertices mean
A delivery company wants to know which warehouses have a direct road between them. What should vertices and edges represent? Does a crossing of two drawn roads necessarily create a vertex?
Hint
Choose objects first, then one precise relationship.
Show worked solution
Vertices represent warehouses and edges direct roads. A crossing is a connection only if the model explicitly includes an accessible junction there. Two lines crossing on the page do not by themselves create a new warehouse.
Königsberg bridges and graph
Graph types and modeling choices
Simple graph and multigraph
A simple graph has no loops and at most one edge between any two vertices. A loop joins a vertex to itself. A multigraph allows parallel edges. In this lesson loops are allowed when explicitly drawn; individual edges remain distinguishable.
| Type | Meaning | Suitable context |
|---|---|---|
| Undirected | Connection works both ways | Mutual friendship |
| Directed | Arcs have specified orientation | One-way streets |
| Weighted | Edges carry numerical costs | Travel time |
| Null / edgeless | Vertices but no edges | No pairs related |
| Complete Kₙ | Every distinct pair is joined once | All pairs can communicate directly |
Write the vertex and edge collections
Show worked solution
V = {u, v, w, z}. Let e₁ be the loop uu; e₂ = uw, e₃ = wv, e₄ = vz, and e₅, e₆, e₇ be the three distinct uv edges. An ordinary set of endpoint pairs would collapse the parallel links, so retain edge labels.
Which type fits?
Model (a) repeated games between baseball teams, (b) one-way flights, (c) mutual friendship with oneself excluded.
Hint
Ask whether direction, repetition or a self-link carries meaning.
Show worked solution
(a) An undirected multigraph: each game is a separate edge. (b) A directed graph: the reverse flight is a separate possibility. (c) A simple undirected graph. A single relationship graph cannot reveal how many study groups a pair shares unless multiplicities or weights record that.
Degree, parity and the handshaking principle
Degree
The degree \(\deg(v)\) of an undirected vertex is its number of incident edge ends. A loop contributes two. An isolated vertex has degree zero; a pendant vertex has degree one. An odd/even vertex has odd/even degree.
Every edge contributes two ends, so the degree sum is even. Consequently the number of odd-degree vertices is even. This checks a proposed model but does not by itself prove that every even-sum degree list is realizable as a simple graph.
Read the multigraph carefully
Show worked solution
At u, the loop supplies 2, uw supplies 1 and the three uv edges supply 3: deg(u) = 6. At v, wv, vz and the three uv edges give 5. At w, uw and wv give 2; at z, vz gives 1.
\[6+5+2+1=14=2(7)\]u and w are even; v and z are odd. There are two odd vertices as required.
A missing degree
An undirected graph has eight edges and five vertices. Four degrees are 4, 3, 3 and 2. Find the fifth. Is this degree-sum check enough to determine all connections?
Hint
Use 2|E|, then distinguish a count from a complete edge description.
Show worked solution
The fifth degree is 16 − 12 = 4. Degree counts do not specify which pairs are adjacent; different networks can have the same degree sequence.
Find the mistake: a loop is one edge
A student says deg(u) = 5 in the displayed multigraph because the loop is only one edge. Identify the error.
Hint
Degree counts ends incident at a vertex.
Show worked solution
One loop is indeed one edge, but both its ends meet u. It contributes two to degree. Correcting the count gives deg(u) = 6 and restores the total 14 = 2 × 7.
Connectedness and components
Connected graph
A graph is connected when every pair of vertices can be joined by a path. A component is a maximal connected part. A disconnected graph has two or more components; there can be more than two, and an isolated vertex forms a component by itself.
A graph can be connected without being complete: indirect routes may connect two nonadjacent vertices. In a directed graph, distinguish directed reachability from the undirected underlying connections.
A study-group network
Show worked solution
Degrees: Matt 2, Amber 3, Oscar 2, Laura 2, Kayla 1. Amber has the most distinct study partners, Kayla has one, and Laura has two. Everyone is connected through the chain Kayla–Oscar–Amber and the remaining links. The wording “number of groups” would require extra information about which group each edge represents.
Deleting a link
In the study network, what happens if Oscar–Kayla is removed? Compare with removing Matt–Laura.
Hint
An edge whose removal increases the number of components is a bridge.
Show worked solution
Removing Oscar–Kayla isolates Kayla, producing two components. Removing Matt–Laura leaves a route Matt–Amber–Laura, so the graph stays connected. The first edge is a bridge; the second is not.
Tables, edge lists and complete graphs
A symmetric relationship table and an undirected graph can describe the same data. Read only one triangular half of a symmetric table when counting edges: the entries above and below the diagonal repeat each relationship.
| Matt | Amber | Oscar | Laura | Kayla | |
|---|---|---|---|---|---|
| Matt | — | X | X | ||
| Amber | X | — | X | X | |
| Oscar | X | — | X | ||
| Laura | X | X | — | ||
| Kayla | X | — |
Every team meets once
Show worked solution
Each team meets five others, giving degree sum 6 × 5 = 30. This counts each game for both teams, so there are 30/2 = 15 games. Equivalently choose two teams from six.
Recover the number of people
A complete simple friendship network has 28 edges. How many people does it have?
Hint
Solve n(n − 1)/2 = 28; retain the positive integer.
Show worked solution
There are eight people. Each has degree seven; 8 × 7/2 = 28 confirms the result.
Equivalent graphs and relabeling
Same connections, different drawing
Graphs are equivalent (isomorphic) when a bijection between their vertex sets preserves adjacency and edge multiplicity. A redraw can bend edges or move vertices without changing the graph. If labels represent fixed people or places, preserve their identities when comparing the same labeled network.
Vertex count, edge count, components and the sorted degree list are useful invariants. A mismatch disproves equivalence. Matching them is necessary but not sufficient: inspect actual adjacency or exhibit a full correspondence.
Equal degrees do not settle equivalence
Show worked solution
No. The cycle is connected; the two triangles have two components. A bijection preserving edges would preserve paths and therefore connectedness. Equal degree lists alone cannot establish equivalence.
A labeled comparison
One graph has edges AC, CB, AD, DB, AE, EB. A second has AC, CD, AB, BD, AE, ED. Are they the same labeled graph? Are they isomorphic if relabeling is allowed?
Hint
Separate fixed-label equality from structural equivalence.
Show worked solution
They are not the same labeled graph: for example CB occurs only in the first. Swapping labels B and D in the first gives the second, so they are isomorphic as unlabeled structures. State which convention you mean rather than calling them simply “not equivalent.”
Walks, trails, paths, circuits and cycles
Route vocabulary
A walk follows edges between consecutive vertices and may repeat edges or vertices. A trail repeats no edge. A path repeats no vertex. A circuit is a closed trail. A cycle is a closed route with no repeated vertex except the shared start/end. Here paths are open unless explicitly discussing the closed cycle convention.
Some teaching sources call a cycle a “closed path.” We state the endpoint exception explicitly. A proposed vertex sequence is not even a walk if one consecutive pair lacks an edge. In a multigraph, name edge identities when necessary.
Classify five sequences
Show worked solution
| Sequence | Classification and reason |
|---|---|
| E–C–D–B–E | Not a walk: EC is absent |
| A–C–D–E–B–A | Walk, trail, closed walk, circuit and cycle; start/end A is the only repetition |
| B–D–E–B–C | Open walk and trail; not a path because B repeats |
| A–B–C–D–B–A | Closed walk; AB repeats in reverse, so not a trail or circuit |
| C–D–E–B–C | Cycle and circuit, hence closed walk and trail |
A route can have several valid classifications. Do not choose a single label if the question asks for all that apply.
Construct rather than recognize
Give an open path of length three and a closed walk that is not a trail on the displayed graph.
Hint
Length counts traversed edges, including repeats.
Show worked solution
A–B–E–D is a path of length three. A–B–A is a closed walk of length two but traverses the same undirected edge twice. Many other valid constructions exist.
Explore and audit a network
Toggle links in the explorer, predict degree changes, then check the degree sum and components. A new nonloop edge raises two degrees by one. Use this to explain why the number of odd vertices remains even.
A modeling decision
A transit table lists direct rail links between six towns. Explain how to determine whether a passenger can travel between every town, and whether the town with highest degree must be geographically central.
Hint
Reachability concerns paths; position in a schematic diagram is not a measured location.
Show worked solution
Construct one vertex per town and an edge per direct rail link, then find the components. A single component means all towns are mutually reachable in an undirected model. The highest-degree town has the most direct links, but neither degree nor the drawing establishes geographic centrality or shortest travel time.
Interactive exploration
References
R. N. Aufmann, J. S. Lockwood, R. D. Nation and D. K. Clegg, Mathematical Excursions, 3rd ed., graph theory chapters. Further reading: OpenStax, Contemporary Mathematics, Graph Theory. Figures are redrawn for this lesson; vertex positions are schematic.
