summaryrefslogtreecommitdiff
path: root/tsp.py
diff options
context:
space:
mode:
Diffstat (limited to 'tsp.py')
-rwxr-xr-xtsp.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tsp.py b/tsp.py
index 5b7d7fc..5eb81d4 100755
--- a/tsp.py
+++ b/tsp.py
@@ -189,6 +189,11 @@ class Context:
best = path
return best
+ def random_path (self):
+ path = range (0, self.count)
+ random.shuffle (path)
+ return Path (self, path)
+
class Algo:
context = None