[graph][BGL] Why can not I use edge_index_t?
Hello,
I want to create an iterator_property_map to iterate over the edges, but I
cannot declare the following:
typedef property_map
On Wed, 13 Mar 2013, bminano wrote:
Hello,
I want to create an iterator_property_map to iterate over the edges, but I cannot declare the following: typedef property_map
::const_type EdgeIndexMap; The compilation gives me an error. I am using an adjacency list with vertex and edge properties. I can use a vertex_index_t, so I assumed that I could use the equivalent for edges. But I don't understand why I can't.
This is my adjacency list: typedef boost::adjacency_list
, bidirectionalS, property , EdgeProperties> Graph; Have anyone deal with something similar?
None of the adjacency_list graph types provides edge_index_t as a built-in property map as far as I know. If you need that map, you will need to define it as an internal property and fill it in yourself (and update it if/when your graph changes). If you just need to use it for property maps, internal properties are much easier. If you are not mutating your graph's structure, the compressed_sparse_row_graph type provides an edge_index_t property automatically as well. -- Jeremiah Willcock
Hello Jeremiah, I am a little confused with the property maps, and I am trying different things. What I really want is to define some properties for the edges on a mutable graph. I am using a distributed adjacency list. I tried with distributed property maps, with iterator property maps and now I am trying defining internal properties. What do you recommend for my case? I want to add and remove edges and vertices, and the properties should be synchronized between processors. Thanks, El 13/03/13 14:54, Jeremiah Willcock escribió:
On Wed, 13 Mar 2013, bminano wrote:
Hello,
I want to create an iterator_property_map to iterate over the edges, but I cannot declare the following: typedef property_map
::const_type EdgeIndexMap; The compilation gives me an error. I am using an adjacency list with vertex and edge properties. I can use a vertex_index_t, so I assumed that I could use the equivalent for edges. But I don't understand why I can't.
This is my adjacency list: typedef boost::adjacency_list
, bidirectionalS, property , EdgeProperties> Graph; Have anyone deal with something similar?
None of the adjacency_list graph types provides edge_index_t as a built-in property map as far as I know. If you need that map, you will need to define it as an internal property and fill it in yourself (and update it if/when your graph changes). If you just need to use it for property maps, internal properties are much easier. If you are not mutating your graph's structure, the compressed_sparse_row_graph type provides an edge_index_t property automatically as well.
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Un saludo, Borja Miñano IAC3 - Universitat de les Illes Balears ParcBit - Edifici 17 (Disset); Local D7 Cra. Valldemossa km. 7,4 E-07121 Palma de Mallorca. Balears. Spain. Phone: +34 871 967 434
On Wed, 13 Mar 2013, Borja Miñano wrote:
Hello Jeremiah,
I am a little confused with the property maps, and I am trying different things. What I really want is to define some properties for the edges on a mutable graph. I am using a distributed adjacency list. I tried with distributed property maps, with iterator property maps and now I am trying defining internal properties. What do you recommend for my case? I want to add and remove edges and vertices, and the properties should be synchronized between processors.
Internal properties are the easiest way to do that. -- Jeremiah Willcock
Hello Jeremiah, Thank you for your help. I am using now Internal properties and property maps to read and write the properties. But I have another question. I want to write to an in_edge from a processor when this edge is not local. What do I need for being able to do it? An distributed property map or a iterator_property_map? El 13/03/13 15:13, Jeremiah Willcock escribió:
On Wed, 13 Mar 2013, Borja Miñano wrote:
Hello Jeremiah,
I am a little confused with the property maps, and I am trying different things. What I really want is to define some properties for the edges on a mutable graph. I am using a distributed adjacency list. I tried with distributed property maps, with iterator property maps and now I am trying defining internal properties. What do you recommend for my case? I want to add and remove edges and vertices, and the properties should be synchronized between processors.
Internal properties are the easiest way to do that.
-- Jeremiah Willcock
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Un saludo, Borja Miñano IAC3 - Universitat de les Illes Balears ParcBit - Edifici 17 (Disset); Local D7 Cra. Valldemossa km. 7,4 E-07121 Palma de Mallorca. Balears. Spain. Phone: +34 871 967 434
On Mar 14, 2013, at 8:29 AM, Borja Miñano wrote:
Hello Jeremiah,
Thank you for your help. I am using now Internal properties and property maps to read and write the properties. But I have another question. I want to write to an in_edge from a processor when this edge is not local. What do I need for being able to do it? An distributed property map or a iterator_property_map?
If you want to write to non-local edges you'll need a distributed property map (which will require an edge index map) as well as a means of determining the edge_descriptor for the edge you want to write to. Note that construction via edge() is not supported for non-local edges. Hope that helps, Nick
Hello Nick,
Thank you for your answer.
I think I finally have managed the problem. For the ones who could need
it there is what I've done:
typedef
boost::parallel::distributed_property_map
On Mar 14, 2013, at 8:29 AM, Borja Miñano wrote:
Hello Jeremiah,
Thank you for your help. I am using now Internal properties and property maps to read and write the properties. But I have another question. I want to write to an in_edge from a processor when this edge is not local. What do I need for being able to do it? An distributed property map or a iterator_property_map? If you want to write to non-local edges you'll need a distributed property map (which will require an edge index map) as well as a means of determining the edge_descriptor for the edge you want to write to. Note that construction via edge() is not supported for non-local edges.
Hope that helps, Nick _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Un saludo, Borja Miñano IAC3 - Universitat de les Illes Balears ParcBit - Edifici 17 (Disset); Local D7 Cra. Valldemossa km. 7,4 E-07121 Palma de Mallorca. Balears. Spain. Phone: +34 871 967 434
participants (4)
-
bminano
-
Borja Miñano
-
Jeremiah Willcock
-
Nick Edmonds