add find longest path for a weighted DAG