【发布时间】:2011-11-28 07:29:26
【问题描述】:
我正在使用捆绑属性和 adjacency_list,并且想使用 subgraph 类。
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 来比较两条边。
现在我的问题是如何使用子图中的捆绑属性添加边缘?
在没有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);
但这不适用于 Subgraph。
希望有人知道这个问题的解决方案。
谢谢
本
【问题讨论】:
标签: c++ boost boost-graph