Here is design of my graph data structure which i’ve developed from scratch. Now to implement BFS i am thinking to use some part of STL to levitate more burden.
I am using algorithm from Cormen’s book .For some portion of algorithms like
color[u] , distance[u] etc , i am thinking to use map. but i am unable to decided whether
i should use map like >> std::map<node<T>*, Node_struct_data_like_color_etc> or
std::map<data_type_which_node_contains, Node_struct_data_like_color_etc>
Also, Above map will have to fit with other part of algo like
for(all_adjacent_vertex_v_of_u) etc
I am sorry that my question might would look vague but couldn’t explain more better than this.
Once i was trying to do something similar. The mistake i did was i didn’t define the
function object to sort the elements of the
mapwhen i stored the pointer to the node as index type. So you should consider this when you design your BFS when keeping the color/other properties as value_type in the map with node pointers as the index type.so the map that you are planning to implement should look something like this