![](/img/trans.png)
[英]in boost graph lib, how do I get a specific out-edge of a vertex without iterating over all the out-edges of that vertex?
[英]Get specific edge with boost::graph
我正在使用boost::graph
,我有兩個vertex_descriptor
。 在沒有迭代所有邊緣的情況下,獲得它們之間邊緣的最快方法是什么?
好的,我發現了。 boost::edge(u,v,g)
返回pair<edge_descriptor, bool>
,其中bool
是邊是否存在。 所以在我的情況下,我知道它確實如此,所以我使用表達式:
boost::edge(u,v,g).first
boost/graph/lookup_edge.hpp
還有一個函數boost::lookup_edge()
; 該函數將調度到edge()
或out_edges()
以及基於您正在使用的特定圖表類型的搜索。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.