Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用boost::graph,我有两个vertex_descriptors。在不迭代所有边缘的情况下,获得它们之间边缘的最快方法是什么?
boost::graph
vertex_descriptor
好的,我发现了。boost::edge(u,v,g)返回边缘是否存在的pair<edge_descriptor, bool>地方。bool所以就我而言,我知道它确实如此,所以我使用以下表达式:
boost::edge(u,v,g)
pair<edge_descriptor, bool>
bool
boost::edge(u,v,g).first
中还有一个功能boost::lookup_edge();boost/graph/lookup_edge.hpp该函数根据您使用的特定图形类型分派到edge()or和搜索。out_edges()
boost::lookup_edge()
boost/graph/lookup_edge.hpp
edge()
out_edges()