即使我对 C++ 生疏并且以前没有使用过 Lemon,我也会尝试一下:
for (ListDigraph::OutArcIt arcIt(graph, node); arcIt != INVALID; ++arcIt) {
Arc arc(*arcIt); // Lemon iterators are supposed to be convertible to items
// without operator*, so arc(a) might work too.
Node oppositeNode( g.oppositeNode(node, arc) );
// Do something with the opposite node.
...
}
Run Code Online (Sandbox Code Playgroud)
我用过这个: LEMON——一个开源的 C++ 图形模板库
...还有这个: LEMON:图形类参考
...多年来,我在图论方面做了相当多的工作。
我希望它有帮助。
| 归档时间: |
|
| 查看次数: |
2104 次 |
| 最近记录: |