Guided Lesson Notes
Understanding Floyd-Warshall DP View
Floyd-Warshall DP View focuses on overlapping subproblems, reusable answers, and turning recursion into a table or memo. Students revisit all-pairs shortest paths as a dynamic programming pattern based on which intermediate vertices are allowed.
Model: define one state as a smaller question whose answer can help build larger answers.
Invariant: when a state is used, every smaller state it depends on must already be correct or memoized.
Implementation: state definitions, recurrence formulas, base cases, table order, memoization maps, and reconstruction when needed.
Use Floyd-Warshall DP View when the problem asks for best, count, longest, shortest, ways, or choices over prefixes, positions, capacities, or subsets.
