diff --git a/src/main/scala/elevate/heuristic_search/heuristics/RandomGraph.scala b/src/main/scala/elevate/heuristic_search/heuristics/RandomGraph.scala index f3ce4c56..51f260e7 100644 --- a/src/main/scala/elevate/heuristic_search/heuristics/RandomGraph.scala +++ b/src/main/scala/elevate/heuristic_search/heuristics/RandomGraph.scala @@ -28,14 +28,12 @@ class RandomGraph[P] extends Heuristic[P] { // choose solution from neighborhood solution = Ns.size match { + case 0 => - // neighborhood emtpy -> stop search - println("empty neighborhood - this should not happen with bidirectional rules") - return ExplorationResult( - solution, - solutionValue, - None - ) + // empty neighborhood + // abort this try and reset + depthCounter = depth + solution // chose valid solution randomly from neighborhood case _ =>