我正在使用捆绑属性和 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。
希望有人知道这个问题的解决方案。
谢谢
本