DP Longest Increasing Sequence problem
Graph DFS traversal (refactored)