[graph-tool] Main path algorithm