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 , , , , has and . Because each edge has two ends, the sum of all the degrees is twice the number of edges: here . So the sum of the degrees is always even.
If a question gives degrees whose sum is odd, no such graph exists: the sum must equal 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 vertices has every pair of vertices joined, so it has 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.
Using or 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 vertices has exactly edges. Example: in a network with edges , , , , , , the edges , , , form a subgraph that is a tree (5 vertices, 4 edges). The whole graph is connected but not a tree, because -- is a cycle. If vertex is deleted together with its edges, is left with no edge and the subgraph is not connected.
To show a graph is not a tree, find a cycle or show that the number of edges is not . 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 , 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 , , , , give out-degree 2 and in-degree 1 for , and in-degree 2 for . A directed graph is strongly connected if, following the directions, you can get from any vertex to any other. The cycle passes through every vertex, so this graph is strongly connected.
Using the total number of edges at a vertex as the out-degree. Count only the edges that leave it.
Section 5
Representing graphs: link to matrices
A graph can be given as a list of edges, or as an adjacency matrix with a row and column for each vertex, where the entry is the number of edges joining them (AHL 1.14). For the sensor network with edges , , , , , (rows and columns in the order ): The matrix of an undirected graph is symmetric about the leading diagonal, and each row sum is the degree of that vertex (). For a simple graph every diagonal entry is 0 and every other entry is 0 or 1. For a directed graph the entry in row , column counts edges from to , so the matrix need not be symmetric.
Check a matrix by adding each row: the totals should match the degrees you counted from the edge list.
That's the notes covered.
Carry on to the next subtopic.
Exam questions on 3.14 Graph theory: definitions and representation
- A small office network has five computers , , , and , joined by the cables , , , and . The network is modelled as a graph with the computers as vertices and the cables as edges.Find the number of cables that must be added to so that every pair of computers is directly connected.2 marks
- In a town centre, four junctions , , and are joined by one-way streets: to , to , to , to and to . 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
- A phone company plans to link five towns , , , and . The possible cables and their lengths in km are (6), (9), (4), (7), (5), (8) and (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
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).