Re: [Boost-users] [Graph] Subgraphs with bundled properties

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); }
participants (1)
-
Cooprider, Nathan (US NonSSA)