|
Boost Users : |
Subject: Re: [Boost-users] Using metric_tsp_approx with bundled properties
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2014-04-14 10:13:34
> From: Alexis Praga <alexispraga_at_[hidden]>
>To: boost-users_at_[hidden]
>Sent: Sunday, April 13, 2014 3:02 PM
>Subject: [Boost-users] Using metric_tsp_approx with bundled properties
>
>
>Hi,
>
>I am trying to use metric_tsp_approx on a graph defined as :
>
>typedef adjacency_list<vecS, vecS, undirectedS, City, Road> Graph;
>
>City contains the vertex id and Road the edge weight.
>After reading the documentation, I arrived to :
>
> 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)));
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
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