Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] dynamic_properties for graph attributes
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-06-07 07:20:55


> > I believe you can construct property maps over the GraphProperty
> parameter
> > using:
> >
> > get_property(g) // Where g is your graph object.
>
> I (and g++) can't find a get_property which takes one argument.
> The semantically closest I could find is
> get_property(adjacency_list& g, GraphPropertyTag);

Sorry. I was a way off on that one. What I meant to write was:

get_property(g, p)

where property is a property tag like vertex_index or edge_weight. It uses
the same mechanism as get(g, p) for getting property maps over vertex or
edge properties. None of the graph classes or adapters support bundled graph
properties there's a ticket filed.

There's an example (sort of) of this in libs/graph/test/graphviz.cpp. The
graph is constructed (more or less) as:

typedef property<vertex_name_t, string,
  property<vertex_color_t, float> > vertex_p;
typedef property<edge_weight_t, float> edge_p;
typedef property<graph_name_t, string> graph_p
typedef adjacency_list<vecS, vecS, directedS, vertex_p, edge_p, graph_p>
graph_t;

And used as (again, more or less):

dynamic_properties dp;
property_map<graph_t, graph_name>::type gn =
  get_property(g, graph_name);
dp.property(g);

I really don't get how to do it right but have to during the next days...
> I definitely appreciate your help and am sorry for any offence my rambling
> may have produced (I'm just totally depressed trying to implement some-
> thing supposedly trivial for 3 days now and not being able to find ANY
> example for this in the docs).
>

Graph properties have never really been thoroughly evaluated (or
documented). There just haven't been that many people that really seemed to
use them. Unfortunately, when people were asking, there wasn't a lot of
forward momentum on BGL development.

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