[Lemon-user] Adapting digraph arc weighting

D Haley mycae at yahoo.com
Thu Feb 18 15:48:30 CET 2010


Hello,

I have a bipartite digraph that I want to perform minimum cost matching upon. The digraph has only arcs from nodes in set A to set B, i.e. no reverse nodes.

I have something like the following (arc_cost contains the regularised inverse weights).

typedef lemon::ListDigraph Graph;
Graph g;
lemon::ListDigraph::ArcMap<float> arc_cost(g);


... code to build digraph ..


lemon::Undirector<lemon::ListDigraph>  undirectedGraph(g);
lemon::MaxWeightedMatching<lemon::ListGraph,lemon::ListGraph::EdgeMap<float> > matching(undirectedGraph,arc_cost);

However, this won't work, particularly as I have no adaptor for arc_cost to make it a valid edgeMap

Quite, GCC doesn't like it, spitting out a difficult to decipher error, which i think means that it either (1) has the wrong template parameters or (2) the constructor arguments are of the wrong type(arc_cost)

main.cpp: In function 'int main()':
main.cpp:95: error: no matching function for call to 'lemon::MaxWeightedMatching<lemon::ListGraph, lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<float> >::MaxWeightedMatching(lemon::Undirector<lemon::ListDigraph>&, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<float>&)'
/usr/local/include/lemon/matching.h:1656: note: candidates are: lemon::MaxWeightedMatching<GR, WM>::MaxWeightedMatching(const GR&, const WM&) [with GR = lemon::ListGraph, WM = lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<float>]
/usr/local/include/lemon/matching.h:693: note:                 lemon::MaxWeightedMatching<lemon::ListGraph, lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<float> >::MaxWeightedMatching(const lemon::MaxWeightedMatching<lemon::ListGraph, lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<float> >&)
main.cpp:99: error: 'class lemon::MaxWeightedMatching<lemon::ListGraph, lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<float> >' has no member named 'matchingCost'


Does anyone have any suggestions, other than manually rebuilding the weighted graph from the weighted digraph?

Thanks,

D Haley



      



More information about the Lemon-user mailing list