{"id":31917121,"url":"https://github.com/smartlegionlab/smart-tsp-benchmark","last_synced_at":"2025-10-13T20:25:34.525Z","repository":{"id":311289667,"uuid":"1043435999","full_name":"smartlegionlab/smart-tsp-benchmark","owner":"smartlegionlab","description":"Benchmarking Framework - Professional-grade testing infrastructure with configurable scenarios and detailed metrics","archived":false,"fork":false,"pushed_at":"2025-09-14T02:54:51.000Z","size":561,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-14T04:23:32.937Z","etag":null,"topics":["python-tsp","python-tsp-benchmark","smart-tsp-benchmark","smartlegionlab","tsp","tsp-benchmark","tsp-problem","tsp-solver","tsp-solver-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","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}},"created_at":"2025-08-23T21:09:23.000Z","updated_at":"2025-09-14T02:54:54.000Z","dependencies_parsed_at":"2025-08-24T02:08:05.230Z","dependency_job_id":null,"html_url":"https://github.com/smartlegionlab/smart-tsp-benchmark","commit_stats":null,"previous_names":["smartlegionlab/smart-tsp-benchmark"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/smartlegionlab/smart-tsp-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartlegionlab","download_url":"https://codeload.github.com/smartlegionlab/smart-tsp-benchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-benchmark/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":["python-tsp","python-tsp-benchmark","smart-tsp-benchmark","smartlegionlab","tsp","tsp-benchmark","tsp-problem","tsp-solver","tsp-solver-python"],"created_at":"2025-10-13T20:25:32.811Z","updated_at":"2025-10-13T20:25:34.518Z","avatar_url":"https://github.com/smartlegionlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart TSP Benchmark \u003csup\u003ev1.0.0\u003c/sup\u003e\n\n---\n\n⚡ Smart TSP Benchmark is a professional algorithm testing infrastructure with customizable scenarios and detailed metrics.\n\n---\n\n![GitHub top language](https://img.shields.io/github/languages/top/smartlegionlab/smart-tsp-benchmark)\n[![GitHub](https://img.shields.io/github/license/smartlegionlab/smart-tsp-benchmark)](https://github.com/smartlegionlab/smart-tsp-benchmark/blob/master/LICENSE)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/smartlegionlab/smart-tsp-benchmark)](https://github.com/smartlegionlab/smart-tsp-benchmark/)\n[![GitHub Repo stars](https://img.shields.io/github/stars/smartlegionlab/smart-tsp-benchmark?style=social)](https://github.com/smartlegionlab/smart-tsp-benchmark/)\n[![GitHub watchers](https://img.shields.io/github/watchers/smartlegionlab/smart-tsp-benchmark?style=social)](https://github.com/smartlegionlab/smart-tsp-benchmark/)\n[![GitHub forks](https://img.shields.io/github/forks/smartlegionlab/smart-tsp-benchmark?style=social)](https://github.com/smartlegionlab/smart-tsp-benchmark/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/smart-tsp-benchmark?label=pypi%20downloads)](https://pypi.org/project/smart-tsp-benchmark/)\n[![PyPI](https://img.shields.io/pypi/v/smart-tsp-benchmark)](https://pypi.org/project/smart-tsp-benchmark)\n[![PyPI - Format](https://img.shields.io/pypi/format/smart-tsp-benchmark)](https://pypi.org/project/smart-tsp-benchmark)\n\n[![PyPI Downloads](https://static.pepy.tech/badge/smart-tsp-benchmark)](https://pepy.tech/projects/smart-tsp-benchmark)\n[![PyPI Downloads](https://static.pepy.tech/badge/smart-tsp-benchmark/month)](https://pepy.tech/projects/smart-tsp-benchmark)\n[![PyPI Downloads](https://static.pepy.tech/badge/smart-tsp-benchmark/week)](https://pepy.tech/projects/smart-tsp-benchmark)\n\n---\n\n### Install\n\n```bash\npip install smart-tsp-solver\n```\n\n### Example\n\n### Launch using [Smart TSP Solver](https://github.com/smartlegionlab/smart-tsp-solver)\n\n`pip install smart-tsp-solver`\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': 100,\n        'seed': 123,\n        'point_generation': 'random',\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**An example of testing TSP algorithms** [here](https://github.com/smartlegionlab/smart-tsp-solver)\n\n## 👨‍💻 Author\n\n**A.A. 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## 📜 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### ⚠️ Important Disclaimer\n\n\u003e **THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.**\n\u003e\n\u003e *(This is a summary of the full disclaimer, which is legally binding and located in sections 15 and 16 of the AGPLv3 license).*\n\nFor commercial use that is not compatible with the AGPLv3 terms (e.g., including this software in a proprietary product without disclosing the source code), a **commercial license** is required. Please contact me at [smartlegiondev@gmail.com](mailto:smartlegiondev@gmail.com) to discuss terms.\n\n## 🔗 Related Research\n\nFor those interested in the theoretical foundations:\n\n- **[smart-tsp-solver](https://github.com/smartlegionlab/smart-tsp-solver)** - My Python library featuring advanced heuristics (`Dynamic Gravity`, `Angular Radial`) for solving *large* TSP instances where finding the exact optimum is impractical.\n- **Exact TSP Solutions (TSP ORACLE):** [exact-tsp-solver](https://github.com/smartlegionlab/exact-tsp-solver) - Optimal solutions for small instances\n- **Spatial Optimization:** Computational geometry approaches for large-scale problems\n- **Heuristic Analysis:** Comparative study of modern TSP approaches\n\n## 🎨 Advanced Visualization\n\n![LOGO](https://github.com/smartlegionlab/smart-tsp-benchmark/raw/master/data/images/tsp100.png)\n![LOGO](https://github.com/smartlegionlab/smart-tsp-benchmark/raw/master/data/images/tsp1001.png)\n*Visual analysis showing Angular-radial's optimal sector-based routing, Dynamic-gravity's smooth trajectories, Greedy's suboptimal clustering*\n\n---\n\n## 📊 Sample Output\n\n```\n==================================================\n          SMART TSP ALGORITHMS BENCHMARK          \n==================================================\nCities:         100\nSeed:           123\nGeneration:     cluster\nPost-opt:       OFF\nAlgorithms:    \n  - Angular-radial v1: sort_by=angle_distance, look_ahead=1001, max_2opt_iter=1001\n  - Angular-radial v2: sort_by=angle_distance, look_ahead=1000, max_2opt_iter=1001\n  - Dynamic-gravity v1: delta=0.5, fast_2opt_iter=1001\n  - Dynamic-gravity v2: delta=0.5, fast_2opt_iter=1001\n  - Greedy v2: start_point=0\n==================================================\n\n\n==================================================\nRunning Angular-radial v1 algorithm...\nDescription: Angular-radial v1\nParameters: sort_by=angle_distance, look_ahead=1001, max_2opt_iter=1001\nCompleted in 0.0842 seconds\nRoute length: 553.66\n==================================================\n\n==================================================\nRunning Angular-radial v2 algorithm...\nDescription: Angular-radial v2\nParameters: sort_by=angle_distance, look_ahead=1000, max_2opt_iter=1001\nCompleted in 0.0088 seconds\nRoute length: 553.66\n==================================================\n\n==================================================\nRunning Dynamic-gravity v1 algorithm...\nDescription: Dynamic gravity v1\nParameters: delta=0.5, fast_2opt_iter=1001\nCompleted in 0.0075 seconds\nRoute length: 567.00\n==================================================\n\n==================================================\nRunning Dynamic-gravity v2 algorithm...\nDescription: Dynamic gravity v2\nParameters: delta=0.5, fast_2opt_iter=1001\nCompleted in 0.0073 seconds\nRoute length: 534.90\n==================================================\n\n==================================================\nRunning Greedy v2 algorithm...\nDescription: Classic greedy TSP algorithm\nParameters: start_point=0\nCompleted in 0.0016 seconds\nRoute length: 609.21\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 | +13.89% | start_point=0                                                \nDynamic-gravity v2   | 0.0073 | +348.65%  | 534.90 | BEST | delta=0.5, fast_2opt_iter=1001                               \nDynamic-gravity v1   | 0.0075 | +361.28%  | 567.00 | +6.00%  | delta=0.5, fast_2opt_iter=1001                               \nAngular-radial v2    | 0.0088 | +441.26%  | 553.66 | +3.51%  | sort_by=angle_distance, look_ahead=1000, max_2opt_iter=1001  \nAngular-radial v1    | 0.0842 | +5064.72% | 553.66 | +3.51%  | sort_by=angle_distance, look_ahead=1001, max_2opt_iter=1001  \n==============================================================================================================================\n\nPERFORMANCE ANALYSIS:\n- Fastest algorithm(s): Greedy v2 (0.0016 sec)\n- Shortest route(s): Dynamic-gravity v2 (534.90 units)\n```\n\n```\n==================================================\n          SMART TSP ALGORITHMS BENCHMARK          \n==================================================\nCities:         1001\nSeed:           0\nGeneration:     cluster\nPost-opt:       OFF\nAlgorithms:    \n  - Angular-radial v1: sort_by=angle_distance, look_ahead=1001, max_2opt_iter=1001\n  - Angular-radial v2: sort_by=angle_distance, look_ahead=1000, max_2opt_iter=1001\n  - Dynamic-gravity v1: delta=0.5, fast_2opt_iter=1001\n  - Dynamic-gravity v2: delta=0.5, fast_2opt_iter=1001\n  - Greedy v2: start_point=0\n==================================================\n\n\n==================================================\nRunning Angular-radial v1 algorithm...\nDescription: Angular-radial v1\nParameters: sort_by=angle_distance, look_ahead=1001, max_2opt_iter=1001\nCompleted in 0.2531 seconds\nRoute length: 1388.82\n==================================================\n\n==================================================\nRunning Angular-radial v2 algorithm...\nDescription: Angular-radial v2\nParameters: sort_by=angle_distance, look_ahead=1000, max_2opt_iter=1001\nCompleted in 0.1263 seconds\nRoute length: 1388.82\n==================================================\n\n==================================================\nRunning Dynamic-gravity v1 algorithm...\nDescription: Dynamic gravity v1\nParameters: delta=0.5, fast_2opt_iter=1001\nCompleted in 0.0279 seconds\nRoute length: 1486.12\n==================================================\n\n==================================================\nRunning Dynamic-gravity v2 algorithm...\nDescription: Dynamic gravity v2\nParameters: delta=0.5, fast_2opt_iter=1001\nCompleted in 0.0248 seconds\nRoute length: 1485.03\n==================================================\n\n==================================================\nRunning Greedy v2 algorithm...\nDescription: Classic greedy TSP algorithm\nParameters: start_point=0\nCompleted in 0.0022 seconds\nRoute length: 1612.74\n==================================================\n\n================================================================================================================================\n                                                 DETAILED ALGORITHM COMPARISON                                                  \n================================================================================================================================\nAlgorithm            | Time (s) |  vs Best   |  Length | vs Best | Params                                                       \n--------------------------------------------------------------------------------------------------------------------------------\nGreedy v2            | 0.0022 | BEST | 1612.74 | +16.12% | start_point=0                                                \nDynamic-gravity v2   | 0.0248 | +1016.15%  | 1485.03 | +6.93%  | delta=0.5, fast_2opt_iter=1001                               \nDynamic-gravity v1   | 0.0279 | +1156.99%  | 1486.12 | +7.01%  | delta=0.5, fast_2opt_iter=1001                               \nAngular-radial v2    | 0.1263 | +5590.97%  | 1388.82 | BEST | sort_by=angle_distance, look_ahead=1000, max_2opt_iter=1001  \nAngular-radial v1    | 0.2531 | +11304.79% | 1388.82 | BEST | sort_by=angle_distance, look_ahead=1001, max_2opt_iter=1001  \n================================================================================================================================\n\nPERFORMANCE ANALYSIS:\n- Fastest algorithm(s): Greedy v2 (0.0022 sec)\n- Shortest route(s): Angular-radial v1, Angular-radial v2 (1388.82 units)\n```\n\n---\n\n**Disclaimer:** Performance results shown are for clustered 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-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartlegionlab%2Fsmart-tsp-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartlegionlab%2Fsmart-tsp-benchmark/lists"}