On Thu, 2002-08-22 at 10:19, Shaw, Richard A wrote:
Can anybody tell my why the find_edge function in the code below fails to get a property if I return the first edge in the list.
This is what happens -
Find_edge looks for edge A - B It winds it and prints out the edge descriptor, and the weight of
It the returns the edge The main code prints out the edge descriptor and the fails when
I did mean to mention the compiler etc. It is -
gcc version 2.95.3-5 (cygwin special)
and boost 1.28
I did think after reading the graph introductin that the edge()
function may do what I wanted but I couldn't find any other mention
of it. Just discovered the adjacency_list_io classes after I'd spend
the time writing my own (low tech ones).
I'll try using edge instead and see what happens
Thanks - it's great to get such a quick response.
--- In Boost-Users@y..., Tarjei Knapstad
print the weight.
BTW - Is there a ready made function to find an edge based on the vertices ?
#include
#include <iostream> #include <fstream> #include
#include #include using namespace boost;
// Find edge template <class Graph> std::pair
find_edge(graph_traits<Graph>::vertex_descriptor u, graph_traits<Graph>::vertex_descriptor v, Graph g) It's a lot more efficient to pass a const reference to the graph you're searching in.
As Jeremy though, I cannot reproduce your problem using gcc 3.1 and either of boost 1.2.8 or the latest CVS source tree.
Regards, Tarjei