logo

Crowdly

Browser

Add to Chrome

You are given a directed graph G=(V,E) with edge weights that may be negative b...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

You are given a directed graph

G=(V,E) with edge weights that may be negative but

no negative-weight cycles

.

An algorithm is applied to compute the shortest paths between

all pairs of

vertices

, and it proceeds as follows:

  1. A new

    vertex s is added to the graph, connected to every vertex v∈V

    with an edge of weight 0.

  2. A

    shortest-path algorithm is run from sss to compute a potential function

    h(v) for each v∈V

  3. Each edge weight w(u,v)w(u,

    v)w(u,v) is reweighted as:

w′(u,v)=w(u,v)+h(u)−h(v)w'(u, v) = w(u, v) + h(u) -

h(v)w′(u,v)=w(u,v)+h(u)−h(v)

  1. Dijkstra’s algorithm is run from

    each vertex in the reweighted graph to compute shortest paths.

What is the main purpose of reweighting the edges

using the

function h?

More questions like this

Want instant access to all verified answers on moodle.spit.ac.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome