CSES problem: police are at node , a criminal is at node . You can block roads to prevent the criminal from escaping. Each road can be blocked. Find the minimum number of roads to block. This is a min-cut problem.
Each road is an edge with capacity . The minimum number of edges to block equals the min-cut capacity. Run max flow, then extract the min-cut edges. Those are the roads to block. The connection to flow is direct.