Hi
Try using bidirectionalS instead (thats what I do for my directed graphs).
Please tell me is it works.
Best
Line :-)
________________________________________
Fra: boost-users-bounces@lists.boost.org [boost-users-bounces@lists.boost.org] På vegne af Berit Løfstedt [blof@man.dtu.dk]
Sendt: 30. juli 2010 15:24
Til: Boost-users@lists.boost.org
Emne: [Boost-users] [Graph] Problems with in-edges for a user defined AdjacencyList
Hi,
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<
vecS,
vecS,
directedS,
VertexProperties,
EdgeProperties
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::in_edge_iterator in_e, in_end;
graph_traits::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++ )
{
e=*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++ )
{
e=*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
[cid:part1.00040703.07070304@man.dtu.dk]
Department of Management Engineering
Produktionstorvet, Bygning 426
2800 Kgs. Lyngby
blof@man.dtu.dkmailto:blof@man.dtu.dk
www.or.man.dtu.dkhttp://www.or.man.dtu.dk