46,385 views
37 votes
37 votes
A company delivers packages by truck and would like to minimize the length of the route that each driver must travel in order to reach n delivery locations. The company is considering two different algorithms for determining delivery routes.

Algorithm I Generate all possible routes, compute their lengths, and then select the shortest possible route. This algorithm does not run in reasonable time.
Algorithm II Starting from an arbitrary delivery location, find the nearest visited delivery location. Continue creating the route by selecting the nearest unvisited location until all locations have been visited. This algorithm does not guarantee the shortest possible route and runs in time proportional to n2.
Which of the following best categorizes algorithm II?
A. Algorithm II attempts to use an algorithmic approach to solve an otherwise undecidable problem.
B. Algorithm II uses a heuristic approach to provide an approximate solution in reasonable time.
C. Algorithm II provides no improvement over Algorithm I because neither algorithm runs in reasonable time.
D. Algorithm II requires a much faster computer in order to provide an improvement over Algorithm I.

User Vodun
by
3.8k points

1 Answer

12 votes
12 votes

Answer:

Algorithm II uses a heuristic approach to provide an approximate solution in reasonable time.

Step-by-step explanation:

User Levent Divilioglu
by
3.2k points