Added BFS method and GraphViz compatibility