You are on page 1of 2

WEIGHTED GRAPHS

Direction: Solve using the greedy algorithm.

Use the Greedy Algorithm and the weighted graph below to generate a Hamiltonian circuit
starting from each vertex. Then compare the different circuits to find the one of smallest
total weights. Start at vertex B.

24 5 17
A 11 C
15
21 7 8
20
8
25
21
F 12 D
16 3

E
Solution:

Hamiltonian circuit Weight of the circuit


B B-D-E-F-C-A-B 5+3+16+7+11+24=66
C C-F-A-D-E-B-C 7+8+20+3+15+17=70
D D-E-B-C-F-A-D 3+15+17+7+8+20=70
E E-D-B-C-F-A-E 3+5+17+7+8+21=61
F F-C-D-E-B-A-F 7+8+3+15+24+8=65
A A-F-C-D-E-B-A 8+7+8+3+15+24=65
The Hamiltonian circuit is E-D-B-C-F-A-E
The weight of a circuit is 3+5+17+7+8+21=61
1. Use the edge –picking algorithm to find a Hamiltonian circuit in the graph found in
number 1.How can we compare.

This study source was downloaded by 100000815669194 from CourseHero.com on 09-17-2022 03:14:12 GMT -05:00

https://www.coursehero.com/file/96958696/WEIGHTED-GRAPHSdocx/
B

17
5
C
A

8 7

D
F 21
3

Edge –picking algorithm have the same result found in number 1


E-D-B-C-F-A-E
3+5+17+7+8+21=61

This study source was downloaded by 100000815669194 from CourseHero.com on 09-17-2022 03:14:12 GMT -05:00

https://www.coursehero.com/file/96958696/WEIGHTED-GRAPHSdocx/
Powered by TCPDF (www.tcpdf.org)

You might also like