1
我有一个有向图。运行时会动态添加和删除新边。如果将要添加到图形的边创建一个循环,则不应该添加该边。我如何用BGL来做到这一点?插入期间检测周期
typedef boost::adjacency_list<
boost::listS, boost::vecS,
boost::directedS
> Graph;
int main(int, char*[]){
Graph G;
add_edge(0, 1, G);
add_edge(1, 2, G);
add_edge(2, 3, G);
add_edge(3, 0, G); //creates cycle, should abort.
}
我认为你得到了你和v混淆了,但你仍然在代码中有错误。谢谢,不过。 – Arlen 2011-05-29 02:47:22