Search for the best way through the warehouse to collect different goods for further shipment to the client.
following system environment variables are used for auth0
connection configuration.
APPLICATION_URL
- URL of current instance, e.g. http://localhost:8080APPLICATION_PORT
- Port number backend shall listen on. Unless provided, port number fromURL
will be used, or default8080
APPLICATION_BIND
- IP address server shall listen on. Unless provided,0.0.0.0
will be usedAPPLICATION_ALLOWED_ORIGIN
- Allowed origin for processing http requests. Unless provided,http://localhost:8000
will be usedAPPLICATION_MACHINE_ID
- Machine ID for current instance, used for snowflake generation (default: 1)APPLICATION_NODE_ID
- Node ID for current instance, used for snowflake generation (default: 1)
request body:
geometry
stock geometry how 2d array when i index how Y and j index how Xpoints
is array of points (i,j) on which a person stands when he takes goods from the shelves.
responce body:
algorithm
is algorithm typedistance_matrix_time
how many time need for calculate graph (more details in "Solution" section)traveling_salesman_time
how many time need for calculate min path from graph (more details in "Solution" section)distance
how many steps need for getting goods from stock all shelvespath
route min path
POST /calculate_optimal_path
body
{
"geometry": [
["W","W","W","W","W","W","W","W"],
["W","P","_","_","_","P","_","W"],
["W","W","W","_","W","W","W","W"],
["W","_","_","_","_","_","P","W"],
["W","W","W","_","W","W","W","W"],
["W","P","_","_","_","_","_","W"],
["W","W","W","_","W","W","W","W"],
["W","_","_","_","_","_","P","W"],
["W","S","_","_","_","_","_","_"],
["W","W","W","W","W","W","W","W"]
],
"points": [
[8, 1],
[1, 1],
[1, 5],
[3, 6],
[5, 1],
[7, 6]
]
}
return:
{
"algorithm": "simulated_annealing",
"distance_matrix_time": "162.47µs",
"traveling_salesman_time": "1.000004241s",
"distance": 48.0,
"path": [
[8, 1],
[1, 5],
[1, 1],
[3, 6],
[5, 1],
[7, 6],
[8, 1]
]
}
To start server use command: cargo run --bin chat
Open url: http://localhost:8080/
$ docker build --target runtime -t stock_math_api .
$ docker build --progress=plain --target test -t chat-test .
stock_math_api.postman_collection.json - located in repo
- Calculate graph when set of nodes is 'Pi' and set of edges
('Pi', 'Pj') = min_path(geometry, Pi, Pj)
min_path we calculate use bfs algorithm. - Solve traveling salesman problem for all nodes in calculated graph using Simulated_annealing algorithm.
W - wall or shelf P - point S - start point
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WP_____P______P_______P________P________P______W
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W________________P__P______________P________P__W
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W__P_________P________________P________P_______W
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WP_______________P__________________P_________PW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W___P___________P______________P__________P____W
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W____________P________P_____________P________P_W
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W______________________________________________W
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W__P___________P____________________PP_________W
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W__________________P_______P__________________PW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W_____P_____________________P_________P________W
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWW__WWWWWWWWWWWWWWWWWWWWW
W______________________________________________W
W______________________________________________W
W_______________________________________________
W___S___________________________________________
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
curl -i -X OPTIONS -H "Origin: http://127.0.0.1:3000" \
-H 'Access-Control-Request-Method: POST' \
-H 'Access-Control-Request-Headers: Content-Type' \
"http://localhost:8080"
- investigate Concorde TSP Solver
- impement algorithms used concorde for TSP on rust