Boost logo

Boost Users :

Subject: [Boost-users] How to use graph properties
From: Paolo Bolzoni (paolo.bolzoni.brown_at_[hidden])
Date: 2014-02-10 12:02:15

Dear list,

I need to keep track of two special vertices in my graph, So
I thought to attach two vertex_descriptor as graph
properties so have easy access any moment. Properties work
fine for edges or vertices, but I cannot make them work for
the graph.

In the bottom is the C++ code. The graph has the two properties,
now how I cat get and put them? This code does not work and
the error messages are impossible to read for me.
Otherwise that is the way to keep graph-wise properties?

The code compiles removing the two puts, so I assume the
error is there.

Yours sincerely,

#include <boost/graph/adjacency_list.hpp>

namespace boost {
    enum graph_source_t { graph_source = 100 };
    BOOST_INSTALL_PROPERTY (graph, source);

    enum graph_destination_t { graph_destination = 101 };
    BOOST_INSTALL_PROPERTY (graph, destination);

typedef size_t graph_vertex;

typedef boost::adjacency_list <
    boost::property < boost::graph_source_t, graph_vertex,
        boost::property < boost::graph_destination_t, graph_vertex,

boost::graph_traits<graph_t>::vertex_descriptor>::value, "Check out
the vertex descriptor type!");

int main() {
    using namespace boost;

    graph_t g;
    add_edge(0, 1, g);

    put(graph_destination, g, 0);
    put(graph_source, g, 1);

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