fn tc<G: Scope<Timestamp=()>>(edges: &Arrange<G, Node, Node, Diff>) -> Collection<G, Edge, Diff> {

    // repeatedly update minimal distances each node can be reached from each root
    edges.stream.scope().iterative::<Iter,_,_>(|scope| {

            let inner = Variable::new(scope, Product::new(Default::default(), 1));
            let edges = edges.enter(&inner.scope());

            let result =
            inner
                .map(|(x,y)| (y,x))
                .join_core(&edges, |_y,&x,&z| Some((x, z)))
                .concat(&edges.as_collection(|&k,&v| (k,v)))
                .threshold_total(|_,_| 1);

            inner.set(&result);
            result.leave()
        }
    )
}
// returns pairs (n, s) indicating node n can be reached from a root in s steps.
returns pairs (n, s) indicating node n can be reached from a root in s steps.
returns pairs ( n s ) indicating node n can be reached from a root in s steps .
fn tc<G: Scope<Timestamp=()>>(edges: &Arrange<G, Node, Node, Diff>) -> Collection<G, Edge, Diff> {
    // repeatedly update minimal distances each node can be reached from each root
    edges.stream.scope().iterative::<Iter,_,_>(|scope| {
            let inner = Variable::new(scope, Product::new(Default::default(), 1));
            let edges = edges.enter(&inner.scope());
            let result =
            inner
                .map(|(x,y)| (y,x))
                .join_core(&edges, |_y,&x,&z| Some((x, z)))
                .concat(&edges.as_collection(|&k,&v| (k,v)))
                .threshold_total(|_,_| 1);
            inner.set(&result);
            result.leave()
        }
    )
}
fn tc < G : Scope < Timestamp = ( ) > > ( edges : & Arrange < G , Node , Node , Diff > ) -> Collection < G , Edge , Diff > { // repeatedly update minimal distances each node can be reached from each root edges . stream . scope ( ) . iterative :: < Iter , _ , _ > ( | scope | { let inner = Variable :: new ( scope , Product :: new ( Default :: default ( ) , 1 ) ) ; let edges = edges . enter ( & inner . scope ( ) ) ; let result = inner . map ( | ( x , y ) | ( y , x ) ) . join_core ( & edges , | _y , & x , & z | Some ( ( x , z ) ) ) . concat ( & edges . as_collection ( | & k , & v | ( k , v ) ) ) . threshold_total ( | _ , _ | 1 ) ; inner . set ( & result ) ; result . leave ( ) } ) }
returns pairs (n, s) indicating node n can be reached from a root in s steps.
returns pairs ( n s ) indicating node n can be reached from a root in s steps .
edges
&Arrange<G, Node, Node, Diff>
edges
&Arrange<G, Node, Node, Diff>