[Lemon-user] Question related to preflow
Attila Bernáth
athos at cs.elte.hu
Wed May 16 14:38:16 CEST 2012
> Dear All,
>
> I want to compute the (unique) inclusion-wise maximal minimum s-t cut
> in a network.
>
> I found the following solution:
>
> //Find a maximum flow:
> lemon::Preflow< Graph, typename Graph::template ArcMap<double> >
> pre(auxG,auxCap,src,trg);
> pre.run();
> //Take the residual graph
> typedef lemon::ResidualDigraph<const Graph, const typename
> Graph::template ArcMap<double> > ResDigraph;
> ResDigraph res(auxG,auxCap,pre.flowMap());
> //Reverse its edges
> lemon::ReverseDigraph< ResDigraph > revRes(res);
> //Take a Bfs in it
> lemon::Bfs< lemon::ReverseDigraph< ResDigraph > > befes(revRes);
> befes.run(trg);
>
> The non-reached nodes are the ones I need.
>
> Is there a simpler solution for this problem?
>
> Thanks in advance.
>
> Attila
More information about the Lemon-user
mailing list