Is there an efficient way to remove all edges that are not part of a longest paths between two nodes in a DAG? For example, for the graph (DAG): (1->2, 2->3, 2->4,