Boost logo

Boost Users :

From: Elvanör (elvanor2004_at_[hidden])
Date: 2005-03-08 01:43:25


Hello everyone,

this is my first post to the list so excuse me if I didn't get some
concepts right.

I have begun to learn the BGL as I was searching for a good graph
library; I am a student in Computer Science and my thesis is about
graph algorithms. I am impressed, it seems to be a good library. Plus,
it has forced me at last to deepen my knowledge of STL, templates and
generic programming.

Now to my question: as I am a new user, when I read the documentation I
decided to use the new bundled properties mechanism rather than the old
properties map methods. It was recommended in the documentation (I
would, btw, like to humbly point out that the documentation is not very
clear on this. The bundled properties explanation page is not
accessible from the content page and could confuse quite a lot of
people), and anyway I found that a lot simpler.

But now I am running into troubles. First, are bundled properties
applicable to "external properties"? To be honest, I don't really get
the difference between internal and external properties. Or do I have
to use property maps (in the old way) for external properties?

Second, with bundled properties I have troubles with constructors. I
created a class myClass, that I will use as a struct for the bundled
properties. This class contains reference members so it needs a
constructor better than the default constructor without any arguments.
Creating a graph with these bundled properties doesn't allow me to use
another constructor than the default myClass() one, it seems. I think
it would be very good if I could create an array of myClass and then
point my Graph object to this array to use it as bundled properties.
Then I could do all the initialization I want cleanly.

Right now, it seems to me than the only way to modify these properties
(prior to running a grpah algorithm for example), is to do some sort
of:

G[v].my_first_data_member =5;
G[v].my_second_data_member = "test";

etc... with v moving over all the vertexes (or edges). This seems a
little bit strange... and impossible to use reference data members with
that, for exemple.

My last problem is with the depth_first_search() algorithm... and of
course bundled properties. This algorithm takes a const Graph &; but I
want to be able to modify (while running the algorithm) the bundled
properties!! That is the whole point of running this algorithm. I don't
want to change the structure of the graph (the abstract graph - links
from vertices to edges, etc), while running the algorithm, of course,
but I do want to change when I want my bundled properties... that is
not possible (at least, not without compiler warnings, which I don't
like :-) due to the fact that depth_first_search expects a const graph.

I think that will be all... if someone can enlighthen me on these
topics I'll be happy!!

Regards

Jean-Noël


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