Boost logo

Boost Users :

Subject: Re: [Boost-users] Edmonds karp max flow compile error
From: coolhead.pranay_at_[hidden]
Date: 2012-02-19 16:05:25


Changing listS to vecS worked. Is there a specific reason why listS wont
work ?

On Sun, Feb 19, 2012 at 3:11 PM, Jeremiah Willcock <jewillco_at_[hidden]>wrote:

> 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 mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
Pranay Anchuri
Computer Science Graduate Student
Rensselaer Polytechnic Institute
Troy,NY


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