2013-07-18 83 views

回答

1

boost :: edge()的第三个参数就是你的图形。

还要注意的是该函数不直接返回边缘描述符,但是根据所述边缘的存在

像这样含有边描述符和一个布尔一对:

G myGraph; // construct the graph 
....   // populate it 
....   // select a pair of vertices u, v 

// get the edge between the vertices, if it exists 
typedef boost::graph_traits<G>::edge_descriptor edge_t; 
edge_t found_edge; 
std::pair < edge_t, bool > p = boost::edge(u, v, myGraph); 
if(! p.second) { 
    // edge does not exist 
    ... 
} else { 
    found_edge = p.first; 
    ... 
} 
相关问题