Commonly known as the ‘traveling salesperson’ problem. I created a program (CLI) that would parse a list of delivery addresses, and figure out the optimal route for 2 or more delivery trucks based on a number of constraints and time limits.
The two underlying algorithms are Dijkstra's algorithm and a nearest neighbor greedy algorithm. Dijkstra's is used to calculate the shortest route between two points. The greedy algorithm uses Dijkstra's in order to determine the closest neighbor and from that constructs a route for the truck.
The package data are parsed, and the constraints are met in an automated way so that if more packages were added to the CSV file, the program would automatically process them.
The weighted graph structure is constructed at run time from data parsed from the CSV file, therefore if more destinations were added to the CSV file or a completely different set of addresses used, the program would still find an optimal route.