R: fix multiple root vertices in graph.bfs (#575).