Challenge for Python Backend developers. For description see INSTRUCTIONS.md.
src/models/trip.py
: Mongodb document definition for storing the penguin tripssrc/routes/trip_routes/calculate.py
: Calculate routesrc/routes/trip_routes/business_trip.py
: Business trips routesrc/routes/trip_routes/utils.py
: helpers functions/Class forsrc/routes/trip_routes/schema.py
: Request Schema definitiontest/test_route_calculate
: test of/calculate
routetest/test_route_business_trips
: test of/business-trips
route
src/routes/add_routes.py
: added/calculate
and/business-trips
routesrequirements.txt
: added the following packages: requests and marshmallow
Based on the given instructions, the main challenge is to find the shortest path to the destinations according to the provided distances with a starting point Munich
for that we can adopte the dijkstra algorithm which will help us to find the shortest path to destination places where different cites represent nodes, edges are the connections between those cites and the weight is represented by the time in hours between two cities.