{"id":31917119,"url":"https://github.com/smartlegionlab/smart-tsp-solver","last_synced_at":"2025-10-13T20:25:33.707Z","repository":{"id":311256235,"uuid":"1043091683","full_name":"smartlegionlab/smart-tsp-solver","owner":"smartlegionlab","description":"A high-performance Python library for solving the Traveling Salesman Problem (TSP) using novel heuristics. Sometimes outperforms classical methods by **~25%** on real and clustered data by using spatial intelligence and adaptive strategies.","archived":false,"fork":false,"pushed_at":"2025-09-16T00:09:25.000Z","size":1442,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-24T23:19:27.764Z","etag":null,"topics":["smart-tsp-solver","smartlegionlab","tsp","tsp-problem","tsp-python","tsp-solver","tsp-solver-python"],"latest_commit_sha":null,"homepage":"https://smartlegionlab.github.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartlegionlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.md","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-23T05:54:55.000Z","updated_at":"2025-09-16T00:08:11.000Z","dependencies_parsed_at":"2025-08-24T10:55:13.975Z","dependency_job_id":"3eac7bcf-57f1-4b0f-94e7-8c238c07d8f1","html_url":"https://github.com/smartlegionlab/smart-tsp-solver","commit_stats":null,"previous_names":["smartlegionlab/smart-tsp-heuristics","smartlegionlab/smart-tsp-solver"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/smartlegionlab/smart-tsp-solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartlegionlab","download_url":"https://codeload.github.com/smartlegionlab/smart-tsp-solver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-solver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016960,"owners_count":26085907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["smart-tsp-solver","smartlegionlab","tsp","tsp-problem","tsp-python","tsp-solver","tsp-solver-python"],"created_at":"2025-10-13T20:25:31.868Z","updated_at":"2025-10-13T20:25:33.690Z","avatar_url":"https://github.com/smartlegionlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart TSP Solver \u003csup\u003ev1.0.0\u003c/sup\u003e\n\n---\n\nA high-performance Python library for solving the Traveling Salesman Problem (TSP) using novel heuristic approaches. \nFeatures advanced algorithms that outperform classical methods by **25%** on real-world \nclustered data while maintaining practical computational efficiency.\n\n---\n\n![GitHub top language](https://img.shields.io/github/languages/top/smartlegionlab/smart-tsp-solver)\n[![GitHub](https://img.shields.io/github/license/smartlegionlab/smart-tsp-solver)](https://github.com/smartlegionlab/smart-tsp-solver/blob/master/LICENSE)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/smartlegionlab/smart-tsp-solver)](https://github.com/smartlegionlab/smart-tsp-solver/)\n[![GitHub Repo stars](https://img.shields.io/github/stars/smartlegionlab/smart-tsp-solver?style=social)](https://github.com/smartlegionlab/smart-tsp-solver/)\n[![GitHub watchers](https://img.shields.io/github/watchers/smartlegionlab/smart-tsp-solver?style=social)](https://github.com/smartlegionlab/smart-tsp-solver/)\n[![GitHub forks](https://img.shields.io/github/forks/smartlegionlab/smart-tsp-solver?style=social)](https://github.com/smartlegionlab/smart-tsp-solver/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/smart-tsp-solver?label=pypi%20downloads)](https://pypi.org/project/smart-tsp-solver/)\n[![PyPI](https://img.shields.io/pypi/v/smart-tsp-solver)](https://pypi.org/project/smart-tsp-solver)\n[![PyPI - Format](https://img.shields.io/pypi/format/smart-tsp-solver)](https://pypi.org/project/smart-tsp-solver)\n\n[![PyPI Downloads](https://static.pepy.tech/badge/smart-tsp-solver)](https://pepy.tech/projects/smart-tsp-solver)\n[![PyPI Downloads](https://static.pepy.tech/badge/smart-tsp-solver/month)](https://pepy.tech/projects/smart-tsp-solver)\n[![PyPI Downloads](https://static.pepy.tech/badge/smart-tsp-solver/week)](https://pepy.tech/projects/smart-tsp-solver)\n\n---\n\n\u003e **Research-driven design:** This library implements cutting-edge spatial optimization \n\u003e techniques including **dynamic gravitational attraction modeling** and **angular-radial \n\u003e spatial indexing** for intelligent pathfinding.\n\n## 🚀 Features\n\n*   **🧠 Dynamic Gravity Algorithms:** Physics-inspired approach simulating momentum and gravitational attraction for natural, efficient routing\n*   **📊 Angular-Radial Methods:** Space-partitioning heuristics with adaptive look-ahead for superior performance on geographical data\n*   **⚡ Benchmarking Framework:** Professional-grade testing infrastructure with configurable scenarios and detailed metrics\n*   **🦾 High-Performance Core:** Numba JIT compilation with cache optimization for near-native execution speed\n\n## 🔬 Scientific Foundation\n\n---\n\n## 🧠 Algorithmic Innovations\n\nLibrary implements two advanced heuristic approaches, each tackling the classic speed-quality trade-off in a unique way.\n\n---\n\n### 🧲 Dynamic Gravity Approach\n\n**Complexity:** `O(n²)`\n\n**Concept:** This algorithm models a physical process of attraction, where the next point is selected based on a combination of proximity and current direction of movement. The `delta` parameter acts as an \"inertia coefficient,\" preventing sharp turns and creating smooth, natural-looking routes.\n\n| Strengths | Ideal Use Case |\n| :--- | :--- |\n| • Predictable execution time\u003cbr\u003e• Consistently high solution quality\u003cbr\u003e• Efficient cluster traversal | The balance of speed and quality, processing medium-sized datasets |\n\n---\n\n### 📐 Angular-Radial Method\n\n**Complexity:** `O(n²)` *with near O(n·log n) practical performance*\n\n**Concept:** A \"smart look-ahead\" strategy (`look_ahead`). Points are pre-sorted in a polar coordinate system, which drastically narrows the search space for each subsequent choice. This is equivalent to a navigator scanning the nearest sector on the horizon instead of re-examining the entire map every time.\n\n| Strengths | Ideal Use Case |\n| :--- | :--- |\n| • Best-in-class final route quality\u003cbr\u003e• Near-linear practical performance\u003cbr\u003e• Exceptional efficiency on clustered data | Offline calculations where route length is critical and tasks require scaling |\n\n---\n\n### Hierarchical TSP Solver\n\nA traveling salesman problem (TSP) solver using hierarchical decomposition and metaheuristics.\n\n## 🧠 Algorithm Overview\n\n### Core Philosophy: Divide-and-Conquer with Geometric Intelligence\n\nThe solver employs a multi-level hierarchical approach that mirrors \nhuman problem-solving strategies for large-scale routing:\n\n1. **Spatial Decomposition**: Recursively partition the problem into manageable clusters\n2. **Local Optimization**: Solve subproblems optimally within each cluster\n3. **Global Integration**: Intelligently combine local solutions into a global route\n4. **Refinement**: Apply local search to polish the final solution\n\n---\n\n### Performance Comparison\n\n| Algorithm | Complexity | Quality | Speed | Primary Use Case |\n| :--- | :--- | :--- | :--- | :--- |\n| **Greedy v2** | `O(n²)` | ███░░ | █████ | Real-time, microseconds |\n| **Dynamic-gravity v2** | `O(n²)` | █████ | ████░ | Balanced, milliseconds |\n| **Angular-radial v2** | `O(n²)`* | █████ | ███░░ | Quality, offline |\n\n*Practical performance approaches O(n·log n) due to spatial heuristics.*\n*Worst-case complexity. Practical performance is near O(n·log n) due to spatial heuristics\n\n---\n\n### Benchmarking Methodology\n\nAll algorithms are compared against a **highly optimized greedy implementation** featuring:\n- Numba JIT compilation with `fastmath` and caching\n- Euclidean distance optimization with squared distance comparisons\n- Memory-efficient visited node tracking\n- Reproducible results through seed-based initialization\n\nThis ensures fair comparison against a professionally implemented baseline rather than naive reference implementations.\n\n## 📦 Installation\n\n### Install\n\n```bash\npip install smart-tsp-solver\n```\n\n### Example\n\n### Launch using [Smart TSP Benchmark](https://github.com/smartlegionlab/smart-tsp-benchmark)\n\n`pip install smart-tsp-benchmark`\n\n```python\nfrom smart_tsp_benchmark.tsp_benchmark import TSPBenchmark, AlgorithmConfig\n\nfrom smart_tsp_solver import hierarchical_tsp_solver_v2\nfrom smart_tsp_solver.algorithms.angular_radial.v1 import angular_radial_tsp_v1\nfrom smart_tsp_solver.algorithms.angular_radial.v2 import angular_radial_tsp_v2\nfrom smart_tsp_solver.algorithms.dynamic_gravity.v1 import dynamic_gravity_tsp_v1\nfrom smart_tsp_solver.algorithms.dynamic_gravity.v2 import dynamic_gravity_tsp_v2\nfrom smart_tsp_solver.algorithms.other.greedy.v2 import greedy_tsp_v2\n\n\ndef main():\n    config = {\n        'n_points': 1000,\n        'seed': 123,\n        'point_generation': 'cluster',\n        'use_post_optimization': False,\n        'plot_results': True,\n        'verbose': True\n    }\n    benchmark = TSPBenchmark(config=config)\n    benchmark.add_algorithm(\n        name='Angular-radial v1',\n        config=AlgorithmConfig(\n            function=angular_radial_tsp_v1,\n            params={\n                \"sort_by\": \"angle_distance\",\n                \"look_ahead\": 100,\n                \"max_2opt_iter\": 100\n            },\n            post_optimize=True,\n            description=\"Angular-radial v1\",\n            is_class=False\n        )\n    )\n    benchmark.add_algorithm(\n        name='Angular-radial v2',\n        config=AlgorithmConfig(\n            function=angular_radial_tsp_v2,\n            params={\n                \"sort_by\": \"angle_distance\",\n                \"look_ahead\": 100,\n                \"max_2opt_iter\": 100\n            },\n            post_optimize=True,\n            description=\"Angular-radial v2\",\n            is_class=False\n        )\n    )\n    benchmark.add_algorithm(\n        name='Dynamic-gravity v1',\n        config=AlgorithmConfig(\n            function=dynamic_gravity_tsp_v1,\n            params={\n                \"delta\": 0.5,\n                \"fast_2opt_iter\": 100\n            },\n            post_optimize=True,\n            description=\"Dynamic-gravity v1\",\n            is_class=False\n        )\n    )\n    benchmark.add_algorithm(\n        name='Dynamic-gravity v2',\n        config=AlgorithmConfig(\n            function=dynamic_gravity_tsp_v2,\n            params={\n                \"delta\": 0.5,\n                \"fast_2opt_iter\": 100\n            },\n            post_optimize=True,\n            description=\"Dynamic-gravity v2\",\n            is_class=False\n        )\n    )\n    benchmark.add_algorithm(\n        name='Greedy v2',\n        config=AlgorithmConfig(\n            function=greedy_tsp_v2,\n            params={},\n            post_optimize=False,\n            description=\"Classic greedy TSP algorithm\",\n            is_class=False,\n        )\n    )\n    benchmark.add_algorithm(\n        name='Hierarchical TSP',\n        config=AlgorithmConfig(\n            function=hierarchical_tsp_solver_v2,\n            params={\n                \"cluster_size\": 100,\n                \"post_optimize\": True\n            },\n            post_optimize=False,\n            description=\"Hierarchical clustering TSP solver\",\n            is_class=False\n        )\n    )\n    benchmark.run_benchmark()\n\n\nif __name__ == '__main__':\n    main()\n\n```\n\n\n### 🚀 Example\n\n```bash\ngit clone https://github.com/smartlegionlab/smart-tsp-solver.git\ncd smart-tsp-solver\npython -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\npython main.py\n```\n\n## 📊 Comprehensive Performance Analysis\n\n### Experimental Results\n\n### 📊 Smart TSP Algorithms Benchmark Report\n\nOur comprehensive benchmarking reveals a clear performance-quality tradeoff across different problem scales, highlighting the strengths of each algorithm.\n\n#### 🔵 Dataset: 100 Points (Random Distribution)\n\n**Key Insight:** For small-scale problems, the **Dynamic-gravity v2** algorithm demonstrates the best balance, achieving near-optimal path quality while maintaining near-real-time performance.\n\n| Algorithm | Time (s) | Δ vs Best | Route Length | Δ vs Best | Parameters |\n| :--- | :--- | :--- | :--- | :--- | :--- |\n| Greedy v2 | **0.0015** | **BASELINE** | 1026.37 | +20.66% | `start_point=0` |\n| Dynamic-gravity v1 | 0.0071 | +367% | 850.86 | +0.03% | `delta=0.5` |\n| **Dynamic-gravity v2** | 0.0071 | +367% | 856.14 | +0.65% | `delta=0.5` |\n| Angular-radial v2 | 0.0086 | +469% | **850.62** | **BASELINE** | `look_ahead=100` |\n| Angular-radial v1 | 0.0812 | +5243% | **850.62** | **BASELINE** | `look_ahead=100` |\n\n#### 🔴 Dataset: 1001 Points (Large Random Distribution)\n\n**Key Insight:** For large-scale problems, **Angular-radial v2** becomes the undisputed leader in solution quality (providing a **17.3%** shorter route than the Greedy algorithm). Its acceptable processing time makes it ideal for quality-sensitive offline applications.\n\n| Algorithm | Time (s) | Δ vs Best | Route Length | Δ vs Best | Parameters |\n| :--- | :--- | :--- | :--- | :--- | :--- |\n| Greedy v2 | **0.0023** | **BASELINE** | 2985.82 | +17.31% | `start_point=0` |\n| Dynamic-gravity v2 | 0.0186 | +696% | 2726.36 | +7.12% | `delta=0.5` |\n| Dynamic-gravity v1 | 0.0321 | +1269% | 2837.78 | +11.50% | `delta=0.5` |\n| **Angular-radial v2** | 0.1346 | +5647% | **2545.21** | **BASELINE** | `look_ahead=1001` |\n| Angular-radial v1 | 0.2555 | +10809% | **2545.21** | **BASELINE** | `look_ahead=1001` |\n\n### 🎯 Key Insights \u0026 Analysis\n\n1.  **Algorithm Evolution (v1 vs. v2):**\n    *   **Angular-radial v2** shows a **~2x speedup** over v1 while delivering identical, best-in-class route quality.\n    *   **Dynamic-gravity v2** also demonstrates a significant speed improvement (nearly 2x on 1001 points) over v1, maintaining consistently high solution quality with better stability.\n\n2.  **Algorithm Characteristics:**\n    *   **Greedy v2:** Extremely fast (`O(n²)`), ideal for real-time applications, but sacrifices solution quality (+17-20% longer routes).\n    *   **Dynamic-gravity:** Offers significantly better quality than the greedy approach. It has `O(n²)` complexity with higher constant factors, making it the optimal choice for medium-sized problems where a balance between speed and quality is required.\n    *   **Angular-radial:** The quality leader. Its use of spatial partitioning (`O(n log n)`) allows it to scale best on large datasets. It is the recommended choice for offline processing where final route cost is the primary concern.\n\n3.  **Practical Recommendations:**\n    The library provides a continuum of solutions for different use cases:\n    *   **Microsecond Response:** **Greedy v2** for interactive and real-time systems.\n    *   **Millisecond Response:** **Dynamic-gravity v2** for balanced needs and medium-scale problems.\n    *   **Best Quality:** **Angular-radial v2** for final calculations and offline processing where route cost is paramount.\n\n## 🎨 Advanced Visualization\n\n![LOGO](https://github.com/smartlegionlab/smart-tsp-solver/raw/master/data/images/tsp100.png)\n![LOGO](https://github.com/smartlegionlab/smart-tsp-solver/raw/master/data/images/tsp1001.png)\n![LOGO](https://github.com/smartlegionlab/smart-tsp-solver/raw/master/data/images/tsp_25_08_25.png)\n*Visual analysis showing Angular-radial's optimal sector-based routing, Dynamic-gravity's smooth trajectories, Greedy's suboptimal clustering*\n\n## 🏗️ Architecture \u0026 Implementation\n\n### Performance Optimization\n\n- **Numba JIT Compilation:** Critical paths compiled to native code\n- **Memory Efficiency:** Pre-allocated arrays and minimal copying\n- **Cache Optimization:** Intelligent memoization and reuse\n- **Vectorized Operations:** NumPy-based efficient computations\n\n---\n\n## 👨‍💻 Author\n\n**Alexander Suvorov**\n\n- Researcher specializing in computational optimization and high-performance algorithms\n- Focused on bridging theoretical computer science with practical engineering applications\n- This project represents extensive research into spatial optimization techniques\n\n*Explore other projects on [GitHub](https://github.com/smartlegionlab).*\n\n## 🔗 Related Research\n\nFor those interested in the theoretical foundations:\n\n- **Exact TSP Solutions (TSP ORACLE):** [exact-tsp-solver](https://github.com/smartlegionlab/exact-tsp-solver) - Optimal solutions for small instances\n- **Smart TSP Benchmark** - [Smart TSP Benchmark](https://github.com/smartlegionlab/smart-tsp-benchmark)  is a professional algorithm testing infrastructure with customizable scenarios and detailed metrics.\n- **Spatial Optimization:** Computational geometry approaches for large-scale problems\n- **Heuristic Analysis:** Comparative study of modern TSP approaches\n\n\n---\n\n## 📜 License \u0026 Disclaimer\n\nBSD 3-Clause License\n\nCopyright (c) 2025, Alexander Suvorov\n\n    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n---\n\n## 📊 Sample Output\n\n```\n==================================================\n          SMART TSP ALGORITHMS BENCHMARK          \n==================================================\nPoints:           100\nSeed:           123\nGeneration:     cluster\nPost-opt:       OFF\nAlgorithms:    \n  - Angular-radial v1: \n  - Angular-radial v2: \n  - Dynamic-gravity v1: \n  - Dynamic-gravity v2: \n  - Greedy v2: \n  - Hierarchical TSP: \n==================================================\n\n\n==================================================\nRunning Angular-radial v1 algorithm...\nDescription: Angular-radial v1\nCompleted in 0.0848 seconds\nRoute length: 553.66\n==================================================\n\n==================================================\nRunning Angular-radial v2 algorithm...\nDescription: Angular-radial v2\nCompleted in 0.0082 seconds\nRoute length: 553.66\n==================================================\n\n==================================================\nRunning Dynamic-gravity v1 algorithm...\nDescription: Dynamic-gravity v1\nCompleted in 0.0070 seconds\nRoute length: 567.00\n==================================================\n\n==================================================\nRunning Dynamic-gravity v2 algorithm...\nDescription: Dynamic-gravity v2\nCompleted in 0.0067 seconds\nRoute length: 534.90\n==================================================\n\n==================================================\nRunning Greedy v2 algorithm...\nDescription: Classic greedy TSP algorithm\nCompleted in 0.0016 seconds\nRoute length: 609.21\n==================================================\n\n==================================================\nRunning Hierarchical TSP algorithm...\nDescription: Hierarchical clustering TSP solver\nCompleted in 0.0343 seconds\nRoute length: 524.25\n==================================================\n\n============================================================================================================================\n                                               DETAILED ALGORITHM COMPARISON                                                \n============================================================================================================================\nAlgorithm            | Time (s) |  vs Best  | Length | vs Best | Params                                                     \n----------------------------------------------------------------------------------------------------------------------------\nGreedy v2            | 0.0016 | BEST | 609.21 | +16.21% |                                                            \nDynamic-gravity v2   | 0.0067 | +332.71%  | 534.90 | +2.03%  | delta=0.5, fast_2opt_iter=100                              \nDynamic-gravity v1   | 0.0070 | +349.52%  | 567.00 | +8.15%  | delta=0.5, fast_2opt_iter=100                              \nAngular-radial v2    | 0.0082 | +430.93%  | 553.66 | +5.61%  | sort_by=angle_distance, look_ahead=100, max_2opt_iter=100  \nHierarchical TSP     | 0.0343 | +2110.90% | 524.25 | BEST | cluster_size=100, post_optimize=True                       \nAngular-radial v1    | 0.0848 | +5361.28% | 553.66 | +5.61%  | sort_by=angle_distance, look_ahead=100, max_2opt_iter=100  \n============================================================================================================================\n\nPERFORMANCE ANALYSIS:\n- Fastest algorithm(s): Greedy v2 (0.0016 sec)\n- Shortest route(s): Hierarchical TSP (524.25 units)\n```\n\n```\n==================================================\n          SMART TSP ALGORITHMS BENCHMARK          \n==================================================\nPoints:           50\nSeed:           123\nGeneration:     random\nPost-opt:       OFF\nAlgorithms:    \n  - Angular-radial v1: \n  - Angular-radial v2: \n  - Dynamic-gravity v1: \n  - Dynamic-gravity v2: \n  - Greedy v2: \n==================================================\n\n\n==================================================\nRunning Angular-radial v1 algorithm...\nDescription: Angular-radial v1\nParameters: \nCompleted in 0.0798 seconds\nRoute length: 658.16\n==================================================\n\n==================================================\nRunning Angular-radial v2 algorithm...\nDescription: Angular-radial v2\nParameters: \nCompleted in 0.0082 seconds\nRoute length: 658.16\n==================================================\n\n==================================================\nRunning Dynamic-gravity v1 algorithm...\nDescription: Dynamic-gravity v1\nParameters: \nCompleted in 0.0067 seconds\nRoute length: 582.13\n==================================================\n\n==================================================\nRunning Dynamic-gravity v2 algorithm...\nDescription: Dynamic-gravity v2\nParameters: \nCompleted in 0.0065 seconds\nRoute length: 577.06\n==================================================\n\n==================================================\nRunning Greedy v2 algorithm...\nDescription: Classic greedy TSP algorithm\nParameters: \nCompleted in 0.0016 seconds\nRoute length: 720.50\n==================================================\n\n============================================================================================================================\n                                               DETAILED ALGORITHM COMPARISON                                                \n============================================================================================================================\nAlgorithm            | Time (s) |  vs Best  | Length | vs Best | Params                                                     \n----------------------------------------------------------------------------------------------------------------------------\nGreedy v2            | 0.0016 | BEST | 720.50 | +24.86% |                                                            \nDynamic-gravity v2   | 0.0065 | +321.25%  | 577.06 | BEST | delta=0.5, fast_2opt_iter=100                              \nDynamic-gravity v1   | 0.0067 | +328.66%  | 582.13 | +0.88%  | delta=0.5, fast_2opt_iter=100                              \nAngular-radial v2    | 0.0082 | +426.35%  | 658.16 | +14.05% | sort_by=angle_distance, look_ahead=100, max_2opt_iter=100  \nAngular-radial v1    | 0.0798 | +5035.05% | 658.16 | +14.05% | sort_by=angle_distance, look_ahead=100, max_2opt_iter=100  \n============================================================================================================================\n\nPERFORMANCE ANALYSIS:\n- Fastest algorithm(s): Greedy v2 (0.0016 sec)\n- Shortest route(s): Dynamic-gravity v2 (577.06 units)\n```\n\n```\n==================================================\n          SMART TSP ALGORITHMS BENCHMARK          \n==================================================\nPoints:           50\nSeed:           123\nGeneration:     cluster\nPost-opt:       OFF\nAlgorithms:    \n  - Angular-radial v1: \n  - Angular-radial v2: \n  - Dynamic-gravity v1: \n  - Dynamic-gravity v2: \n  - Greedy v2: \n==================================================\n\n\n==================================================\nRunning Angular-radial v1 algorithm...\nDescription: Angular-radial v1\nParameters: \nCompleted in 0.0798 seconds\nRoute length: 519.29\n==================================================\n\n==================================================\nRunning Angular-radial v2 algorithm...\nDescription: Angular-radial v2\nParameters: \nCompleted in 0.0081 seconds\nRoute length: 519.29\n==================================================\n\n==================================================\nRunning Dynamic-gravity v1 algorithm...\nDescription: Dynamic-gravity v1\nParameters: \nCompleted in 0.0066 seconds\nRoute length: 495.87\n==================================================\n\n==================================================\nRunning Dynamic-gravity v2 algorithm...\nDescription: Dynamic-gravity v2\nParameters: \nCompleted in 0.0066 seconds\nRoute length: 495.87\n==================================================\n\n==================================================\nRunning Greedy v2 algorithm...\nDescription: Classic greedy TSP algorithm\nParameters: \nCompleted in 0.0015 seconds\nRoute length: 621.53\n==================================================\n\n============================================================================================================================\n                                               DETAILED ALGORITHM COMPARISON                                                \n============================================================================================================================\nAlgorithm            | Time (s) |  vs Best  | Length | vs Best | Params                                                     \n----------------------------------------------------------------------------------------------------------------------------\nGreedy v2            | 0.0015 | BEST | 621.53 | +25.34% |                                                            \nDynamic-gravity v2   | 0.0066 | +331.67%  | 495.87 | BEST | delta=0.5, fast_2opt_iter=100                              \nDynamic-gravity v1   | 0.0066 | +333.80%  | 495.87 | BEST | delta=0.5, fast_2opt_iter=100                              \nAngular-radial v2    | 0.0081 | +431.08%  | 519.29 | +4.72%  | sort_by=angle_distance, look_ahead=100, max_2opt_iter=100  \nAngular-radial v1    | 0.0798 | +5150.37% | 519.29 | +4.72%  | sort_by=angle_distance, look_ahead=100, max_2opt_iter=100  \n============================================================================================================================\n\nPERFORMANCE ANALYSIS:\n- Fastest algorithm(s): Greedy v2 (0.0015 sec)\n- Shortest route(s): Dynamic-gravity v1, Dynamic-gravity v2 (495.87 units)\n```\n\n```\n==================================================\n          SMART TSP ALGORITHMS BENCHMARK          \n==================================================\nPoints:           100\nSeed:           123\nGeneration:     random\nPost-opt:       OFF\nAlgorithms:    \n  - Angular-radial v1: \n  - Angular-radial v2: \n  - Dynamic-gravity v1: \n  - Dynamic-gravity v2: \n  - Greedy v2: \n==================================================\n\n\n==================================================\nRunning Angular-radial v1 algorithm...\nDescription: Angular-radial v1\nParameters: \nCompleted in 0.0812 seconds\nRoute length: 850.62\n==================================================\n\n==================================================\nRunning Angular-radial v2 algorithm...\nDescription: Angular-radial v2\nParameters: \nCompleted in 0.0086 seconds\nRoute length: 850.62\n==================================================\n\n==================================================\nRunning Dynamic-gravity v1 algorithm...\nDescription: Dynamic-gravity v1\nParameters: \nCompleted in 0.0071 seconds\nRoute length: 850.86\n==================================================\n\n==================================================\nRunning Dynamic-gravity v2 algorithm...\nDescription: Dynamic-gravity v2\nParameters: \nCompleted in 0.0071 seconds\nRoute length: 856.14\n==================================================\n\n==================================================\nRunning Greedy v2 algorithm...\nDescription: Classic greedy TSP algorithm\nParameters: \nCompleted in 0.0015 seconds\nRoute length: 1026.37\n==================================================\n\n=============================================================================================================================\n                                                DETAILED ALGORITHM COMPARISON                                                \n=============================================================================================================================\nAlgorithm            | Time (s) |  vs Best  |  Length | vs Best | Params                                                     \n-----------------------------------------------------------------------------------------------------------------------------\nGreedy v2            | 0.0015 | BEST | 1026.37 | +20.66% |                                                            \nDynamic-gravity v1   | 0.0071 | +367.32%  |  850.86 | +0.03%  | delta=0.5, fast_2opt_iter=100                              \nDynamic-gravity v2   | 0.0071 | +367.38%  |  856.14 | +0.65%  | delta=0.5, fast_2opt_iter=100                              \nAngular-radial v2    | 0.0086 | +468.54%  | 850.62 | BEST | sort_by=angle_distance, look_ahead=100, max_2opt_iter=100  \nAngular-radial v1    | 0.0812 | +5243.04% | 850.62 | BEST | sort_by=angle_distance, look_ahead=100, max_2opt_iter=100  \n=============================================================================================================================\n\nPERFORMANCE ANALYSIS:\n- Fastest algorithm(s): Greedy v2 (0.0015 sec)\n- Shortest route(s): Angular-radial v1, Angular-radial v2 (850.62 units)\n```\n\n```\n==================================================\n          SMART TSP ALGORITHMS BENCHMARK          \n==================================================\nPoints:           1001\nSeed:           123\nGeneration:     random\nPost-opt:       OFF\nAlgorithms:    \n  - Angular-radial v1: \n  - Angular-radial v2: \n  - Dynamic-gravity v1: \n  - Dynamic-gravity v2: \n  - Greedy v2: \n==================================================\n\n\n==================================================\nRunning Angular-radial v1 algorithm...\nDescription: Angular-radial v1\nParameters: \nCompleted in 0.2555 seconds\nRoute length: 2545.21\n==================================================\n\n==================================================\nRunning Angular-radial v2 algorithm...\nDescription: Angular-radial v2\nParameters: \nCompleted in 0.1346 seconds\nRoute length: 2545.21\n==================================================\n\n==================================================\nRunning Dynamic-gravity v1 algorithm...\nDescription: Dynamic-gravity v1\nParameters: \nCompleted in 0.0321 seconds\nRoute length: 2837.78\n==================================================\n\n==================================================\nRunning Dynamic-gravity v2 algorithm...\nDescription: Dynamic-gravity v2\nParameters: \nCompleted in 0.0186 seconds\nRoute length: 2726.36\n==================================================\n\n==================================================\nRunning Greedy v2 algorithm...\nDescription: Classic greedy TSP algorithm\nParameters: \nCompleted in 0.0023 seconds\nRoute length: 2985.82\n==================================================\n\n================================================================================================================================\n                                                 DETAILED ALGORITHM COMPARISON                                                  \n================================================================================================================================\nAlgorithm            | Time (s) |  vs Best   |  Length | vs Best | Params                                                       \n--------------------------------------------------------------------------------------------------------------------------------\nGreedy v2            | 0.0023 | BEST | 2985.82 | +17.31% |                                                              \nDynamic-gravity v2   | 0.0186 |  +695.63%  | 2726.36 | +7.12%  | delta=0.5, fast_2opt_iter=1001                               \nDynamic-gravity v1   | 0.0321 | +1269.12%  | 2837.78 | +11.50% | delta=0.5, fast_2opt_iter=1001                               \nAngular-radial v2    | 0.1346 | +5646.96%  | 2545.21 | BEST | sort_by=angle_distance, look_ahead=1001, max_2opt_iter=1001  \nAngular-radial v1    | 0.2555 | +10808.60% | 2545.21 | BEST | sort_by=angle_distance, look_ahead=1001, max_2opt_iter=1001  \n================================================================================================================================\n\nPERFORMANCE ANALYSIS:\n- Fastest algorithm(s): Greedy v2 (0.0023 sec)\n- Shortest route(s): Angular-radial v1, Angular-radial v2 (2545.21 units)\n```\n\n---\n\n**Disclaimer:** Performance results shown are for clustered/random distributions. \nResults may vary based on spatial characteristics. \nAlways evaluate algorithms on your specific problem domains.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartlegionlab%2Fsmart-tsp-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartlegionlab%2Fsmart-tsp-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartlegionlab%2Fsmart-tsp-solver/lists"}