Boost logo

Boost Users :

Subject: [Boost-users] Error In undirected subgraph with no parallel edges
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2009-03-28 19:28:33


Hi,
 I am using following declaration to define subgraphs over undirected
graph such that parallel edges are disallowed:

typedef boost::adjacency_list<vecS, setS, undirectedS,
property<vertex_index_t,int>, property<edge_index_t,int> >
ImplGraph_t;
typedef boost::subgraph<ImplGraph_t> embeddedGraph_t;

that is use setS for EdgeList instead of listS.

However when I call the function local_to_global over the subgraph i
end up following errors:
/home/sandeep/Computing/boost_1_38_0/boost/graph/subgraph.hpp:147:
error: passing ‘const std::vector<void*, std::allocator<void*> >’ as
‘this’ argument of ‘typename std::_Vector_base<_Tp,
_Alloc>::_Tp_alloc_type::reference std::vector<_Tp,
_Alloc>::operator[](size_t) [with _Tp = void*, _Alloc =
std::allocator<void*>]’ discards qualifiers
/home/sandeep/Computing/boost_1_38_0/boost/graph/subgraph.hpp:147:
error: invalid conversion from ‘void*’ to ‘unsigned int’
/home/sandeep/Computing/boost_1_38_0/boost/graph/subgraph.hpp:147:
error: initializing argument 1 of ‘typename std::_Vector_base<_Tp,
_Alloc>::_Tp_alloc_type::reference std::vector<_Tp,
_Alloc>::operator[](size_t) [with _Tp = void*, _Alloc =
std::allocator<void*>]’

Please find the full code that creates the above scenario. Appreciate any help.

-Thanks
sandeep

///////////////-----------------------Undirected_Subgraph.cpp-----------------------------

#include <boost/graph/subgraph.hpp>
#include <boost/graph/adjacency_list.hpp>
using namespace boost;

typedef boost::adjacency_list<vecS, hash, undirectedS,
property<vertex_index_t,int>, property<edge_index_t,int> >
ImplGraph_t;
typedef boost::subgraph<ImplGraph_t> embeddedGraph_t;

int main()
{
  embeddedGraph_t G;
  typedef graph_traits<embeddedGraph_t>::vertex_descriptor vertex_t;
  vertex_t v;
  embeddedGraph_t& G1 = G.create_subgraph();
  G.local_to_global(v);
  return 0;
}


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