Jon Stewart on Tue, 12 Oct 2004 09:20:11 -0500 (CDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [ALACPP] gar!


> Hey! The list is working again. It's a miracle!


Yes. Joel (the admin) moved and SBC's billing dept. fucked him over.


> Here's a crazy thought... keep your structs/classes out of the graph. 
> Have a simple mapping from vertex or edge id's to your object that is 
> completely separate from the graph.


Yes. I got this working last night. I use the built-in vertex_index 
property map to get a unique ID that I then use the vertex_index as a key 
into a map of my own types.

I can see where the property maps work well for various graph algorithms, 
as the canonical pseudocode for the canonical algorithms use parallel 
arrays/maps, and you may have an algorithm that uses color, but not 
weight, and you want to use it in conjunction with an algorithm that uses 
weight, but not color. In such instances, it makes sense to define 
separate properties instead of vacillating between types.

But the primary, obvious strength of the STL is vector<T>, list<T>, 
deque<T>, set<T>, map<key, T> (are multisets and multimaps strengths? :-). 
You'd think the BGL would make it easier to let you define vertex<T> and 
edge<T>, or a moral equivalent, independent of the graph-algorithm-focused 
property maps. I don't like the unnecessary double indirection of the 
above solution.


Jon
-- 
Jon Stewart                                 Advanced Los Angeles C++
stew1@xxxxxxxxxxx                           http://www.alacpp.org
_______________________________________________
alacpp mailing list
alacpp@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/alacpp