A word of advice. If you entend to mutate your graph, I sugguest using internal instead of external properties. Depending on the container types employed internally of the graph, which you can specify, the vertex/edge descriptors are not useable as keys. The vertex descriptor is simply an index when vecS is used. The edge descriptor is an object that lacks an operator< method. I'd sugguest looking at adjacency_list_io.cpp for a non-trivial example of internal property usage. It as opposed to most other examples, actually has an custom struct. Stephen torri wrote:
On Wed, 2004-09-22 at 01:43, Vladimir Prus wrote:
Stephen torri wrote:
I see that the boost graph library is used to contain data but can it be used to contain a class which a visitor moves along the graph per a preset algorithm calling interfacing functions as it moves along?
I can't understand the question, sorry. What's "moves along" and what's "present algorithm".
Sorry. This is a prime example of "Torri" logic. Half in the brain and half in the email. A visitor to the graph would be what "moves" along on the graph.
class Blue : Color_Base { virtual ~Blue (){}
virtual std::string get_Name () { return std::string("Blue"); } };
So we could have a graph like
| Blue -- Red | / | / | / Yellow
I have a visitor called Color_Visitor which has the following pseudo code:
for each vertice in graph visit vertice call get_Name() print result
You can assign a Color_Base* to each vertex using either internal or external property and call 'get_Name()' on each vertex.
Good idea. I will need to review what is a internal or external property.
Thanks.
Stephen