在Lemon C++图库中,给定无向图中的一个节点,例如,如何找到边连接的其他节点?
发布于 2010-08-26 20:55:34
我会试一试,即使我对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.
...
}我使用了这个:LEMON -- an Open Source C++ Graph Template Library
..。这个是:LEMON: Graph Class Reference
..。多年来,我在图论方面做了相当多的工作。
我希望它能帮上忙。
https://stackoverflow.com/questions/3574569
复制相似问题