Modified graph problem set
naive subsequence algorithm