Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] Subgraphs with bundled properties
From: Cooprider, Nathan \(US NonSSA\) (nathan.cooprider_at_[hidden])
Date: 2008-10-09 14:46:22

I would like to use a set to store my nodes inside a graph that uses
subgraphs, but that does not seem to work. The code below does not
compile if I switch vecS to setS and adjust the vertex properties to
have an index (replace Node, with the commented portion after it).
However, not using a subgraph and having the adjacency list be the graph
directly fixes the issue. Any insights as to what I should do


#include <string>
#include <boost/graph/adjacency_list.hpp>
#include <boost/config.hpp>
#include <boost/graph/subgraph.hpp>

using namespace boost;

struct Node {
  std::string name;
  float weight;

// want vecS to be setS for fast lookups
typedef adjacency_list < listS, setS,
                         Node, // property<vertex_index_t, int, Node >,
                         property<edge_index_t, int>
> PlainGraph;
typedef subgraph<PlainGraph> Graph;

int main () {
  Graph g;
  Graph::vertex_descriptor tmp = add_vertex(g);
  struct Node x;
  put(get(vertex_bundle,g), tmp, x);

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at