topic badge

7.015 Prim's algorithm

Worksheet
Prim's algorithm from a network
1

The following weighted network shows possible connections (and associated costs, in millions of dollars) for connecting rural towns to a common cabled internet service:

To minimise the cost of connecting each town to the network, the minimal spanning tree must be found.

a

How many edges will be a part of a spanning tree for this network?

b

Construct the minimum spanning tree.

c

What is the minimum cost of connecting all of the towns together?

2

The direct flight routes between 5 major cities of the same country are shown in the given graph. Each edge is marked with the distance (in \text{km}) travelled on each route:

To optimise their investment, the operating airline wants to find the minimum spanning tree for the graph.

a

How many edges will be a part of the spanning tree for this network?

b

Construct the minimum spanning tree.

c

Using these flight routes, what is the minimum distance connecting these major cities?

3

At the university, there is a new plan to connect all the campus buildings using underground fiber optic cables. The given network was suggested by the engineer:

The project accountant wanted to minimise the cost of the project. He realised that there are unnecessary cables that could be removed to minimise cable length.

Construct the network that represents the least cost.

4

In a certain area, new underground cables need to be laid to connect electric substations. The graph displays the current connection layout:

Since the project has a limited budget, the engineers have to design a connection layout that uses the minimum cable length.

Construct the graph that represents the connection layout with the least cost.

5

An airplane company wants to redesign their flight routes to make it cost efficient. The network displays the current flight routes:

In order for the flight routes to be efficient, the sum of the route distances needs to be minimised.

Construct the graph that will achieve this.

6

The bus company decided to redesign its travel routes after new roads were built. The network shows the existing routes connecting the towns and the respective times taken to cover the route:

The bus company wants to be time efficient with its routes. Construct the graph that will achieve this.

7

A large amusement park is trying to implement a new security system such that all security posts are connected by electric cabling. The network shows all possible connections and their respective lengths:

Since the project has a limited budget, the engineers have to minimise the length of cabling used. Construct the graph that represents the least costly connections.

8

Urban planners are trying to connect houses in a certain area.

The network represents all possible routes between houses in the area, and the distances between them.

The urban planners wish to create roads that are most distance efficient, and allow them to connect each house.

Construct the graph that is the most distance efficient.

9

The water authority wants to lay water pipes along the roads in order to put a fire hydrant at every node on the network shown on the network. The numbers represent the length of the pipe that connects any two nodes.

To minimise the cost of the operation, the water authority wants to minimise the length of the pipes. Construct the graph that will achieves this.

10

The rangers of a national park want to clear walking tracks to six landmarks in the area. The potential tracks between landmarks are shown in the graph below, along with the number of days required to clear each track for use.

To make a network of tracks in the shortest time, the rangers want to find a minimal spanning tree for the graph.

a

How many edges will be a part of the spanning tree for this network?

b

Construct the minimal spanning tree.

11

The cost of train tickets between different towns varies. The network represents the possible routes between towns and the costs of the train tickets.

a

How many edges will be a part of the spanning tree for this network?

b

Construct the minimum spanning tree for the given network.

Undirected graphs
12

Create an undirected graph using the weights from the following distance tables:

a
ABCD
A-273223
B27-3323
C3233--
D2323--
b
ABCDE
A--6-5
B--957
C69-3-
D-53--
E57---
c
ABCDEF
A-6---1
B6-10--3
C-10-697
D--6-5-
E--95--
F137---
13

For a part of the National Broadband Network, optical fibre communications cables must be run between several towns. The distances (in \text{km}) between the towns are listed in the table below. A "-" indicates that there is no direct route between those towns.

WickepinLake GraceKulinPingaringHydenDumbleyung
Wickepin-13477--79
Lake Grace134-6367-80
Kulin7763-4880103
Pingaring-6748-40146
Hyden--8040--
Dumbleyung7980103146--
a

By first finding the minimal spanning tree of this network, find the minimum length of cabling required.

b

If a change in property access regulations makes it possible to shorten the cabling required between Lake Grace and Pingaring to 50\text{ km}, by how much will the length of cabling decrease?

14

The electrical wiring in an industrial plant needs to connect several areas of the plant. Distances (in metres) between the areas are shown below:

GeneratorCrushingLeachingFilterKilnGrading
Generator-732-4
Crushing7-76--
Leaching37-666
Filter266-94
Kiln--69-5
Grading4-645-
a

By first finding the minimal spanning tree of this network, determine the minimum length of wiring required.

b

If an access way is built, such that it is no longer possible to use the direct connection between the Generator and Filter, calculate the new minimum length of wiring.

15

A 3D printer has a movable print head that produces hot, melted plastic to build up layers of the 3D object. The layers are very thin, and it takes a long time for a printed model to be completed, so the designers of the 3D printers try to make the print head move the shortest possible time to move between separate parts.

A particular design has 5 legs, with the time (in seconds) to traverse directly between pairs of legs given by the following table:

Leg 1Leg 2Leg 3Leg 4Leg 5
Leg 1-1.01.40.51.9
Leg 21.0-0.70.61.2
Leg 31.40.7--1.0
Leg 40.50.6--1.5
Leg 51.91.21.01.5-
a
Determine the minimum time to traverse all 5 legs.
b
There was no time specified to traverse between Leg 3 and Leg 4 because this path was obstructed by another part of the design. How much faster could all 5 legs be traversed if it was possible to traverse directly between Leg 3 and Leg 4 in just 0.2 seconds?
Prim's algorithm from a table
16

The length of edges in a network is represented by the distance table shown below. We want to construct a minimal spanning tree starting from vertex A.

a

Determine the number of edges in the minimal spanning tree for this network.

b

Identify the shortest edge from vertex A to another vertex.

c

Identify the shortest edge that is connected from either vertex of the edge from part (a) to an unconnected vertex.

d

Identify the shortest edge that is connected from any vertex of the edges from parts (a) and (b) to the final unconnected vertex.

e

Calculate the total length of the minimal spanning tree for the network.

ABCD
A-162
B1-43
C64-5
D235-
17

Find the total length of the minimum spanning tree for the network represented by each of the distance table shown below:

a
ABCDE
A--9.44.45.2
B---0.63.0
C9.4--7.45.6
D4.40.67.4-7.6
E5.23.05.67.6-
b
ABCDEF
A-516151-93
B51-5499666
C6154--651
D5199--365
E-6653--
F9366165--
c
ABCDE
A-5-36
B5-8--
C-8--4
D3---1
E6-41-
d
ABCDE
A-6--12
B6--89
C---147
D-814--
E1297--
e
ABCDEF
A--9--6
B----115
C9--3-7
D--3-5-
E-11-5-8
F657-8-
f
ABCDE
A-2312310959
B-8918569
C-17671
D-119
E-
g
ABCDEFG
A-616499657972
B61-6279699453
C6462-90919955
D997990-677881
E65699167-7580
F7994997875-87
G725355818087-
h
ABCDEFG
A-70109010100100
B--10204010
C--80108040
D--6090
E---50
F--80
G-
Sign up to access Worksheet
Get full access to our content with a Mathspace account

Outcomes

ACMGM079

identify practical situations that can be represented by a network, and construct such networks; for example, trails connecting camp sites in a National Park, a social network, a transport network with one-way streets, a food web, the results of a round-robin sporting competition

ACMGM101

explain the meaning of the terms tree and spanning tree identify practical examples

ACMGM102

identify a minimum spanning tree in a weighted connected graph either by inspection or by using Prim’s algorithm

ACMGM103

use minimal spanning trees to solve minimal connector problems; for example, minimising the length of cable needed to provide power from a single power station to substations in several towns

What is Mathspace

About Mathspace