On Mon, 24 Mar 2003, Martin Okrslar wrote:
Thanks a lot for your help!
But (just in order to learn more about my beloved BGL):
The connected components algorithm uses a color map for internal storage. If you don't supply a color map, it tries to build a default color map using the vertex index property. That's where this is failing: when the vertex list type is listS, there is no default vertex_index property, so the code fails.
Is there any way I could have known that from the documentation? I mean, this is by no means an accusation, but I'd just like to be able to learn to work through the BGL without having to anoy the list with lots of question. I still think that I missed something.
It's there, but it's not obvious. Under the "named parameters" section there is a UTIL parameter called color map. UTIL parameters are neither input nor output, but are needed for the algorithm to execute. The default for color_map is an iterator_property_map that uses the IN parameter vertex_index_map. The default for vertex_index_map is get(vertex_index, g), which returns an invalid property map for your graph. Not obvious at all :) Doug