Suppose we have two weighted graphs G1 = (V, E, w) and G2 = (V, E, w0 ) where w 0 (e) = w(e)+1 and w, w0 are the edge weights in the two graphs. The graphs are identical, except that all the edges weights in G2 are one larger than the corresponding edge in G1. Suppose that in G1, we have computed the shortest weighted path from some fixed node s ∈ V to some other node t ∈ V . Call this path p. Is it always the case that p is the shortest s → t path in G2? If it is, then prove it, otherwise give a counterexample
Yes, it is always the case that, p is the shortest s -> t
path in G2.
We will prove this by contradiction.
First, we are given that in graph G1 = (V,E,w)
there is a path p from vertex s to vertex t such that s->t is the shortest path.
Also, it's known that for all edges e' in G2, and corresponding e in G1, the following relation holds true:
w(e') = w(e) + 1
Now, let suppose that path p is NOT the shortest path from s->t in G2, or in other words there exists some other path p' which is shorter than p in G2
Now,
sum of weights in path p in G1 can be represented as:

over the path p.
Also, the exact corresponding path sum of the weights in G2 is ( which is not the minimum )

Also, we know that

So,

Here, n(P) is the cardinality of set P ( the path p )
This is a contradiction as S is the minimum path sum in G1 whereas
S' is not, and they are related by a constant factor of path
length.
This contradiction arose due to the assumption that p is not the
minimum sum path in G2.
Hence p is the minimum sum path in G2 as well.
Suppose we have two weighted graphs G1 = (V, E, w) and G2 = (V, E,...
Let G = (V, E, W) be a connected weighted graph where each edge e has an associated non-negative weight w(e). We call a subset of edges F subset of E unseparating if the graph G' = (V, E\F) is connected. This means that if you remove all of the edges F from the original edge set, this new graph is still connected. For a set of edges E' subset of E the weight of the set is just the...
a. (15 marks) i (7 marks) Consider the weighted directed graph below. Carry out the steps of Dijkstra's shortest path algorithm as covered in lectures, starting at vertex S. Consequently give the shortest path from S to vertex T and its length 6 A 2 3 4 S T F ii (2 marks) For a graph G = (V, E), what is the worst-case time complexity of the version of Dijkstra's shortest path algorithm examined in lectures? (Your answer should...
4. Suppose that G = (V, E) and H = (W, F) are two graphs. Define a new graph KG,h by: The vertex set of KG,H is VUW. xy is an edge of KG,H if and only if either: x,y € E, or x, y € F, or x € V and ye W. Prove that x(KG,H) = x(G) + x(H).
Problem #1 Let a "path" on a weighted graph G = (V,E,W) be defined as a sequence of distinct vertices V-(vi,v2, ,%)-V connected by a sequence of edges {(vi, t), (Ug, ta), , (4-1,Un)) : We say that (V, E) is a path from tovn. Sketch a graph with 10 vertices and a path consisting of 5 vertices and four edges. Formulate a binary integer program that could be used to find the path of least total weight from one...
Input a simple undirected weighted graph G with non-negative edge weights (represented by w), and a source node v of G. Output: TDB. D: a vector indexed by the vertices of G. Q: priority queue containing the vertices of G using D[] as key D[v]=0; for (all vertex ut-v) [D[u]-infinity:) while not Q. empty() 11 Q is not empty fu - Q.removein(); // retrieve a vertex of Q with min D value for (all vertex : adjacent to u such...
Shortest Path
Suppose we are given an instance of the Shortest s-t Path Problem on a directed graph G. We assume that all edge costs are positive and distinct integers. Let P be a minimum-cost s-t path for this instance. Now suppose we replace each edge cost ce by its square, c 2 e, thereby creating a new instance of the problem with the same graph but different costs. For each of the following statements, decide whether it is true...
Suppose we have a graph G = (V, E) with weights on the edges of E, and we are interested in computing a Minimum Spanning Tree (MST) of G. Suppose we modify the DFS algorithm so that when at a vertex v, we next visit the unvisited neighbor u such that the weight of (u, v) is minimized. Does this produce a MST of G? prove that it does or provide a counter example.
Please answer this question prefer typing if it possible. " Let G = (V,E) be a directed weighted graph such that all the weights are positive. Let v and w be two vertices in G and k ≤ |V | be an integer. Design an algorithm to find the shortest path from v to w that contains exactly k edges. Note that the path need not be simple."
Let G = (V, E, w) be a connected weighted undirected graph. Given a vertex s ∈ V and a shortest path tree Ts with respect to the source s, design a linear time algorithm for checking whether the shortest path tree Ts is correct or not.(C pseudo)
(T/F) For a given weighted connected graph G=(V, E), we would like to find the longest simple path between any two vertices. We can solve this problem by negating the edge weights and running Johnson’s algorithm.