TSP Rest Api Server - Rest Api Server using Dijsktra's algorithm applied to travelling salesman problem.
Project description
tsp-rest-api-server
TSP Rest Api Server - Rest Api Server using Dijsktra’s algorithm applied to travelling salesman problem.
License
Licensed under the MIT License.
Install
Follow the steps below to get everything up and running.
pip
Create project folder:
$ mkdir tsp-rest-api-server && cd tsp-rest-api-serverCreate virtualenv in the normal way:
$ virtualenv env --python=pythonActive your new virtualenv:
$ source env/bin/activateInstall tsp-rest-api-server:
$ pip install tsp-rest-api-serverCreate setting file:
$ tsp_rest_api_server settingsRun tsp rest api server:
$ tsp_rest_api_server runserver
Git
Clone repository:
$ git clone git@github.com:caputomarcos/tsp_rest_api_server.gitGo to tsp_rest_api_server source folder:
$ cd tsp-rest-api-server/Create virtualenv in the normal way:
$ virtualenv env --python=pythonActive your new virtualenv:
$ source env/bin/activateCreate dev environment:
$ make develop
Usage
Create routes:
$ curl -d "@map.json" -H "Content-Type: application/json" -X POST http://0.0.0.0:5000/maps or $ curl -d '{ "title":"Sao Paulo", "routes":[{"origin":"A","destiny":"B","distance":10},{"origin":"B","destiny":"D","distance":15},{"origin":"A","destiny":"C","distance":20},{"origin":"C","destiny":"D","distance":30},{"origin":"B","destiny":"E","distance":50},{"origin":"D","destiny":"E","distance":30}]}' -H "Content-Type: application/json" -X POST http://0.0.0.0:5000/maps
Search shortest route:
$ curl 'http://0.0.0.0:5000/maps/shortest?map=Sao%20Paulo&origin=A&destiny=D&price=2.50&autonomy=10' { "data": [ { "Path": "['A', 'B', 'D']" }, { "Total KM": "25.00" }, { "Cost": "6.25" } ] }
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tsp_rest_api_server-3.0.tar.gz.
File metadata
- Download URL: tsp_rest_api_server-3.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2884a2296e7bfe992bff2171968ff4e8fff6981f6e1b656ef3f35bae6d49caf
|
|
| MD5 |
fc9141af92e426433bee1478a535969d
|
|
| BLAKE2b-256 |
9b2d874b7cda42d4dd44d18912d0879fad3fd6ab4c6eacd5249d4e25f9c0185a
|
File details
Details for the file tsp_rest_api_server-3.0-py2-none-any.whl.
File metadata
- Download URL: tsp_rest_api_server-3.0-py2-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43547b1f26b7d532dee1fd162db65ba887a92fdc2ce1f3a437adb100f3b24286
|
|
| MD5 |
a97d3e469895ad52fab5f764e43d57fe
|
|
| BLAKE2b-256 |
c2c9232f5ca318d6080725072be3c5165c22ba840d72c5bbb88b9e3a71fc7761
|