On Wed, Sep 9, 2009 at 11:07 AM, Jeremiah Willcock <jewillco@osl.iu.edu> wrote:
On Wed, 9 Sep 2009, David Doria wrote:
Any clues as to what I've done wrong? Maybe a simple example like this could be put on the kolmogorov documentation page?
Sorry to spam you with another email, but I tweaked your code so it works and attached the result. I just changed the residual capacity to a double, added the necessary vertex properties (one problem you had was that you were passing your edge properties to the graph as vertex properties), changed the edge capacity setting to what I posted a few minutes ago, and changed the result of kolmogorov_max_flow to be converted to a double. It all compiles now.
-- Jeremiah Willcock
____
Jeremiah,
Rather than spam, I'd call it fantastic information! I really appreciate your time.
Although it compiles, the code you sent seems to segfault on the
kolmogorov call. Maybe because we didn't specify a source and sink?
Shouldn't it work without specifying them, thought? There should be two
different mincut problems that can be solved - 1) the min cut on the
entire graph and 2) the min cut dividing a specified source and sink
(or multiple sources and/or sinks). Do you know how to do that/why it
is segfaulting?
Some other questions:
1) So this line creates two vertices:
Graph g(2);
then since the V0->V1 edge already exists, the add_edge function doesn't add another edge, it simply returns something like a pointer to the already existing edge so that properties, can be assigned to it, correct?
2) Since add_edge(..).first is the actual edge, it is implied that this a pair and hence a .second - what is stored in the .second?
3) Would I get the edge weight like this:?
double ew = get(edge_capacity, g, add_edge(0, 1, g).first);
We're almost there!
Thanks again,
David