





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Graphs/Dynamic Programming
Lecture 14
Dijkstra’s Algorithm - negative weights?
Bellman-Ford Algorithm - Complexity
executed Q(V) times Q(E) Q(E)
Bellman-Ford Algorithm - Complexity
InitializeSingleSource TI (V,E) = Q(V) Relax TR(V,E) = Q(1)? SSSP-BellmanFord T(V,E) = TI (V,E) + V E TR(V,E) + E = == QQ(V) + V E(V E) Q(1) + E =
ó The algorithm works by splitting a problem into a sequence of optimization sub problems ó The sub problems are solved and then combined to obtain solution to the main problem ó The dynamic programming approach seems to be similar to divide-and-conquer approach ó However, unlike the divide-and-conquer method, the dynamic programming approach isapplicable when the sub-problems are not independent i.e. dynamic programming splits the problem into overlapping sub problems. ó Further, the optimal solutions to sub problems are stored into a table, which is used to buildthe final or global optimal solution.
ó fib(5) ó fib(4) + fib(3) ó fib(3) + fib(2) + fib(2) + fib(1) ó fib(2) + fib(1) + fib(1) + fib(0) + fib(1) + fib(0) + fib(1) ó fib(1) + fib(0) + fib(1) + fib(1) + fib(0) + fib(1) + fib(0) +fib(1)