Graph Theory37 sections · 1633 units
Open in Course

Problem - Distinct Routes

(CSES 1711)

You are given a directed graph with nn vertices and mm edges. Find the maximum number of edge-disjoint paths from vertex 11 to vertex nn. Output the number of paths and list each path. Paths are edge-disjoint if they do not share any edges (but can share vertices).

This is a max flow problem where each edge has capacity 11. The flow value equals the number of disjoint paths. Then you need to extract the actual paths from the flow.