bfs_all modules for graph and digraph modified.

Bugs have been fixed.