{"id":31917111,"url":"https://github.com/smartlegionlab/smart-tsp-oracle","last_synced_at":"2026-07-16T18:34:22.500Z","repository":{"id":311494585,"uuid":"1043893619","full_name":"smartlegionlab/smart-tsp-oracle","owner":"smartlegionlab","description":"A high-performance, exact solver for the Traveling Salesman Problem (TSP) implemented in Python. Utilizes an intelligent Branch and Bound algorithm with adaptive thresholding to find the globally optimal solution for small to medium-sized TSP instances.","archived":false,"fork":false,"pushed_at":"2026-04-09T22:37:43.000Z","size":37,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-07-16T18:34:20.298Z","etag":null,"topics":["smart-tsp-oracle","smartlegionlab","tsp","tsp-oracle","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":"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":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-24T20:53:30.000Z","updated_at":"2026-04-09T22:37:46.000Z","dependencies_parsed_at":"2025-08-24T23:26:12.849Z","dependency_job_id":"9522b595-ea73-4e00-9c68-e55c8fab889c","html_url":"https://github.com/smartlegionlab/smart-tsp-oracle","commit_stats":null,"previous_names":["smartlegionlab/smart-tsp-oracle"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/smartlegionlab/smart-tsp-oracle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-oracle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-oracle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-oracle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-oracle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartlegionlab","download_url":"https://codeload.github.com/smartlegionlab/smart-tsp-oracle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlegionlab%2Fsmart-tsp-oracle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35555509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-16T02:00:06.687Z","response_time":83,"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-oracle","smartlegionlab","tsp","tsp-oracle","tsp-problem","tsp-solver","tsp-solver-python"],"created_at":"2025-10-13T20:25:28.455Z","updated_at":"2026-07-16T18:34:22.493Z","avatar_url":"https://github.com/smartlegionlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart TSP Oracle \u003csup\u003ev1.0.1\u003c/sup\u003e\n\n---\n\nA high-performance, exact solver for the Traveling Salesman Problem (TSP) implemented in Python. Utilizes an intelligent Branch and Bound algorithm with adaptive thresholding to find the globally optimal solution for small to medium-sized TSP instances.\n\n---\n\n![GitHub top language](https://img.shields.io/github/languages/top/smartlegionlab/smart-tsp-oracle)\n[![GitHub](https://img.shields.io/github/license/smartlegionlab/smart-tsp-oracle)](https://github.com/smartlegionlab/smart-tsp-oracle/blob/master/LICENSE)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/smartlegionlab/smart-tsp-oracle)](https://github.com/smartlegionlab/smart-tsp-oracle/)\n[![GitHub Repo stars](https://img.shields.io/github/stars/smartlegionlab/smart-tsp-oracle?style=social)](https://github.com/smartlegionlab/smart-tsp-oracle/)\n[![GitHub watchers](https://img.shields.io/github/watchers/smartlegionlab/smart-tsp-oracle?style=social)](https://github.com/smartlegionlab/smart-tsp-oracle/)\n[![GitHub forks](https://img.shields.io/github/forks/smartlegionlab/smart-tsp-oracle?style=social)](https://github.com/smartlegionlab/smart-tsp-oracle/)\n\n---\n\n## ⚠️ Disclaimer\n\n**By using this software, you agree to the full disclaimer terms.**\n\n**Summary:** Software provided \"AS IS\" without warranty. You assume all risks.\n\n**Full legal disclaimer:** See [DISCLAIMER.md](https://github.com/smartlegionlab/smart-tsp-oracle/blob/master/DISCLAIMER.md)\n\n---\n\n## Related Research\n\nPosition-Candidate-Hypothesis (PCH) Paradigm: [doi.org/10.5281/zenodo.17614888](https://doi.org/10.5281/zenodo.17614888) - A New Research Direction for NP-Complete Problems\n\nFor those interested in the theoretical foundations:\n\n- **[Smart TSP Solver](https://github.com/smartlegionlab/smart-tsp-oracle)** - 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- **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## Quick Start\n\n```bash\n# Install requirements\npip install numpy numba\n\n# Run with 20 points\npython main.py -n 20 --seed 42\n\n# Run with custom parameters\npython main.py -n 15 --seed 12345\n```\n\n### Command Line Options\n\n```bash\n-n, --num-points    Number of points (3-25 recommended)\n--seed              Random seed for reproducible results\n```\n\n---\n\n## License\n\n*Licensed under [BSD 3-Clause License](LICENSE) • Copyright (©) 2026, [Alexander Suvorov](https://github.com/smartlegionlab)*\n\n---\n\n## Author\n\n[**Alexander Suvorov**](https://github.com/smartlegionlab/)\n\n- Passionate about pushing the boundaries of algorithmic optimization.\n- This solver was developed to bridge the gap between theoretical computer science and practical implementation.\n\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---\n\n## Algorithm Overview\n\n### Core Components\n\n1. **Multi-Start Greedy + 2-opt**: Generates high-quality initial solution\n2. **Branch and Bound**: Exact search with mathematical optimality guarantee\n3. **MST Lower Bounds**: Minimum Spanning Tree for efficient pruning\n4. **Adaptive Thresholding**: Dynamic search space reduction\n\n### Mathematical Foundation\n\nThe algorithm uses Minimum Spanning Tree (MST) calculations to compute exact lower bounds, ensuring mathematical proof of optimality for the found solutions.\n\n---\n\n## Example Output\n\n```bash\npython main.py -n 20 --seed 123321411\n```\n\n```\n==================================================\nTSP SOLVER (ORACLE v2) - 20 POINTS\nSEED: 123321411\n==================================================\n\nCoordinates of points:\n   Dot 0: (716.02, 797.47)\n   Dot 1: (336.04, 587.85)\n   Dot 2: (620.65, 170.96)\n   Dot 3: (0.77, 335.69)\n   Dot 4: (275.75, 747.51)\n   Dot 5: (823.69, 50.79)\n   Dot 6: (533.09, 748.58)\n   Dot 7: (135.94, 668.09)\n   Dot 8: (890.62, 294.76)\n   Dot 9: (583.21, 863.07)\n   Dot 10: (463.36, 816.27)\n   Dot 11: (592.15, 238.06)\n   Dot 12: (680.65, 113.63)\n   Dot 13: (404.13, 996.27)\n   Dot 14: (14.42, 824.82)\n   Dot 15: (87.71, 239.60)\n   Dot 16: (443.56, 190.80)\n   Dot 17: (724.89, 425.34)\n   Dot 18: (929.70, 824.26)\n   Dot 19: (726.95, 159.40)\n1. Launching the multi-start greedy algorithm...\n   Multi-start greedy + 2-opt: length = 4676.81\n   We start the search from 4209.13 (90.0%)\nChecked: 287 paths | Speed: 574/sec | Time: 00:00:00✓ found: 4176.83 (00:00:00)\n   Threshold: 3884.45 (83.1%)... ✗ cut off (00:00:00)\n   The optimum has been found: 4176.83\n\nRESULTS:\n==================================================\nNumber of points: 20\nSeed: 123321411\nTotal possible paths: so many\nChecked paths: 298\nExecution time: 1.01 seconds\nSpeed: 295 paths/sec\nGreedy + 2-opt: 4676.805998\nOptimal length: 4176.825110\nImprovement: 499.980888 (10.691%)\n\nGreedy way: [3, 15, 16, 11, 2, 12, 19, 5, 8, 17, 1, 4, 7, 14, 13, 10, 6, 9, 0, 18]\nThe optimal path: [0, 17, 8, 5, 19, 12, 2, 11, 16, 15, 3, 14, 7, 1, 4, 13, 10, 6, 9, 18]\n\nThe results are saved in tsp_result_n20_seed123321411.txt\n```\n\n---\n\n## Performance Characteristics\n\n- **Optimal for**: 3-25 points (exact solutions)\n- **Time complexity**: O(n! * 2^n) in worst case\n- **Space complexity**: O(n²) for distance matrix\n- **Features**: Progress tracking, result export, reproducible runs\n\n## Technical Details\n\n### Requirements\n- Python 3.8+\n- numpy\n- numba\n\n### Implementation Highlights\n- Numba-accelerated distance matrix computation\n- Union-Find data structure for MST calculations\n- Adaptive thresholding for efficient pruning\n- Comprehensive result logging and export\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-oracle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartlegionlab%2Fsmart-tsp-oracle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartlegionlab%2Fsmart-tsp-oracle/lists"}