Graph layering and DP

331 views Asked by At

Graph layering is a common technique to deal with the shortest path with some restrictions. Here is a description about this technique: https://youtu.be/OQ5jsbhAv_M?t=47m7s. So, just wondering, whether this technique will be the same as doing DP, but just with a different memorization structure?

1

There are 1 answers

0
Matt Timmermans On BEST ANSWER

The shortest path algorithms are dynamic programming algorithms already. They calculate the shortest path to a node based on the shortest paths to its predecessors (optimal substructure), and memoize the results for each node, because each one can be a predecessor of several different successor nodes (overlapping subproblems).

The "layering technique" lets you extend the dynamic programming solution to handle restrictions and other kinds of complications.