# given a weighted, directed graph. Give an O(VE)-time algorithm to find, for each vertex v∈V, the value δ∗(v)=Min u∈V{δ(u,v)}?

This is the 24.1-5 question in CLRS. I'm having a hard time understanding the questions and also how to solve it. δ(u,v) is defined as the shortest path weight from u to v if there exist a path from u to v.

Let G=(V,E) be a weighted, directed graph with weight function w:E→R. Give an O(VE)-time algorithm to find, for each vertex v∈V, the value δ∗(v)=Min u∈V{δ(u,v)}.

What I'm confusing about this question is what is δ∗(v) suppose to be. I also found the answer online but still don't really understand why it is like that. Since this is an exercise in the Bellman-Ford algorithm of CLRS. the answer said to change the RELAX operation of the algorithm. The RELAX operation in Bellman-Ford is what help achieve the shortest path weight after you run this V time for each edge in E.

the ORIGINAL-RELAX operation supposes to be like this:

RELAX(u, v, w)
if v.d > u.d + w(u,v)
v.d = u.d + w(u,v)
v.pi = u.pi


With v.d and u.d being the upper bound for the shortest path from source to u and v. v.pi is supposed to be its predecessor for the current upper bound.

The answer said to change the RELAX operation to this.

MOD-RELAX(u, v, w)
if v.d > min(w(u, v), w(u, v) + u.d)
v.d = min(w(u, v), w(u, v) + u.d)
v.pi = u.pi


I need some explaination to what the problem is asking for and why this answered it.

• If you don't understand the question, us providing you with an answer to it won't really help you. I suggest you step back and try to understand the question, first. In particular, you can ask us about the parts you don't understand! – David Richerby Jan 16 '17 at 17:08
• I suggest you edit the question to include the full statement of the problem, and tell us what parts you don't understand, what is confusing you, and what parts you do understand. As it stands, it's not clear how to help you understand the question, short of repeating it (and I worry you might say you didn't understand that either). The more you give us to work with, the more likely that we can give you an answer you find helpful. Also, please don't put the entire text of the exercise in the title; the title is intended to be a short summary. See meta.cs.stackexchange.com/a/815. – D.W. Jan 16 '17 at 17:19
• Sorry for the problem. I hope this edit will help you better to understand what I'm asking for. – Tienanh Nguyen Jan 16 '17 at 17:48
• Fora vertex $v$, consider all the possible values of $\delta(u,v)$, where $u$ is any vertex in the graph. $\delta^*(v)$ is defined to be the smallest of those values. – David Richerby Jan 16 '17 at 18:32
• Working through some examples may help -- pick a small graph, and compute the value of $\delta^*(v)$ for each $v$ by plugging into the definition. – D.W. Jan 16 '17 at 19:08