Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-08-12 14:04:05

Hi Vladimir,

On Mon, 12 Aug 2002, Vladimir Prus wrote:
ghost> Hi,
ghost> I've a simple task: I need to attach bool value to graph edges. Okay, docs
ghost> say:
ghost> "Creating a your own property types and properties is easy; just define a
ghost> tag class for your new property."
ghost> But now I really don't like this.
ghost> 1. Why should I create any "tag class" if edge->bool mapping is all I need.

The tag class gives a name to the mapping, to differentiate it from other

ghost> 2. I don't want to store my mapping as internal property and I see no way to
ghost> create external one.
ghost> 3. Finally, edge_descriptor is not required to have "<" operator, so I can't
ghost> use map (aside from efficiency issues).

For adjacency_list, the way to get external property maps is to first
create an internal property map that assigns an index to each edge, and
then you can use the index as a key in external maps.

ghost> What would be nice is to have a way to get a property map type given a graph
ghost> type and a contained type. Something like
ghost> boost::edge_property_map<CFG, bool>::type final ;

And this would be an internal map, yes? But I thought you just said you
wanted external, not internal.

ghost> If such type is defined for every PropertyGraph then I can
ghost> associate any data with edges and know that it's as efficient as
ghost> possible for the given graph type.
ghost> Opinions?

Sure, that would be nice. I just don't know how to implement it so that
deciding which internal property to access is done at compile time. If it
is done at run-time there will be a performance hit. Do you have an
implementation approach in mind?


 Jeremy Siek
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster ( office phone: (812) 855-3608

Boost list run by bdawes at, gregod at, cpdaniel at, john at