diff --git a/colomoto/minibn.py b/colomoto/minibn.py index 21526fd..c21e2ca 100644 --- a/colomoto/minibn.py +++ b/colomoto/minibn.py @@ -688,8 +688,9 @@ def stop_condition(x): while True: i += 1 nexts = list(self(x)) - if nexts: - x = random.choice(nexts) + if not nexts or (len(nexts) == 1 and nexts[0] == x): + return + x = random.choice(nexts) yield x if i == steps: break