]> Skullheadx's Git Forge - The-Traveling-Salesman-Problem.git/commitdiff
direct to points
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Tue, 10 Jan 2023 13:32:31 +0000 (08:32 -0500)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Tue, 10 Jan 2023 13:32:31 +0000 (08:32 -0500)
graph.py

index 3648c9b10f37b01e70bfe17a78159b83b347e0bd..2d9a7a3a3087a22fdb8137b4f6f1393983c85215 100644 (file)
--- a/graph.py
+++ b/graph.py
@@ -220,3 +220,12 @@ def linker(points):
             break
 
     return direct
+
+
+def delinker(route: list) -> list:
+    output = []
+
+    for i in range(len(route)):
+        output.append((route[i], route[(i + 1) % len(route)]))
+
+    return output