Graph Theory37 sections · 1633 units
Open in Course

Download Speed - Edge Cases

(No path, single edge)

Edge cases to handle:

1.1. Source equals sink: maximum flow is infinity (or undefined). Problem statements usually avoid this.

2.2. No path from source to sink: maximum flow is 00.

3.3. Single edge: maximum flow is the edge capacity.

4.4. Multiple edges between same nodes: sum their capacities or treat separately.

Always check if n=1n = 1 (source equals sink). If the graph is disconnected, BFS returns immediately with flow 00.