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

Nathan

#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,
                         directedS,
                         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 hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net