fn dinic_search(&self, s: usize, flow: &[i64]) -> Vec<i64> {
        let mut dist = vec![INF; self.graph.num_v()];
        let mut q = ::std::collections::VecDeque::new();
        dist[s] = 0;
        q.push_back(s);
        while let Some(u) = q.pop_front() {
            for (e, v) in self.graph.adj_list(u) {
                if dist[v] == INF && flow[e] < self.cap[e] {
                    dist[v] = dist[u] + 1;
                    q.push_back(v);
                }
            }
        }
        dist
    }
// Compute BFS distances to restrict attention to shortest path edges.
Compute BFS distances to restrict attention to shortest path edges.
Compute BFS distances to restrict attention to shortest path edges .
fn dinic_search(&self, s: usize, flow: &[i64]) -> Vec<i64> {
        let mut dist = vec![INF; self.graph.num_v()];
        let mut q = ::std::collections::VecDeque::new();
        dist[s] = 0;
        q.push_back(s);
        while let Some(u) = q.pop_front() {
            for (e, v) in self.graph.adj_list(u) {
                if dist[v] == INF && flow[e] < self.cap[e] {
                    dist[v] = dist[u] + 1;
                    q.push_back(v);
                }
            }
        }
        dist
    }
fn dinic_search ( & self , s : usize , flow : & [ i64 ] ) -> Vec < i64 > { let mut dist = vec ! [ INF self graph num_v ( ) ] ; let mut q = :: std :: collections :: VecDeque :: new ( ) ; dist [ s ] = 0 ; q . push_back ( s ) ; while let Some ( u ) = q . pop_front ( ) { for ( e , v ) in self . graph . adj_list ( u ) { if dist [ v ] == INF && flow [ e ] < self . cap [ e ] { dist [ v ] = dist [ u ] + 1 ; q . push_back ( v ) ; } } } dist }
Compute BFS distances to restrict attention to shortest path edges.
Compute BFS distances to restrict attention to shortest path edges .
&self
s
usize
flow
&[i64]
&self
s
usize
flow
&[i64]