Hello,

First of all, I am new to Boost Graph Library. So, there might be a simpler or easier fix to the problem I am facing.

I am trying to get the edge color after executing the boost::depth_first_search algorithm on the graph. For that, I created an edge color map and passed it to the function. Also, to log the colors of the edges, I made a visitor class, passed the color of the edge to it, and printed it to the standard output stream, for the tree_edge, back_edge, etc. But, for every edge, the value of color comes out to be 0. So, I am not able to get the color of every edge.

A small snippet of how I am calling the depth_first_search function:

depth_first_search(graph,
                  visitor(dfs_visitor(root, visited_order, colors, graph))
                  .edge_color_map(&colors)
                  .root_vertex(root));

The complete code along with the visitor class can be found here: https://gist.github.com/krashish8/5f8d8e613e189857bd2b0fd46dd02b29

Please suggest any possible solution to this problem.

Thank you,
Ashish Kumar.