[Lemon-user] About Gomory-Hu tree

Yongjia Song yjsong.pku at gmail.com
Sun May 27 04:02:05 CEST 2012


Hi all,

I encounter a compiling error when I try to create a Gomory-hu instance.

// Construct a lemon graph instance
 697     SmartGraph g;
 698     SmartGraph::EdgeMap<int> cost(g);
 699     try{
 700         graphReader(g, argv[3]).
 701         edgeMap("cost", cost).
 702         run();
 703     }
 704     catch (Exception& error)
 705     {
 706         std::cerr << "Error: " << error.what() << std::endl;
 707         return -1;
 708     }
 709     SmartGraph::EdgeMap<double> capacity(g);
 710     for (SmartGraph::EdgeIt n(g); n != INVALID; ++n)
 711     {
 712         int j = g.id(n);
 713         cout << j << " ";
 714         capacity[n] = 0.5;
 715     }
 716     cout << endl;
 717     GomoryHu<SmartGraph> gomoryhu(g, capacity);
 718     gomoryhu.run();
 719     exit(0);

The error that shoes up when compiling is that, there is no matching
function for the constructor GomoryHu(g, capacity), and
the Problem is in line 709, when I change the type from double to int, it
then has no errors, but I don't think Lemon only supports int type
capacities.

Can anyone give me a hint on what is going on here?

Also, in order to get a minimum k-cut heuristically, I may need to go
through all the edges in the gomory-hu tree and choose the union of the k
smallest edges, which corresponds to a heuristically chosen k-cut. Is there
any efficient way to do this?

Thanks!

Best,

-- 
Sincerely:
SONG Yongjia(宋永佳)

Department of Industrial and Systems Engineering
College of Engineering, University of Wisconsin-Madison
3241 Mechanical Engineering Building
1513 University Avenue, Madison, WI 53706
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20120526/e39d6b65/attachment.html>


More information about the Lemon-user mailing list