IB Mathematics: Applications and Interpretation HL 6 Sections80 LessonsLifetime
Introduction to graph theory AI HL
Lesson 3.14 · Introduction to graph theory
Represent networks with vertices and edges, and interpret weighted, directed, and connected graphs.
Joined in praise
“O magnify the LORD with me, and let us exalt his name together.” Psalm 34:3 (KJV)
A network diagram helps us see connections between places or people. This psalm invites us to praise God together. As you study how individual vertices become part of a larger network, consider how you can encourage someone else and join them in giving thanks to the Lord.
Learning objectives
By the end of this lesson, you should be able to:
- model a real network using vertices and edges;
- identify adjacent vertices and adjacent edges, and calculate vertex degrees;
- recognize simple, complete, weighted, and directed graphs;
- interpret connectedness and strong connectedness;
- find in-degrees and out-degrees in a directed graph; and
- identify subgraphs and trees.
1. What is a graph?
In graph theory, a graph is a collection of vertices joined by edges. Vertices can represent stations, computers, towns, or people. Edges represent connections such as railway links, cables, roads, or relationships.
A graph records which objects are connected. The positions of its dots on the page need not match their geographical positions. Redrawing the same vertices and edges in a different arrangement does not change the graph.
The edge set is
. The drawing has five vertices and seven edges.
A bus connects town
to towns
and
. There is also a direct route between
and
. Represent the towns by vertices
and the direct routes by edges
. The resulting graph is a triangle.
2. Adjacency and degree
Two vertices are adjacent if an edge joins them. Two edges are adjacent if they share a vertex. The degree of a vertex in an undirected graph is the number of edges incident to it.
In the diagram above,
is adjacent to
,
, and
, so
. The edges
and
are adjacent because they share
. The edges
and
are not adjacent.
Every undirected edge contributes
to the degree of each endpoint. Consequently, the sum of all vertex degrees equals twice the number of edges:
![]()
For the diagram above, the degrees of
are
. Their sum is
, which equals
because the graph has seven edges.
3. Simple and complete graphs
A simple graph has no loops from a vertex back to itself and no repeated edges between the same pair of vertices. A complete graph joins every pair of distinct vertices. The complete graph on
vertices is denoted by
.
Each of the
vertices in
has degree
. Counting all these degrees and dividing by two gives its number of edges:
![Rendered by QuickLaTeX.com \[\boxed{\text{Edges in }K_n=\frac{n(n-1)}2}\]](https://i0.wp.com/alphyschool.org/wp-content/ql-cache/quicklatex.com-348ecf17963010c433dd6c3515aa5940_l3.png?resize=227%2C55&ssl=1)
Six research stations each need a direct link to every other station. The network is
and needs:
![]()
Each station has degree
.
4. Weighted graphs
A weighted graph assigns a number, called a weight, to each edge. A weight might represent distance, travel time, cost, or capacity. Specify what the weights mean and keep their units consistent.
Suppose direct road distances are
km,
km, and
km. The route from
to
through
has total weight
km. It is shorter than the direct edge
, whose weight is
km.
5. Connected graphs and paths
A path is a sequence of joined vertices. An undirected graph is connected if a path exists between every pair of vertices. If some vertices cannot be reached from others, the graph is disconnected.
The five-vertex diagram above is connected: for example,
is a path from
to
. A path need not use a direct edge between its endpoints.
A network has vertices
and edges
. It is connected. If edge
is removed, the graph separates into the groups
and
, so it is disconnected.
6. Directed graphs, in-degree, and out-degree
In a directed graph, an edge has an arrow. The edge
permits movement from
to
; it does not automatically permit travel from
to
. Directed edges can also carry weights.
A vertex’s in-degree counts arrows arriving at it. Its out-degree counts arrows leaving it. Every arrow has one start and one end, so:
![]()
A directed graph is strongly connected if, for every pair of vertices, one can travel from the first to the second following the arrows.
A one-way network has edges
,
,
, and
. Vertex
has in-degree
and out-degree
. The whole graph is not strongly connected because there is no directed route from
back to
,
, or
.
7. Subgraphs and trees
A subgraph uses some vertices and some edges of a larger graph, retaining only edges whose endpoints are included. A tree is a connected graph with no cycles. A cycle is a closed route that returns to its starting vertex without repeating other vertices.
A tree on
vertices has exactly
edges. There is exactly one path between any two vertices of a tree.
Take the five-vertex graph in Section 1. Keep all its vertices but only edges
,
,
, and
. This subgraph is connected, has no cycle, and has
edges. Therefore it is a tree.
IB-style Paper 1 · Skill practice
-
A graph has vertices
and edges
. Find the degree of each vertex and check the sum-of-degrees rule. [4 marks]
Show solution
,
,
, and
. Their sum is
, matching the four edges. -
How many edges does
have? What is the degree of each vertex? [3 marks]
Show solution
![Rendered by QuickLaTeX.com \[\text{Edges}=\frac{8(7)}2=\boxed{28}\]](https://i0.wp.com/alphyschool.org/wp-content/ql-cache/quicklatex.com-5d5e9e33c44b64d1a4a01230e5ba979f_l3.png?resize=178%2C42&ssl=1)
Each vertex has degree
. -
A directed graph has edges
,
,
,
, and
. Find the in-degree and out-degree of
. [3 marks]
Show solution
Arrows from
and
arrive at
, so its in-degree is
. Arrows from
go to
and
, so its out-degree is
. -
A connected graph has
vertices and
edges. Can you conclude that it is a tree? Explain. [3 marks]
Show solution
Yes. A connected graph with
vertices and
edges has no cycles and is a tree. Here
. -
In a weighted network, edges
,
, and
have weights
,
, and
, respectively. Compare the two routes from
to
. [3 marks]
Show solution
The route
has weight
; the direct edge has weight
. The route through
is shorter by
weight units. -
A graph has vertices
and edges
. Is it connected? Is it a tree? [4 marks]
Show solution
It is connected: each vertex can be reached from every other. It is not a tree because
is a cycle.
IB-style applications · Linked questions
The following questions use one network across several connected parts. Each solution explains the graph decision as well as the calculation.
Application 1 · Regional transport network
Five towns
are joined by undirected roads. Their direct road connections are:
![]()
- State the order and size of the graph. [2 marks]
- Find the degree of each vertex and verify the sum-of-degrees rule. [5 marks]
- State whether the graph is connected. Give a path from
to
as evidence. [3 marks]
Show worked solution · Application 1
(a) The graph has
vertices (order) and
edges (size).
(b) The degrees of
are
, respectively. Their sum is
.
(c) Yes, it is connected. For example,
is a path from
to
, and all remaining vertices join the same network.
Application 2 · Weighted delivery routes
A delivery network has undirected edges with the following distances in kilometres:
,
,
,
,
,
,
,
, and
.
- Calculate the total length of the routes
and
. [4 marks] - Find a shortest route from
to
and state its length. Show why going directly from
to
is less effective once
has been reached. [5 marks] - A van must use roads with a total length below
km. Determine whether it can travel from
to
under this limit. [2 marks]
Show worked solution · Application 2
(a) The first route has length
. The second has length
.
(b) A shortest route is
, of length
. From
, using
costs
km, less than the direct edge
km. To reach
from
,
costs
km; alternatives
and
cost
and
km. Thus the displayed route achieves the shortest total.
(c) Yes.
, so the van meets the limit.
Application 3 · One-way shuttle service
Four campuses
are connected by one-way shuttle routes:
![]()
- State the in-degree and out-degree of each campus. [4 marks]
- Determine whether the directed graph is strongly connected. Give a directed route from
to
and one from
to
. [4 marks] - If the route
is closed, determine whether the remaining directed graph is strongly connected. [2 marks]
Show worked solution · Application 3
(a) In-degree and out-degree, respectively:
,
,
,
. Both degree totals equal
, the number of arrows.
(b) Yes. Routes include
and
. The cycle
, together with routes into and out of
, makes every vertex reachable from every other.
(c) No. Without
, there is no route leaving
, so a traveller at
cannot reach another campus.
Application 4 · Planning a fibre-optic network
Five offices
can be linked by cables. The available undirected links have costs, in thousands of euros:
,
,
,
,
,
, and
.
- Explain why links
,
,
, and
form a tree connecting all five offices. [3 marks] - Find the total cost of these four links. [2 marks]
- An engineer proposes adding
. Explain what happens to the tree property, and find the resulting total cost. [3 marks]
Show worked solution · Application 4
(a) These edges form the chain
. It connects every office, has no cycle, and uses
edges, so it is a tree.
(b) Cost
thousand euros.
(c) Adding
creates the cycle
. The graph is no longer a tree. Its total cost becomes
thousand euros.
Application 5 · Completing a communication network
Seven research centres each require a direct two-way communication link to every other centre. At present, the network contains
different direct links. There are no loops or repeated links.
- Find the number of links needed for the complete network. [3 marks]
- Find how many additional links must be installed. [2 marks]
- One centre currently has degree
. Explain how many new links involving that centre it requires. [2 marks]
Show worked solution · Application 5
(a) A complete graph on seven vertices has
links.
(b) The network needs
additional links.
(c) Every vertex of
has degree
. A centre of degree
therefore needs
additional link incident to it. The seven links in part (b) are for the whole network, not seven links for each centre.
Reflection · Connections that encourage
Graph theory shows how separate points become part of a connected network. Psalm 34:3 invites us to praise the Lord together. Who could you encourage or pray with this week so that neither of you walks alone?