Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
tsp-rest-api-server
TSP Rest Api Server - Rest Api Server using Dijsktra's algorithm applied to travelling salesman problem.
Readme
.. image:: https://raw.githubusercontent.com/caputomarcos/tsp-rest-api-server/master/logotipo-pickngo.png
TSP Rest Api Server - Rest Api Server using Dijsktra's algorithm applied to travelling salesman problem.
Licensed under the MIT License.
Follow the steps below to get everything up and running.
Create project folder:
.. code-block:: bash
$ mkdir tsp-rest-api-server && cd tsp-rest-api-server
Create virtualenv in the normal way:
.. code-block:: bash
$ virtualenv env --python=python
Active your new virtualenv:
.. code-block:: bash
$ source env/bin/activate
Install tsp-rest-api-server:
.. code-block:: bash
$ pip install tsp-rest-api-server
Create setting file:
.. code-block:: bash
$ tsp_rest_api_server settings
Set EVE_SETTINGS:
.. code-block:: bash
$ export EVE_SETTINGS=$PWD/settings.py
Run tsp rest api server:
.. code-block:: bash
$ tsp_rest_api_server runserver
Clone repository:
.. code-block:: bash
$ git clone git@github.com:caputomarcos/tsp_rest_api_server.git
Go to tsp_rest_api_server source folder:
.. code-block:: bash
$ cd tsp-rest-api-server/
Create virtualenv in the normal way:
.. code-block:: bash
$ virtualenv env --python=python
Active your new virtualenv:
.. code-block:: bash
$ source env/bin/activate
Create dev environment:
.. code-block:: bash
$ make develop
Create routes:
.. code-block:: bash
$ 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:
.. code-block:: bash
$ 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"
}
]
}
.. code-block:: JavaScript
# dropall.js
var dbs = db.getMongo().getDBNames()
for(var i in dbs){
db = db.getMongo().getDB( dbs[i] );
print( "dropping db " + db.getName() );
db.dropDatabase();
}
.. code-block:: bash
mongo dropall.js
DIJKSTRA'S SHORTEST PATH ALGORITHM <http://www.bogotobogo.com/python/python_Dijkstras_Shortest_Path_Algorithm.php>
_FAQs
TSP Rest Api Server - Rest Api Server using Dijsktra's algorithm applied to travelling salesman problem.
We found that tsp-rest-api-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.