Boost logo

Boost Users :

Subject: [Boost-users] [graph] getting from vertex item to finding related elements
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2010-08-12 17:26:05


I figure there HAS to be some way to do what I need but I can't think of
it at the moment. Currently I have a couple of objects called
"edge_description" and "vertex_description" that are the properties of
the vertex and edges within a graph. What I want to be able to do is
retrieve an edge_description from a vertex_description. Graph
declaration looks like so:

typedef boost::adjacency_list
  <
      boost::listS
    , boost::listS
    , boost::bidirectionalS
    , vertex_description
    , edge_description
> system_graph_t;

The only way I can think of to do this is to make the graph and the
graph::vertex_descriptor reference members of the vertex_description
object and manually keep those synchronized (serialization being the
main issue). I'm disliking that plan.

Is there a method of construction a graph that would get me what I want?
So that when I have a pointer or reference to an element in the graph I
can fetch connected elements?

-- 
http://crazyeddiecpp.blogspot.com/

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