Boost logo

Boost Users :

From: Martin Mann (mmann_at_[hidden])
Date: 2008-08-06 06:07:50


Hi,

I encountered the following problem :

a successive call with equal parameters u, v, and g of

============================================================
std::pair<edge_descriptor, bool>
    add_edge( vertex_descriptor u
              , vertex_descriptor v
              , adjacency_list& g )
============================================================

yields both times "RESULT.second == true".

But the documentation states, that only in case it is NOT PRESENT it
should be true, which is obviously wrong for the second call.

If I use the "edge(u,v,g)" method to check if the edge exists I get the
correct result of "edge(u,v,g).second == false" before the first call
and "edge(u,v,g).second == true" after the first and before the second call.

So the problem is all about the add_edge function and I think it's more
a bug than a feature. Because otherwise the bool-flag is obsolete or
reports something totally different.

Cheers,

Martin

============================================================
   The boost graph class I use
============================================================

   //! The properties available for the nodes of a CoreGraph
typedef boost::property< boost::vertex_index_t, size_t
         , boost::property< boost::vertex_name_t, std::string
> >
                 CoreGraph_NodeProperties;
        
   //! The properties available for the edges of a CoreGraph
typedef boost::property< boost::edge_name_t, std::string
>
                 CoreGraph_EdgeProperties;
        
   //! The definition of a the internal graph representation
typedef boost::adjacency_list< boost::vecS
                                , boost::vecS
                                , boost::undirectedS
                                , CoreGraph_NodeProperties
                                , CoreGraph_EdgeProperties
> CoreGraph;

============================================================


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net