Skip to content

Commit

Permalink
allow empyt neighborhood in random graph
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneslenfers committed Jan 11, 2024
1 parent a0b717e commit 0abb159
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 _ =>
Expand Down

0 comments on commit 0abb159

Please sign in to comment.