Boost logo

Boost Users :

Subject: Re: [Boost-users] Edmonds karp max flow compile error
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-02-19 15:11:38


On Sat, 18 Feb 2012, coolhead.pranay_at_[hidden] wrote:

> Hi,
>
> I want to use BGL to compute the maximum flow in a network. Following is the definition of Graph that I am using
>
> typedef adjacency_list_traits < listS, listS, bidirectionalS > Traits;
>   typedef adjacency_list < listS, listS, bidirectionalS,
>     property < vertex_name_t, int >,
>     property < edge_capacity_t, long,
>     property < edge_residual_capacity_t, long,
>     property < edge_reverse_t, Traits::edge_descriptor > > > > Graph;
> .
> Before computing the max flow, I have the following optional parameters setup
>
> property_map < Graph, edge_capacity_t >::type
>               capacity = get(edge_capacity, this->g);
>             property_map < Graph, edge_reverse_t >::type rev = get(edge_reverse, this->g);
>             property_map < Graph, edge_residual_capacity_t >::type
>               residual_capacity = get(edge_residual_capacity, this->g);
>             property_map < Graph, vertex_name_t >::type vname = get(vertex_name,this->g);
>
> std::vector<default_color_type> color(num_vertices(this->g));
>             std::vector<Traits::edge_descriptor> pred(num_vertices(this->g));
>
> The call to the algorithm is..          
>
>  int flow = edmonds_karp_max_flow(g, s, t, capacity, residual_capacity, rev, &color[0], &pred[0]);
>
> When I try to compile the program it fails with the following error message.  Can someone explain the reason for this ?

The problem stems from your use of the listS selector for your vertex
container; choosing vecS instead is likely to make the code work. If you
need to use listS for some reason, you will need to do more changes to get
the code to work; if you need to know about that, please reply to the
list and I will put in all of the steps you need to do. Using vecS is by
far the simplest solution, though.

-- 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