graph-v2
graph-v2 copied to clipboard
BFS: do not use a three-state map of visited vertices
Currently, the breadth-first search stores a vector colors_ of a three-state (8-bit) three_colors enum. The implementation never distinguishes between the black and the gray state. This can be changed to only black-white scheme, and this way you can use one bit per vertex, and a type such us vector<bool>.