fn mcf_augment(&self, t: usize, par: &[Option<usize>], flow: &mut [i64]) -> (i64, i64) {
        let (mut dc, mut df) = (0, INF);
        let mut u = t;
        while let Some(e) = par[u] {
            df = min(df, self.cap[e] - flow[e]);
            u = self.graph.endp[e ^ 1];
        }
        u = t;
        while let Some(e) = par[u] {
            flow[e] += df;
            flow[e ^ 1] -= df;
            dc += df * self.cost[e];
            u = self.graph.endp[e ^ 1];
        }
        (dc, df)
    }
// Pushes flow along an augmenting path of minimum cost.
Pushes flow along an augmenting path of minimum cost.
Pushes flow along an augmenting path of minimum cost .
fn mcf_augment(&self, t: usize, par: &[Option<usize>], flow: &mut [i64]) -> (i64, i64) {
        let (mut dc, mut df) = (0, INF);
        let mut u = t;
        while let Some(e) = par[u] {
            df = min(df, self.cap[e] - flow[e]);
            u = self.graph.endp[e ^ 1];
        }
        u = t;
        while let Some(e) = par[u] {
            flow[e] += df;
            flow[e ^ 1] -= df;
            dc += df * self.cost[e];
            u = self.graph.endp[e ^ 1];
        }
        (dc, df)
    }
fn mcf_augment ( & self , t : usize , par : & [ Option < usize > ] , flow : & mut [ i64 ] ) -> ( i64 , i64 ) { let ( mut dc , mut df ) = ( 0 , INF ) ; let mut u = t ; while let Some ( e ) = par [ u ] { df = min ( df , self . cap [ e ] - flow [ e ] ) ; u = self . graph . endp [ e ^ 1 ] ; } u = t ; while let Some ( e ) = par [ u ] { flow [ e ] += df ; flow [ e ^ 1 ] -= df ; dc += df * self . cost [ e ] ; u = self . graph . endp [ e ^ 1 ] ; } ( dc , df ) }
Pushes flow along an augmenting path of minimum cost.
Pushes flow along an augmenting path of minimum cost .
&self
t
usize
par
&[Option<usize>]
flow
&mut [i64]
&self
t
usize
par
&[Option<usize>]
flow
&mut [i64]