[BGL] read_graphviz and dynamic properties
I have been trying (unsuccessfully for the past hour), to read a graphviz file into an adjacency_list type. The program stops with a SIGABRT because I haven't mapped "node_id" to anything within the dynamic properties argument. However, I really have no desire to map node_id to anything; this is a very large graph and I'd like to avoid the memory consumption. If I try to map node id to the vertex_index_t map I receive a compiler error stating that's a const property map. If I want to map node_id to vertex_name_t map, I have to add that property to my adjacency_list type which will bloat the memory consumption. I just want to build the graph without worry about the properties. Is there anyway this can be done easily? The documentation on read_graphviz and write_graphviz are sorely lacking on this subject in my opinion. -- Sam Peterson peabody@freeshell.org peabodyenator@gmail.com
I have been trying (unsuccessfully for the past hour), to read a graphviz file into an adjacency_list type. The program stops with a SIGABRT because I haven't mapped "node_id" to anything within the dynamic properties argument. However, I really have no desire to map node_id to anything; this is a very large graph and I'd like to avoid the memory consumption.
If I try to map node id to the vertex_index_t map I receive a compiler error stating that's a const property map. If I want to map node_id to vertex_name_t map, I have to add that property to my adjacency_list type which will bloat the memory consumption. I just want to build the graph without worry about the properties. Is there anyway this can be done easily? If you don't care about any properties, and you are using Boost from
I'm not absolutely sure, but you might be able to pass along a boost::dummy_property_map (defined in boost/property_map.hpp) as the property map for node_id. That map will not store any information. On Aug 27, 2007, at 11:31 PM, Sam Peterson wrote: the svn repository, then you can construct your dynamic_properties object with the argument '&boost::ignore_other_properties' and it will not complain about any properties. HTH, ron
On 8/27/07, Ronald Garcia
I'm not absolutely sure, but you might be able to pass along a boost::dummy_property_map (defined in boost/property_map.hpp) as the property map for node_id. That map will not store any information.
No dice: error: invalid use of void expression
If you don't care about any properties, and you are using Boost from the svn repository, then you can construct your dynamic_properties object with the argument '&boost::ignore_other_properties' and it will not complain about any properties.
I'm a little leary of trying the svn version, especially if there's undocumented changes to the library. What's your experience? -- Sam Peterson peabody@freeshell.org peabodyenator@gmail.com
On Aug 28, 2007, at 4:04 AM, Sam Peterson wrote:
On 8/27/07, Ronald Garcia
wrote: I'm not absolutely sure, but you might be able to pass along a boost::dummy_property_map (defined in boost/property_map.hpp) as the property map for node_id. That map will not store any information.
No dice: error: invalid use of void expression
If you don't care about any properties, and you are using Boost from the svn repository, then you can construct your dynamic_properties object with the argument '&boost::ignore_other_properties' and it will not complain about any properties.
I'm a little leary of trying the svn version, especially if there's undocumented changes to the library.
You could copy the definition of ignore_other_properties into your code (perhaps under a different name): std::auto_ptrboost::dynamic_property_map ignore_other_properties(const std::string&, const boost::any&, const boost::any&) { return std::auto_ptrboost::dynamic_property_map(0); } then pass this function to the dynamic_properties constructor: dynamic_properties dp(&ignore_other_properties); HTH, ron
participants (2)
-
Ronald Garcia
-
Sam Peterson