首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Lemon中查找节点的邻居

如何在Lemon中查找节点的邻居
EN

Stack Overflow用户
提问于 2010-08-26 19:19:37
回答 1查看 2.1K关注 0票数 5

在Lemon C++图库中,给定无向图中的一个节点,例如,如何找到边连接的其他节点?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-08-26 20:55:34

我会试一试,即使我对C++很生疏,以前也没有用过Lemon:

代码语言:javascript
复制
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

..。多年来,我在图论方面做了相当多的工作。

我希望它能帮上忙。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3574569

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档