Use BFS instead of DFS for cycle detections, as it needs less queries. -- towards BEP-0006


git-svn-id: https://svn.apache.org/repos/asf/bloodhound/trunk@1479827 13f79535-47bb-0310-9956-ffa450edef68