nontrivial Increasing Subsequences A1 A2 A3 A4 A5
(nontrivial) Increasing Subsequences A[1] A[2] A[3] A[4] A[5] 8 8 3 3 3 9 9 9 4 4 6
(nontrivial) Increasing Subsequences A[1] A[2] A[3] A[4] A[5] 8 3 3 3 9 4 4 4 6 6
Longest Increasing Subsequence A[1] A[2] A[3] A[4] A[5] 8 LIS 3 9 4 6 1 Base case
Longest Increasing Subsequence A[1] A[2] A[3] A[4] A[5] 8 LIS 3 9 4 6 2 1
Longest Increasing Subsequence A[1] A[2] A[3] A[4] A[5] 8 LIS 3 9 4 6 1 2 1 Base case
Longest Increasing Subsequence A[1] A[2] A[3] A[4] A[5] 8 LIS 3 9 4 6 3 1 2 1
Longest Increasing Subsequence A[1] A[2] A[3] A[4] A[5] LIS 8 3 9 4 6 2 3 1 2 1
LIS as Longest Path in a Graph 8 3 9 4 6
Longest Path in a Directed Acyclic Graph 8 • • 3 9 4 6 State: longest[u], max length of path ending at u Transition: longest[u] = maxv-->ulongest[v] + length(v --> u)
Longest Path in a Directed Acyclic Graph 8 Longest[u] 0 3 9 4 6
Longest Path in a Directed Acyclic Graph Longest[u] 8 3 0 0 9 4 6
Longest Path in a Directed Acyclic Graph Longest[u] 8 3 9 0 0 1 4 6
Longest Path in a Directed Acyclic Graph Longest[u] 8 3 9 4 0 0 1 1 6
Longest Path in a Directed Acyclic Graph Longest[u] 8 3 9 4 6 0 0 1 1 2 Choose green edge because 1 > 0
Comment cards https: //goo. gl/RKd 8 vq
Test 1 Review session: 5 -7 pm Tuesday Sep 19 in ES&T Room L 1205. Review notes, instructions page posted on course website
- Slides: 16