Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] newbie to graph
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2008-10-31 09:34:21


>
> I am trying to build a graph and to compute the max_flow using
> boost/graph/kolomogorov_max_flow.hpp.
>

That's quite an error message. I'm not entirely sure what's going wrong
(besides the missing function call), but there are a couple of problems with
your program.

First, you should not be using the old-style properties to define your
graph. Use bundled properties. It's much cleaner and generates shorter error
messages since it can avoid the recursive templates. See here:
http://www.boost.org/doc/libs/1_36_0/libs/graph/doc/bundles.html. If you
didn't find this in the documentation, don't worry. It's not very easy to
find.

Second, you're trying to mix descriptors from two kinds of graphs (Traits
and Graph). While this may compile some of the time, you shouldn't be doing
it. If you're going to use bundled properties, you can set up your graph
like this:

struct Node;
struct Arc;

typedef adjacency_list<vecS, vecS, directedS, Node, Arc> Graph;

struct Node {
  std::string name;
};

struct Arc {
  long capacity;
  long risidual;
  graph_traits<Graph>::edge_descriptor reverse;
};

You should probably choose better names for Node and Arc. See if these
changes help you get rid of your errors.

Andrew Sutton
andrew.n.sutton_at_[hidden]



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