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: If you
didn't find this in the documentation, don't worry. It's not very easy to

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

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at