All revision notes topics

Networks and graphsIB MYP Maths Extended: Revision notes

Section 1

Vertices, edges and degree

A network (graph) is made of vertices (also called nodes) joined by edges (also called arcs). Towns and roads, computers and cables, and islands and ferries are all examples. The degree of a vertex is the number of edges that meet there. For a network with edges ABAB, ACAC, ADAD, BCBC: AA has degree 3, BB and CC have degree 2 and DD has degree 1. Every edge has two ends, so the sum of all the degrees is twice the number of edges: 3+2+2+1=8=2×43+2+2+1=8=2\times4. This means the number of odd-degree vertices is always even.

Key termsnetworkvertexedgedegree
Common mistake

Mixing up the number of edges with the sum of the degrees. The sum of the degrees is double the number of edges.

Section 2

Paths and connected networks

A path is a route along edges that does not visit any vertex more than once. A network is connected if there is a path between every pair of vertices. To count the paths from one vertex to another, list them in order: choose the first step, then follow every branch. For the road network with PQ,PR,QR,QS,RS,RT,STPQ,PR,QR,QS,RS,RT,ST there are 7 paths from PP to TT: PQRTPQRT, PQRSTPQRST, PQSTPQST, PQSRTPQSRT, PRTPRT, PRSTPRST and PRQSTPRQST. Listing systematically stops you missing paths or repeating them.

Key termspathconnected
Exam tip

List routes starting with each first edge in turn. Cross out any route that repeats a vertex.

Section 3

Weighted networks and shortest paths

In a weighted network each edge has a number (its weight), such as a distance in km, a time or a cost. The length of a path is the sum of the weights of the edges it uses. To find the shortest path, work out the length of each possible path, or build up the shortest distance to each vertex step by step. From PP to TT in the road network: PQRST=4+2+3+5=14PQRST=4+2+3+5=14, PQRT=15PQRT=15, PQST=15PQST=15, PRST=15PRST=15, PRT=16PRT=16. The shortest path is PQRSTPQRST with length 14 km. The route with the fewest edges is not always the shortest. PRTPRT has the fewest edges but is longer than PQRSTPQRST.

Key termsweighted networkshortest path
Common mistake

Choosing the path with the fewest edges. Add up the weights before deciding.

Section 4

Adjacency matrices

An adjacency matrix records which vertices are joined. For vertices in a fixed order, the entry in row ii and column jj is 11 if there is an edge between them and 00 if not. It is symmetric, and each row total is the degree of that vertex. For edges AB,AC,AD,BCAB,AC,AD,BC: (0111101011001000)\begin{pmatrix} 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \end{pmatrix} Writing the matrix as M\mathbf M, each entry of M2\mathbf M^2 counts journeys of exactly two edges between two vertices (a vertex may be revisited, e.g. C→A→CC\to A\to C). For the ferry network with edges AB,AC,BC,CDAB,AC,BC,CD, the CC to CC entry of M2\mathbf M^2 is 33: via AA, via BB and via DD. Higher powers Mn\mathbf M^n count journeys of exactly nn edges.

Key termsadjacency matrixsymmetric
Exam tip

Check your matrix: the diagonal is all zeros, it is symmetric, and each row total equals that vertex's degree.

Section 5

Euler and Hamiltonian routes

An Euler trail uses every edge exactly once. An Euler circuit is an Euler trail that returns to its start. Use the degrees:

  • all vertices even: an Euler circuit exists (start anywhere)
  • exactly two odd vertices: an Euler trail exists, starting at one odd vertex and ending at the other
  • more than two odd vertices: no Euler route A Hamiltonian path visits every vertex exactly once, and a Hamiltonian cycle also returns to the start. There is no simple degree test for these, so look for a route by trying. Example with edges AB,AC,BC,CDAB,AC,BC,CD: odd vertices are CC (degree 3) and DD (degree 1), so an Euler trail exists, e.g. C→A→B→C→DC\to A\to B\to C\to D. A Hamiltonian path is D→C→A→BD\to C\to A\to B, but there is no Hamiltonian cycle because DD has only one edge.
Key termsEuler trailEuler circuitHamiltonian path
Common mistake

Mixing up Euler (every edge once) and Hamiltonian (every vertex once) routes.

That's the notes covered.

Carry on to the next subtopic.

Exam questions on Networks and graphs

  1. A network has four vertices AA, BB, CC and DD. The edges are ABAB, ACAC, ADAD and BCBC. Each edge joins two different vertices, and no two vertices are joined by more than one edge.
    Write down the adjacency matrix of the network, with the vertices in the order AA, BB, CC, DD.2 marks
  2. Five towns PP, QQ, RR, SS and TT are joined by roads. The road lengths in km are PQ=4PQ=4, PR=7PR=7, QR=2QR=2, QS=6QS=6, RS=3RS=3, RT=9RT=9 and ST=5ST=5. There are no other roads, and a route may not visit the same town twice.
    Find the shortest route from PP to TT and state its length.2 marks
  3. A complete network KnK_n has nn vertices, with every pair of vertices joined by exactly one edge. K3K_3 has 3 edges, K4K_4 has 6 edges and K5K_5 has 10 edges. An Euler circuit is a route that starts and ends at the same vertex and uses every edge exactly once. A connected network has an Euler circuit if and only if every vertex has even degree.
    Describe the pattern in the number of edges of KnK_n and write a general rule for the number of edges in terms of nn. Check your rule using K5K_5 and predict the number of edges of K6K_6.3 marks
See the full worksheet

Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).