1 / 8

# 6.8 The Cheapest-Link Algorithm

6.8 The Cheapest-Link Algorithm. The Cheapest-Link Algorithm. Pick the edge with the smallest weight and mark it Pick the next edge with the smallest weight available and mark it Continue doing that following these rules Do not pick an edge that will close a circuit

Télécharger la présentation

## 6.8 The Cheapest-Link Algorithm

An Image/Link below is provided (as is) to download presentation Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

### Presentation Transcript

1. 6.8 The Cheapest-Link Algorithm

2. The Cheapest-Link Algorithm • Pick the edge with the smallest weight and mark it • Pick the next edge with the smallest weight available and mark it • Continue doing that following these rules • Do not pick an edge that will close a circuit • Do not pick an edge that will create 3 edges coming out from a single vertex • Connect the last two vertices to close the circuit

3. Apply the Cheapest-Link Algorithm to find the Hamilton circuit. Write the circuit starting and ending at A • Pick BD = 10 • Pick CB = 15 • Can not pick AB, so pick AD = 30 • Can not pick CD, so pick AC = 70 to close the circuit • Therefore the best route is C, A, D, B, C or A, D, B, C, A = 125

4. Apply the Cheapest-Link Algorithm to find the Hamilton circuit. Write the circuit starting and ending at A • Pick AC = 119 • Pick EC = 120 • Can not pick CB nor AE so the next edge is BD = 150 • Pick AD = 152 • Can not pick CD, can not pick AB, can not pick ED so the last edge is EB =200 which will close the circuit • Therefore: the route is A, C, E, B, D, A = \$741

5. Apply the Cheapest-Link Algorithm to find the Hamilton circuit. Write the circuit starting and ending at B The circuit is: B, A, D, C, B with a total of 17

6. Apply the Cheapest-Link Algorithm to find the Hamilton circuit. Write the circuit starting and ending at A A B F C E D The Hamilton circuit: A, D, B, C, F, E, A with a total weight of 35

7. Apply the Cheapest-Link Algorithm to find the shortest way to go to the bank, dry cleaner, post office, and wegmans starting and ending at home. The mileage chart is shown below. D W Shortest way using the C.Link Home, Post Office, Dry Cleaner, Bank, Wegmans, then Home Total: 16 miles B P HOME

8. Apply the Cheapest-Link Algorithm to find the shortest way to go to the bank (B), candy store (C), and the airport (A) to pick up a friend starting and ending at home. Each block is exactly 1 mile. A B 6 12 10 5 9 7 H C Home, Bank, Airport, Candy Store, Home Total: 28 miles

More Related