{"id":16976954,"url":"https://github.com/rithinch/pytspsolver","last_synced_at":"2025-03-17T08:38:07.274Z","repository":{"id":37601852,"uuid":"173920858","full_name":"rithinch/pytspsolver","owner":"rithinch","description":"🚚 Easy to use python package for rapid experimentation on the classic travelling salesman problem. Contains implementations of various optimization algorithms, cool visualizers and a plug-in architecture.","archived":false,"fork":false,"pushed_at":"2024-07-16T07:32:12.000Z","size":422,"stargazers_count":2,"open_issues_count":20,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T08:04:15.660Z","etag":null,"topics":["experiments","flexible","genetic-algorithm","metaheuristics","optimization-algorithms","plug-and-play","python3","travelling-salesman-problem","visualizations"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rithinch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-03-05T09:58:33.000Z","updated_at":"2021-12-01T01:12:56.000Z","dependencies_parsed_at":"2024-07-16T09:45:16.807Z","dependency_job_id":"40d525e6-2197-47e5-aaf4-870241b36f7e","html_url":"https://github.com/rithinch/pytspsolver","commit_stats":{"total_commits":144,"total_committers":8,"mean_commits":18.0,"dds":"0.38888888888888884","last_synced_commit":"5182f3c3e1f4452d2484805e678c8b0abe64d7fc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithinch%2Fpytspsolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithinch%2Fpytspsolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithinch%2Fpytspsolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithinch%2Fpytspsolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rithinch","download_url":"https://codeload.github.com/rithinch/pytspsolver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243853657,"owners_count":20358454,"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","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":["experiments","flexible","genetic-algorithm","metaheuristics","optimization-algorithms","plug-and-play","python3","travelling-salesman-problem","visualizations"],"created_at":"2024-10-14T01:27:43.532Z","updated_at":"2025-03-17T08:38:06.942Z","avatar_url":"https://github.com/rithinch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :truck: pytspsolver\n\nEasy to use package for rapid experimentation on the classic travelling salesman problem. Contains implementations of various optimization algorithms, cool visualizers and a plug-in architecture.\n\n[![Build Status](https://dev.azure.com/rithinchalumuri/pytspsolver/_apis/build/status/pytspsolver-CI?branchName=master)](https://dev.azure.com/rithinchalumuri/pytspsolver/_build/latest?definitionId=7\u0026branchName=master)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rithinch_pytspsolver\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=rithinch_pytspsolver)\n[![Known Vulnerabilities](https://snyk.io/test/github/rithinch/pytspsolver/badge.svg?targetFile=src/requirements.txt)](https://snyk.io/test/github/rithinch/pytspsolver?targetFile=src/requirements.txt)\n[![PyPI](https://img.shields.io/pypi/v/pytspsolver.svg)](https://pypi.org/project/pytspsolver/)\n[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/rithinch)\n![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)\n\n## Installation\n\n```bash\n\u003e pip install pytspsolver\n```\n\n ## Usage\n \n This package is designed to provide an intutive pythonic interface; allowing you to conduct experiments with minimal code. 😅\n \n Here's how you can kick-start a travelling salesman problem experiment:\n \n```python\nfrom pytspsolver.entities import TSProblem\nfrom pytspsolver.experiments import Experiment\nfrom pytspsolver.solvers import *\nfrom pytspsolver.utilities import create_random_problem, get_tsp_lib_problem, Visualizer\nimport matplotlib.pyplot as plt\n\n# Create a few tsp problems (represented as an adjacency matrix)\nproblems = [create_random_problem(\"UniqueProblemName\"+str(i), i) for i in range(3,12)]\n\n# Pass in the location of TSPLIB95 dataset file\ntsp_prob = get_tsp_lib_problem(\"gr17.tsp\")\n\n# Create a new Experiment\nexperiment = Experiment()\n\n# Add the problems to the experiment (single or list of problems)\nexperiment.add_problem(tsp_prob)\nexperiment.add_problems(problems)\n\n# Add solvers to use in the experiment\nexperiment.add_solver(ExhaustiveSearch(time_limit=50))\nexperiment.add_solver(GreedySearch(time_limit=100))\n\n# Run the experiment desired number of times\nresults = experiment.run(epoch=10) \n\n# Set up Visualizer with experiment results\nvisualizer = Visualizer(results)\n\n# Show visualizations - automatically averages the results from different epochs\nvisualizer.plot_n_vs_time_all(plt)\n\n# Note: the visualizer has various plots available, they can be called in a similar fashion.\n```\n \nIt comes with a plug in architecture, therefore it is very customizable.\n\n##  Local Setup (Development Purposes)\n\nContributions and pull requests are encouraged! 👏\n\nLet's first create a new python environment with the name **your_env_name** using Anaconda Prompt/Terminal; this allows us to manage all package dependencies for this project in isolation. \n\n```bash\n\u003e conda create -n your_env_name\n```\n\nWe can now activate the created environment using the command below:\n\n```bash\n\u003e conda activate your_env_name\n```\n\nWe need to install a few dependencies. We can do this by running the following:\n\n```bash\n\u003e conda install jupyter\n\u003e pip install -r ./src/requirements.txt\n```\n\nThen, we need to install the ```pytspsolver``` package. Everytime a code change is made to the package, this needs to be called. Otherwise newly added changes wouldn't reflect in places where this package is being used. \n\n```bash\n\u003e pip install ./src\n```\n\n That's it, we're good to start developing now. :sunglasses:\n \n ## Additional Examples\n\nA few examples have been implemented using jupyter notebooks; found in the **examples** folder. These notebooks can be accessed by launching jupyter notebook from your current conda environment. \n\n```bash\n\u003e jupyter notebook\n```\n\n👉 Make sure you are in the right environment when launching jupyter notebook, otherwise, jupyter notebook kernel will be pointing to a different python version which won't have ```pytspsolver``` package installed.\n\n## Contributors\n\n* [Venkata Rithin Chalumuri](https://github.coventry.ac.uk/chalumuv)\n* [Genaro Bedenko](https://github.coventry.ac.uk/bedenkog)\n* [Ovidiu Mitroi](https://github.coventry.ac.uk/mitroio)\n* [Rishi Mehangra](https://github.coventry.ac.uk/mehangrr)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frithinch%2Fpytspsolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frithinch%2Fpytspsolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frithinch%2Fpytspsolver/lists"}