Remove empty edges.
This commit is contained in:
parent
736e433d00
commit
523147f5df
1 changed files with 5 additions and 0 deletions
|
@ -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}");
|
||||
|
||||
if flow > requested_flow {
|
||||
|
|
Loading…
Reference in a new issue