Boost logo

Boost :

From: artwisz_at_[hidden]
Date: 2001-03-24 13:21:33


--- In boost_at_y..., Jeremy Siek <jsiek_at_l...> wrote:
> Hi Artur,
> Let me guess, is it all the stuff about the property_map traits
class (and
> the mess of classes like vertex_property_selector, etc in
> detail/adjacency_list.hpp) that is confusing you? It sure confuses
me ;)


> The main reason the property_map traits stuff is so complicated is
> the BGL components use workarounds instead of partial
specialization. If I
> had used partial spec. in the implementation of adjacency_list,
then the
> property_map traits stuff would have been MUCH simpler. Does your
> compiler support partial spec?

I am using MSVC++ for the sake of its cool optimizer, but perhaps
I'll try the newest gcc release.

> The second complicated part about the adjacency_list implementation
> is that it supports attaching multiple arbitrary properties to
> the graph. Do you want your graph class to also have this capability
> or do you just need to provide access to a couple specific
> internal properties?

I need to have a vertex property that is a template parameter of my
graph. Lately I plan on adding some edge properties too.
Actually what I need is an adjacency bit matrix representation, where
each out-edge corresponds to one bit of a bit vector. I have already
implemented my algorithm in terms of this representation and I don't
want to loose efficiency, now I just want to do it "the BGL way". The
efficiency gain is where I operate on the whole set of out-edges, ex.
I store vertex colors as bits and excluding colored out-edges boils
down to bit masking. Because of that I don't want to use iterators
(maybe later for a more generalized, less efficient case), and I
thought of keeping the bit vector associated with each vertex as a
vertex property.
One shortcut I thought of was simply to derive my graph class from a
specialized adjacency_list and overload all operations tunneling most
of them to the base class, but still I need to partially specialize
the property_map, so that I can write

   property_map<MyGraphType, vertex_bits_t>::type bits
      = get(vertex_bits, g);

instead of

   property_map<MyGraphType::Base, vertex_bits_t>::type bits
      = get(vertex_bits, g);

I guess it would not be difficult with gcc but don't really have a
clue how to do it in MSVC++.
Any suggestions would be *very* welcome.


> Cheers,
> Jeremy
> P.S. The stanford_graph.hpp is another example of a PropertyGraph
> and is less complicated than adjacency_list.

>  Jeremy Siek                        www:
>  Ph.D. Candidate                  email: jsiek_at_l...
>  Univ. of Notre Dame         work phone: (219) 631-3906
> --------------------------------------------------------------------

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