Question: = 3 5 A -2 -4 Question 5) (20 points] Consider the following digraph G =(V. E) with a weight function w: E+R on the
![= 3 5 A -2 -4 Question 5) (20 points] Consider](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3908d1ee8d_28466f3908c89960.jpg)
= 3 5 A -2 -4 Question 5) (20 points] Consider the following digraph G =(V. E) with a weight function w: E+R on the edges: the nodes are V = {1,2,3,4}, the edges are E = {(1,2), (2,3), (3,4),(4,1),(4,2)), and the weights of the edges are: w(1.2) = 3 w(2, 3) = 8 w(3, 4) = -4 w(4,1) = -2 w(4.2) = 5 For all pairs shortest path problem, if we would like to apply Dijkstra's algorithm, we have to reweight the edges, as suggested by Johnson's algorithm. As you know, Johnson's algorithm is based on first finding some suitable weights for the vertices of the graph. Let us use 11, 12, 13, 14 as the weight of the nodes 1, 2, 3, 4 respectively. After we find a suitable weight for each node, we will define a new weight function for the edges, such that all edges will have non-negative weights. There are two possible ways to define this new weight function: w (i, j) = w[i,j) - I;+; Wij) E, or u2(1.j) = w[i,j) +2; -2; Mi,j) E. Fill in the blanks (...) below, to give the constraints on the differences on the vertex weights for both of these cases: when is used 2. edges for (1,2) E E for (2,3) E E for (3, 4) E E for (4.1) E E for (4,2) E E C. when , is used 2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
