In the proof of the correctness of Dijkstra algorithm, there is a lemma stating as follow:
Let u be v’s predecessor on a shortest path P:s->…->u->v from s to v. Then, If d(u) = δ(s,u) and edge (u, v) is relaxed, we have d(v) = δ(s,v), where the funciton δ(x, y) denotes the minimum path weight from x to y.
I wonder why we need the condition d(u) = δ(s,u) in this lemma. If Path P: s->…->u->v is a shortest path from s to v, then by the property of optimal substructure, the subpath s->…->u of P must also be a shortest path from s to u. Therefore, d(u) must equal to δ(s,u).
Does there exist the case that d(u) ≠ δ(s,u) but P: s->…->u->v is a shortest from s to v? If it does, can someone offer an example here.
Any help will be appreciated
PS: if you are interested in the entire proof. Check here, the proof starts at 45:30
This question already has an answer here:
- How do I find the right size of filters for a lens? 6 answers
I know it sounds like a vacuous question, however I have not been able to find info on this topic. Sizing of filter and lenses. I bought some filters for my camera and they didn’t fit. Camera sets 55mm so I bought 55mm. Wrong!. Any help out there?
Found this code while looking for comparisons and differences between imperative programming and functional programming languages in programming paradigms.
It was written that this below code is the recursion for functional programming.
(def (dup a) (con ((null ? a) (1) (else (cons (ara) dup(csd r a))))
(def (dup a) (con ((null? a) (1) (else (cons (ara) dup(csd r a)))
Is this code correct? If its correct what does it mean?
Okay, do I have this right? Basically to comply with COPPA, I just have to disallow anyone under 13 from registering on my forum? Is that accurate?
I am sorry in advance if I am wrong to post this thread here.
I am new here, in this community. I was looking for an appropriate place to post the introduction about myself. But, I don't know is it the right place or not.
Anyway, Hello everyone. I'm Monim. 25 years of age and a bit shy and nervous. So, that's all for today. Hoping for some welcoming replies.