Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Graph and Johnson's Algorithm Problem Consider the following directed graph G = ( V , E ) , where: V = { 1 , 2

Graph and Johnson's Algorithm Problem
Consider the following directed graph G=(V,E), where:
V={1,2,3,4,5}
E={(1,2),(2,5),(3,2),(3,4),(4,1),(4,5),(5,1),(5,3)}
Suppose that we are given the following weight function w:ER for the edges:
w(1,2)=-5
w(2,5)=8
w(3,2)=1
w(3,4)=-4
w(4,1)=7
w(4,5)=6
w(5,1)=0
w(5,3)=2
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.
Johnson's algorithm is based on first finding some suitable weights for the vertices of the
graph. Let us use x1,x2,x3,x4,x5 as the weight of the nodes 1,2,3,4,5 respectively. After
we find a suitable weight for each node, we will define a new weight function tilde(w):ER
for the edges, such that all edges will have non-negative weights when we use
tilde(w)(i,j)=w(i,j)-xi+xj,AA(i,j)inE
For each edge (i,j) in E, write down the constraint on the difference of xi and xj based
on the way tilde(w) is defined in Equation (1) above.
(b) Draw the graph G that would solve this system of difference constraints if applied the Bellman- Ford algorithm.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions