Support finding longest common substrings.
Find longest path in arbitrary DAGs.