[Lemon-user] GomoryHu Help

Balázs Dezső deba.mf at gmail.com
Mon Aug 22 23:42:51 CEST 2011


Hi,

there is a test for the Gomry-Hu algorithm which contains example code:
test/gomory_hu_test.cc

#include <lemon/smart_graph.h>
#include <lemon/lgf_reader.h>
#include <lemon/gomory_hu.h>

int main() {
  GRAPH_TYPEDEFS(SmartGraph);
  SmartGraph graph;
  IntEdgeMap capacity(graph);

  GraphReader<SmartGraph>(graph, "test.lgf").
    edgeMap("capacity", capacity).run();

  GomoryHu<SmartGraph> ght(graph, capacity);
  ght.run();

  return 0;
}

The graph and capacity map are template parameters, therefore you
cannot find such classes in the reference. And indeed, the ListGraph
can be used as graph and ListGraph::EdgeMap<int> as capacity map.


Balazs


On Mon, Aug 22, 2011 at 3:33 PM, Marwin Rudolf <marwin.rudolf at gmail.com> wrote:
> Hello,
> I'm trying to use this function GomoryHu to get minimum cut of certain
> graph. The problem is that I couldn't figured out how to use (call) this
> function, because in reference pages it says only "graph" and "capacity
> map", and I didnt find any "graph" reference, neither "capacity map". Do
> they mean "ListGraph" and "edge map", respectively? Can somebody, please,
> give me an example code?
>
> Regards,
> Marwin
> P.s. I'm new here, so if I've done something wrong, email me please.
>
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>
>



More information about the Lemon-user mailing list