Boost logo

Boost Users :

Subject: Re: [Boost-users] Using metric_tsp_approx with bundled properties
From: Albert Yiamakis (vkicefire_at_[hidden])
Date: 2014-04-17 05:26:31


> After your first named argument, you need to use named arguments for the rest of the argument list:
>
> metric_tsp_approx(g_init,
> weight_map(...).vertex_index_map(...).visitor(...));
>
> Fixing that might fix your compilation errors.
>
> -- Jeremiah Willcock

Interestingly, I don't see a named parameter overload in
metric_tsp_approx.hpp.

> Also, I'm having trouble creating a visitor. I tried :
>
> metric_tsp_approx(g_init,
> weight_map(get(&Road::length, g_init)).vertex_index_map(get(&City::id, g_init))
> .make_tsp_tour_visitor(back_inserter(c)));
>
> But compiling raises the error :
> has no member named ‘make_tsp_tour_visitor’
>
> Should I create a class for the visitor ?
>
>

No, the call should be

metric_tsp_approx(g_init,
weight_map(get(&Road::length, g_init)).vertex_index_map(get(&City::id,
g_init))
.visitor(make_tsp_tour_visitor(back_inserter(c))));

However that doesn't compile either; I suspect because there is no named
parameter overload and it tries to call

metric_tsp_approx(VertexListGraph& g, TSPVertexVisitor vis)

instead.

Albert


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net