I have got a problem with an excercise about graphs:
Your friend has been hired by a brewery to work out the most efficient delivery route for the beer-delivery truck drivers. A typical delivery has about 50 stops and the company wants to save money by driving the shortest possible distance. Your friend ignores your advice and decides on an algorithm, as follows:
- Start at the depot,
- Go to the nearest location that has not yet been
- Repeat until you have delivered all the beer
- Return to depot
And the quesiton is: What is the Big-O complexity of this approach? Why?
I do not think this way of solving problem is any algorithm like Prim's algorithm, and I have no clue what can be a complexity. Could anyone explain me?