|
Boost : |
Subject: Re: [boost] CSR graph in max flow
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-04-16 15:42:23
On Fri, 16 Apr 2010, Dan Jiang wrote:
>
> Hi Jeremiah,
> Here is the code and error. Thanks again for your help.
> -Dan
> ==========================================
> typedef compressed_sparse_row_graph<directedS> Traits;
> struct EdgeProp{ float capacity; float residual_capacity; Traits::edge_descriptor reverse_edge; };
> typedef compressed_sparse_row_graph<directedS,
> property<vertex_index_t, DWORD32>,
> EdgeProp,
> no_property, // Graph Property
> DWORD32, // Vertex Type
> DWORD32> // EdgeIndex Type
> BOOST_Graph;
> The code that errors out: flow = (float)push_relabel_max_flow(g, s, t);
Since you are using bundled properties, you need to give the capacity,
residual, and reverse edge maps explicitly as arguments to
push_relabel_max_flow. Please add those as separate arguments (using the
named parameter mechanism) and see if that helps. I don't know why the
maps default to identity_property_map -- that seems like it will basically
never work. Also, the push_relabel_max_flow code shouldn't be using
operator[]. Are you using the Boost trunk or a release version? I can
put some fixes into the trunk for some of these issues.
-- Jeremiah Willcock
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk