Remove empty edges.

This commit is contained in:
chriseth 2022-10-28 18:01:57 +02:00
parent 736e433d00
commit 523147f5df

View file

@ -46,6 +46,11 @@ pub fn compute_flow(
} }
} }
used_edges.retain(|_, out| {
out.retain(|_, c| *c != U256::from(0));
!out.is_empty()
});
println!("Max flow: {flow}"); println!("Max flow: {flow}");
if flow > requested_flow { if flow > requested_flow {