<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi Janos,</div>
<div> </div>
<div>thanks a lot. Using FullGraph did resolve the issue.</div>
<div> </div>
<div>Cheers,</div>
<div> </div>
<div>Thomas</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Dienstag, 07. Februar 2017 um 08:56 Uhr<br/>
<b>Von:</b> "Janos Tapolcai" <janos.tapolcai@gmail.com><br/>
<b>An:</b> "Lion Bull" <lion.bull@gmx.de><br/>
<b>Cc:</b> lemon-user@lemon.cs.elte.hu<br/>
<b>Betreff:</b> Re: [Lemon-user] Stuck with compiling TSP solver</div>
<div name="quoted-content">Hi,<br/>
<br/>
I think const ChristofidesTsp requires a FullGraph object as the first input not a ListGraph.<br/>
<br/>
Alpar, it would be very useful to have access source codes with lemon. Even if it is not documented or commented, it helps a lot if you can take a look on example code fragments how a function is called.<br/>
<br/>
Best<br/>
János<br/>
<br/>
<br/>
> On 2017. Feb 7., at 8:08, Lion Bull <lion.bull@gmx.de> wrote:<br/>
><br/>
> Hi lemon community,<br/>
><br/>
> I almost finished my small little programm but am stuck with the cost map paramter when calling the TSP solvers. Would be great if someone could point me in the right direction :-)<br/>
><br/>
> Here is what I try to do<br/>
><br/>
> //Initiate the graph from file<br/>
> ListGraph g;<br/>
> ListGraph::NodeMap<std::string> name(g);<br/>
> ListGraph::EdgeMap<int> length(g);<br/>
> ListGraph::Node src;<br/>
> std::string title;<br/>
> graphReader(g, "graph.lgf")<br/>
> .nodeMap("title", name)<br/>
> .edgeMap("length", length)<br/>
> .node("source", src)<br/>
> .attribute("caption",title)<br/>
> .run();<br/>
><br/>
> //Solve TSP<br/>
> typedef ChristofidesTsp<ListGraph::EdgeMap<int> > TSP;<br/>
> TSP tour(g, length); <-------- This line won't compile<br/>
> tour.run();<br/>
> std::cout << tour.tourCost() << "\n";<br/>
><br/>
> Somewhere initiating the ChristofidesTsp fails. Looks like the cost map I provide is not a cost map. So what am I missing here?<br/>
><br/>
> lemon_test.cc:116:24: error: no matching function for call to ‘lemon::ChristofidesTsp<lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<int> >::ChristofidesTsp(lemon::ListGraph&, lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<int>&)’<br/>
> TSP tour(g, length);<br/>
> ^<br/>
> Thanks for your help,<br/>
><br/>
> Thomas<br/>
> _______________________________________________<br/>
> Lemon-user mailing list<br/>
> Lemon-user@lemon.cs.elte.hu<br/>
> <a href="http://lemon.cs.elte.hu/mailman/listinfo/lemon-user" target="_blank">http://lemon.cs.elte.hu/mailman/listinfo/lemon-user</a><br/>
</div>
</div>
</div>
</div></div></body></html>