
On Wed, 8 Sep 2010, fabien.castan@free.fr wrote:
Hi,
We can't use the easiest syntax of dfs, if we use another container than vecS as VertexList container. boost::depth_first_search( graph, boost::visitor( vis ) ); So the only way is to initialize the colormap ourself and give it to the depth_first_search function.
The problem is that the dfs use operator[]. I looked at the code and if I understand correctly, it seems that this operator is only use to init the colormap.
Does DFS itself use operator[]? I do not see that in the code. If your graph has a vertex_index_map property map (filled in appropriately), the algorithm should create the color map automatically from that. You can also just create your own color map and have it as a named argument to depth_first_search (that is simpler syntax than needing to write out all of the positional arguments). -- Jeremiah Willcock