Inspiration

As the COVID-19 pandemic ran rampant, many businesses had to shut down their doors. However, one industry that took off was logistics as e-commerce on all platforms increased drastically. This led to shipments of everyday necessities being delayed and prices for these products increasing. As consumers, we thus pay more for products as a result of inefficient logistics. This is where our implementation of sophisticated algorithms to maximize the worth-while for the trucker and increase the efficiency of the logistics industry as a whole comes into play. The range of our program is broad and has a single goal in mind; help truckers optimize their work schedule which subsequently leads to lower prices for consumers.

What it does

Our program prompts a trucker to enter five specific parameters based on their desired schedule. It begins by asking for the Trip ID to identify the trip. It then asks for the driver's starting position in longitude and latitude. Finally, it takes in the time the trucker would like to spend driving, in the form of a start date/time and end date/time. These inputs are stored in a JSON file and pulled when the Python script containing our algorithms is called. The program runs and then outputs the information associated with the specific load ID in a user-friendly UI to show the driver the possible paths he can take. Additionally, the user can specify the location he would like to end at and our algorithm will easily be able to determine the most profitable path to reach that destination

How we built it

The back-end was built with Python as well as the Flask web framework to link the front-end, built with HTML, CSS, and Bootstrap 4, with the Python scripts containing the Bellman-Ford and Depth-Limited search algorithms. Flask is what allowed us to store user inputs from HTML forms into the JSON file which can then be pulled and entered as parameters to run the Python script containing our algorithms.

Algorithm Description

Initially, the marketplace is converted into a Graph. The vectors contain the city, the state its latitude, and longitude. Furthermore, the edges are directed weight graphs with two weights associated for each edge; distance, and profit. Using this information, we initially used the Bellman-Ford algorithm to find the optimal path to every vector but this was not optimal since it also considers paths that are impossible to reach due to driver time restrictions. Thus, we computed the max distance that the user can travel and made sure the paths suggested by the Bellman-Ford algorithm are within the acceptable limits. This was inspired by Depth-Limited search which only dfsearches for nodes at a certain depth. Our algorithm not only allows us to find the optimal path with time specified constraints but further finds the best path with the trucker's preferable end location. We believe this implementation allows for easy manoeuvrability of new constraints for realistic scenarios.

Accomplishments that we're proud of

Brainstorming about how to tackle such a complex task and coming up with an algorithm while simultaneously designing and launching a UI to go along with our implementation is something we're very proud of. Launching a more or less fully functional program in under 36 hours was a challenge we embraced with open arms and our final submission is an accomplishment we are extremely proud of.

What we learned

This project was immensely insightful on how to implement the Flask web framework to link back-end Python scripts with front-end user inputs. Moreover, we gained a solid foundation working and manipulating data stored in a JSON file and appreciated the power of this type of data storage system. Finally, a deep understanding of two very powerful algorithms, Bellman-Ford and Depth-Limited search, was attained.

What's next for 123LoadPlanner

We would love to work closely with 123LoadBoard's Software Engineers to further modify and optimize our algorithm as well as add additional features that can help drivers work as efficiently as possible for themselves and the logistics industry as a whole.

Share this project:

Updates