Problem 1 A jogger wants to follow the least undesirable cycle of roads starting at her home. Each road has an "index of undesirability" and can be traversed in either direction; the jogger must follow a nonempty cycle of roads and no road can be used twice. Formulated as a graph problem, the jogger has an undirected weighted graph G = (V, E), and must determine the nonempty cycle of minimum weight starting (and ending) at vertex s. 1. Show how to use multiple applications of Dijkstra's shortest path algorithm to obtain the optimum jogger's route in time O(|V | 2 log |V | + |E||V |). Be precise: each time you want to use Dijkstra's explain which graph is the input of the algorithm, 2. Let T be the shortest path tree constructed by Dijkstra's shortest path algorithm for starting vertex s in G. Prove that some optimum jogger's route has all but one of its edges in T , and furthermore, that s is the lowest common ancestor in T of the end points of that edge. 3. Use the result in part (b) to modify Dijkstra's shortest path algorithm so it finds an optimum jogger's route in time O(|V | log |V | + |E|). Write pseudocode, discuss the running time and correctness. 4. Prove that the masochistic jogger's problem, to find a route of maximum undesirability, is NP-hard. Here you can use any of the know NP-hard problems from the textbooks
Problem 1 A jogger wants to follow the least undesirable cycle of roads starting at her home. Each road has an "index of undesirability" and can be traversed in either direction; the jogger must follow a nonempty cycle of roads and no road can be used twice. Formulated as a graph problem, the jogger has an undirected weighted graph G = (V, E), and must determine the nonempty cycle of minimum weight starting (and ending) at vertex s.
1. Show how to use multiple applications of Dijkstra's shortest path
2. Let T be the shortest path tree constructed by Dijkstra's shortest path algorithm for starting vertex s in G. Prove that some optimum jogger's route has all but one of its edges in T , and furthermore, that s is the lowest common ancestor in T of the end points of that edge.
3. Use the result in part (b) to modify Dijkstra's shortest path algorithm so it finds an optimum jogger's route in time O(|V | log |V | + |E|). Write pseudocode, discuss the running time and correctness.
4. Prove that the masochistic jogger's problem, to find a route of maximum undesirability, is NP-hard. Here you can use any of the know NP-hard problems from the textbooks
Trending now
This is a popular solution!
Step by step
Solved in 2 steps