0% found this document useful (0 votes)
29 views3 pages

Module 6 Exercise 3.1

Uploaded by

Andrea Rhei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views3 pages

Module 6 Exercise 3.1

Uploaded by

Andrea Rhei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

LAMBOJO, ANDREA RHEI M. SEAT NO.

: 307
GED102-B11
MODULE 6 EXERCISE 3.1
For each item, draw the corresponding graph and draw conclusions as required.
1. For each given graph, find two Hamiltonian cycles with different sums of
weights.

Solution
C-E-D-B-A-F-C = 22 + 12 + 20 + 18 + 14 + 9 = 95
C-A-F-B-D-E-C = 7 + 14 + 15 + 20 + 12 + 22 = 90

Solution
F-E-G-D-C-B-A-F = 28 + 27 + 38 + 45 + 36 + 54 + 36 = 264
F-D-G-E-A-B-C-F = 32 + 38 + 27 + 42 + 54 + 36 + 41 = 270
2. Use the Greedy and Edge-Picking algorithms to find the Hamiltonian cycle
with the least total weight in the complete graph shown below.

Solution
Using the Greedy Algorithm:
B-E-D-F-C-A-B
Sum of weights: 21 + 26 + 45 + 60 + 72 + 33 = 257
Using the Edge-Picking Algorithm:
Order of Edge Edge Weight
1st B-E 21
2nd E-D 26
3rd D-F 45
4th F-C 60
5th C-A 72
6th A-B 33
Total weight 257

3. A food delivery personnel is tasked to deliver orders to four nearby


buildings: A, B, C, and D. The table below shows the time (in minutes) for
the delivery personnel to travel from one building to another. Help the
personnel to plan out an efficient route to deliver the order at the least
possible time. Use both the Greedy and Edge-Picking algorithms.
Store A B C D
Store --- 25 7 25 17
A 25 --- 20 8 15
B 7 20 --- 23 14
C 25 8 23 --- 24
D 17 15 14 24 ---

Solution
Using the Greedy Algorithm:
Store-B-D-A-C-Store
Sum of Weights: 7 + 14 + 15 + 8 + 25 = 69
Using the Edge-Picking Algorithm:
Order of Edge Edge Weight
1st Store-B 7
2nd B-D 14
3rd D-A 15
4th A-C 8
5th C-Store 25
Total time 69

You might also like