我正在使用捆绑属性和adjacency_list并希望使用子图类。Boost子图和捆绑属性
struct Vertex
{
int index;
int seed;
};
struct Edge
{
bool visted;
double weight;
};
typedef adjacency_list<listS, listS, undirectedS, Vertex, property<edge_index_t,int,Edge> > Graph;
typedef subgraph<Graph> testSubgraph;
的property<edge_index_t,int,Edge>
部分是必要的,作为子图需要edge_index_t
到两个边缘进行比较。
现在我的问题是如何在Subgraph中使用捆绑属性添加Edge? 在正常曲线不property<edge_index_t,int,Edge>
我加一个边缘如下:
Edge e;
vertex_descriptor u,v;
// fill in u and v;
e.weight = 1.0;
e.visted=false;
add_edge(u,v,e,graph);
但是,这并不为子图工作。
希望有人知道这个解决方案。
感谢
本
如果我只是将size_t索引添加到我的Edge结构中,它仍然不会找到此索引,因为它在'propertey'中需要 –
Ben