logo

Crowdly

Browser

Додати до Chrome

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

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

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?

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.spit.ac.in?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome