MINIMAL CONNECTOR PROBLEMS - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

MINIMAL CONNECTOR PROBLEMS

Description:

MINIMAL CONNECTOR PROBLEMS. Problem: A cable TV company is installing a system ... BD. Arcs from A, B & D have lengths. 13, 15, 12 and 10 ... AB, BD, DF, FE, BC ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 8
Provided by: tea852
Category:

less

Transcript and Presenter's Notes

Title: MINIMAL CONNECTOR PROBLEMS


1
MINIMAL CONNECTOR PROBLEMS
Problem A cable TV company is installing a
system of cables to connect all the towns in a
region. The numbers in the network show
distances in miles.
2
(No Transcript)
3
KRUSKALS ALGORITHM
Step 1 Rank the arcs in ascending order of weight
Step 2 Select the arc of least weight and use
this to start the tree
Step 3 Choose the next smallest arc and add this
to the tree UNLESS IT COMPLETES A CYCLE in which
case reject it and proceed to the next smallest
arc
Step 4 Repeat Step 3 until all vertices
are included in the tree
4
Smallest arc
Next smallest arc
FE (8)
DB (12)
BC (13)
AB (19)
FD (10)
Not DE because it produces a cycle
Not EC or DC as they produce cycles
A
List the arcs as you choose them
19
D
12
FE
FD
DB
BC
AB
B
10
13
You now have a minimal spanning tree
C
F
E
8
Total Length 62
5
PRIMS ALGORITHM
Step 1 Choose a starting vertex
Step 2 Connect it to the nearest vertex using
the least arc
Step 3 Connect the nearest vertex not in the
tree, to the tree, using the least arc
Step 4 Repeat step 3 until all of the vertices
are connected
6
Arcs from A, B, D, E F have lengths 13, 15 and
14
Arcs from A, B, D F have lengths 13, 15 and 8
Arcs from A and B have lengths 20, 12 and 13
Arcs from A, B D have lengths 13, 15, 12 and 10
Start with vertex A
Nearest is B so add AB
So choose FE (8)
So choose BD (12)
So choose DF (10)
So choose BC (13)
A
19
List the arcs as you choose them
D
B
12
AB
BD
DF
FE
BC
10
13
F
C
E
8
You now have a minimal spanning tree
Total Length 62
7
Both algorithms have led to the same minimal
spanning tree
But the order of choosing the arcs is different
Kruskal gives
FE, FD, DB, BC, AB
Prim gives
AB, BD, DF, FE, BC
That is why it is important to write down the
arcs as you select them so that the examiner can
tell whether or not you have used the correct
algorithm
Write a Comment
User Comments (0)
About PowerShow.com