Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] Problems with in-edges for a user defined AdjacencyList
From: Line Blander Reinhardt (lbre_at_[hidden])
Date: 2010-07-31 13:10:39

Try using bidirectionalS instead (thats what I do for my directed graphs).
Please tell me is it works.
   Line :-)

Fra: boost-users-bounces_at_[hidden] [boost-users-bounces_at_[hidden]] På vegne af Berit Løfstedt [blof_at_[hidden]]
Sendt: 30. juli 2010 15:24
Til: Boost-users_at_[hidden]
Emne: [Boost-users] [Graph] Problems with in-edges for a user defined AdjacencyList


I am fairly new to boost and I have a problem using the in_edges(v, G) function.

I have defined a graph of type AdjacencyList:
typedef adjacency_list<
> mcf_graph;

The following code with m_current_network being a private class variable of type mcf_graph

void best_insertion::search()
  vertex_descriptor v,u,w;
  edge_descriptor e;
  graph_traits<mcf_graph>::in_edge_iterator in_e, in_end;
  graph_traits<mcf_graph>::out_edge_iterator out_e, out_end;
  edge_index_map_t edge_indices=get ( edge_index, m_current_network );
  edge_type_map_t edge_types= get(edge_type, m_current_network);
  capacity_map_t edge_capacities=get ( edge_capacity, m_current_network );

  vector<int> indices;
  vector<int>::iterator it, it_end;

//select vertex v to reinsert

//find_edge_indices of vertex v
  for ( tie ( in_e, in_end ) = in_edges(v, m_current_network ); in_e != in_end; in_e++ )
      indices.push_back ( edge_indices[e] );


  for ( tie ( out_e, out_end ) = out_edges( v, m_current_network ); out_e != out_end; out_e++ )
      indices.push_back ( edge_indices[e] );

 produces the error:
 error: no matching function for call to ‘in_edges(vertex_descriptor&, mcf_graph&)’

The problem does not occur for out_edges. From the examples I have seen AdjacencyList should support both functions. Can anybody explain to me why in_edges do not work for this example?

Best Regards,
Berit Løfstedt
PhD. Student
DTU Management Engineering, Operations Research
Technical University of Denmark
Department of Management Engineering
Produktionstorvet, Bygning 426
2800  Kgs. Lyngby

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at