All revision notes topics

3.14 Graph theory: definitions and representationIB Maths: Applications and Interpretation HL: Revision notes

Section 1

Graphs, vertices and edges

A graph is a set of vertices (points) joined by edges (lines). Two vertices joined by an edge are adjacent vertices; two edges that share a vertex are adjacent edges. The degree of a vertex is the number of edges meeting at it. Example: a network with edges ABAB, ACAC, BCBC, CDCD, DEDE has deg⁡C=3\deg C=3 and deg⁡E=1\deg E=1. Because each edge has two ends, the sum of all the degrees is twice the number of edges: here 2+2+3+2+1=10=2×52+2+3+2+1=10=2\times5. So the sum of the degrees is always even.

Key termsgraphvertexedgeadjacentdegree
Exam tip

If a question gives degrees whose sum is odd, no such graph exists: the sum must equal 2×2\times the number of edges.

Section 2

Types of graph and modelling

A simple graph has no loops (an edge from a vertex to itself) and no two edges joining the same pair of vertices. A complete graph on nn vertices has every pair of vertices joined, so it has n(n−1)2\frac{n(n-1)}{2} edges: 10 edges for 5 vertices, 15 for 6. A weighted graph gives each edge a number, the weight, such as a distance in km, a cost or a time; an unweighted graph does not. To model a real situation, make the objects vertices and the connections edges: computers and cables, towns and roads, sensors and links. If a question gives weights, add them to find the total length or cost of a set of edges.

Key termssimple graphcomplete graphweighted graph
Common mistake

Using n2n^2 or n(n−1)n(n-1) for the number of edges of a complete graph. Each edge is shared by two vertices, so divide by 2.

Section 3

Connected graphs, subgraphs and trees

A graph is connected if there is a path along edges between every pair of vertices. A subgraph is formed from some of the vertices and edges of a graph. A tree is a connected graph with no cycles. A tree with nn vertices has exactly n−1n-1 edges. Example: in a network with edges PQPQ, PRPR, QRQR, QSQS, RSRS, STST, the edges PQPQ, PRPR, QSQS, STST form a subgraph that is a tree (5 vertices, 4 edges). The whole graph is connected but not a tree, because PP-QQ-RR is a cycle. If vertex SS is deleted together with its edges, TT is left with no edge and the subgraph is not connected.

Key termsconnectedsubgraphtreecycle
Exam tip

To show a graph is not a tree, find a cycle or show that the number of edges is not n−1n-1. To show it is a tree, show both connected and no cycles.

Section 4

Directed graphs

In a directed graph each edge has a direction, shown X→YX\to Y, such as a one-way street. The out-degree of a vertex is the number of edges leaving it and the in-degree is the number of edges entering it. The sum of the in-degrees equals the sum of the out-degrees, which equals the number of edges. Example: one-way streets W→XW\to X, X→YX\to Y, Y→ZY\to Z, Z→WZ\to W, X→ZX\to Z give out-degree 2 and in-degree 1 for XX, and in-degree 2 for ZZ. A directed graph is strongly connected if, following the directions, you can get from any vertex to any other. The cycle W→X→Y→Z→WW\to X\to Y\to Z\to W passes through every vertex, so this graph is strongly connected.

Key termsdirected graphin-degreeout-degreestrongly connected
Common mistake

Using the total number of edges at a vertex as the out-degree. Count only the edges that leave it.

That's the notes covered.

Carry on to the next subtopic.

Exam questions on 3.14 Graph theory: definitions and representation

  1. A small office network has five computers AA, BB, CC, DD and EE, joined by the cables ABAB, ACAC, BCBC, CDCD and DEDE. The network is modelled as a graph GG with the computers as vertices and the cables as edges.
    Find the number of cables that must be added to GG so that every pair of computers is directly connected.2 marks
  2. In a town centre, four junctions WW, XX, YY and ZZ are joined by one-way streets: WW to XX, XX to YY, YY to ZZ, ZZ to WW and XX to ZZ. The street system is modelled as a directed graph, with the junctions as vertices and the one-way streets as directed edges.
    Show that the directed graph is strongly connected.2 marks
  3. A phone company plans to link five towns AA, BB, CC, DD and EE. The possible cables and their lengths in km are ABAB (6), ACAC (9), BCBC (4), BDBD (7), CDCD (5), CECE (8) and DEDE (3). This is modelled as a weighted graph with the towns as vertices and the cable lengths as weights.
    Write down the degree of each vertex, and show that the sum of the degrees is twice the number of edges.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).