Description
In this homework, we will focus our attention to finding shortest-paths and maximum flow on graphs, and NP Completeness.
Problem 1: Shortest Path 40 points
1. If p = fv1; ; vng is the shortest path between v1 and vn, then prove that any subpath
pij = fvi; ; vj g in p is the shortest path between vi and vj . (20 points)
-
Write the pseudocode to find a negative weight cycle in a directed graph G = (V; E) with the weight function w : E ! R. (20 points)
Bonus Problem (20 points):
-
Demonstate Dijkstra’s algorithm on the following graph.
-
Implement Dijkstra’s algorithm in Python, and validate your code on the following graph.
-
Prove that there are uncountable number of unsolvable binary decision problems. Further-more, give an example of an unsolvable binary decision problem. (10 points)
-
Define NP, NP-Hard and NP-Complete classes, and give one problem in each of these com-plexity classes. (10 points)
-
Assuming that Hamiltonian circuit problem is NP-Complete, prove that traveling salesman problem is NP-Complete via reduction. (20 points)