Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] Problems with in-edges for a user defined AdjacencyList
From: Berit Løfstedt (blof_at_[hidden])
Date: 2010-07-31 15:38:25


Hi Line,

It does - excellent advice ;-)

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
blof_at_[hidden] <mailto:blof_at_[hidden]>
www.or.man.dtu.dk <http://www.or.man.dtu.dk>

 

Line Blander Reinhardt wrote:
> 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_at_[hidden] [boost-users-bounces_at_[hidden]] P&#229; 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
>
> 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<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++ )
> {
> 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_at_[hidden]]
>
> Department of Management Engineering
> Produktionstorvet, Bygning 426
> 2800 Kgs. Lyngby
> blof_at_[hidden]<mailto:blof_at_[hidden]>
> www.or.man.dtu.dk<http://www.or.man.dtu.dk>
>
>
>
>
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



DTU_email_logo_01.gif

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