Added a color-based and a distance-based bfs.

The two BFS's could be merged and selected at run time.

Signed-off-by: Marcin Zalewski <marcin.zalewski@gmail.com>