In this technological era due to increase in the use of mobile phones and internet, e-commerce had a huge boom. So along with this increase in e-commerce, the wastage produce along with it is also increasing in the form of plastic wrappings, bubble wraps etc. These types of wastes are called e-commerce wastage. This e-commerce wastage can be decreased if a company can make a way to reuse the product wrappings in a cost-efficient way.
So, we are proposing an algorithm that can provide a cost-efficient way to collect the product packaging’s back from the customer. This algorithm collects the location of the customer when the customer taps his mobile on the NFC enabled packaging. Then we process the locations of the all the customers who used this feature. Then we monitor the density of people who are willing to return the packaging back at different locations.
We group these locations based on pin-codes which act as a natural way to group locations. Such that if the density of orders at a certain pin-code reaches the threshold. A product recovery agent is sent to the location. He follows the path generated by our algorithm which is obtained by careful calculation of cost, distance, duration of all the path combinations. Such that making the collection of product packaging an efficient one.
The algorithm that is used in this process is explained here in the file Pickup_path_plotter.py.
Let us imagine that we are a startup pickup company. We will have a set of pickup destinations, made known to us prior to the day of pickup, So as to plan a route that starts from our pickup depot, goes to each destination and ends back at the same pickup depot. This route will be optimised to either be of shortest distance or shortest time duration required. We also only have one pickup van. As such, we are only looking at a basic TSP and not the Vehicle Routing Problem.
NOTE
What makes this algorithm unique is that it groups locations based on the pincodes and works only when certain no of orders at a certain pincode location crosses the threshold.
- ortools
You can install it with the command pip install ortools
- gmplot
You can install it with the command pip install gmplot
- urllib
You can install it with the command pip install urllib3
Steps to remember when creating the API_KEY:
- Open google cloud console.
- Enable billing by providing billing information.
- Create a new project
- Enable the folloing four apis.
- Geocoding API
- Distance Matrix API
- Maps JavaScript API
- Directions API
- Get the API_key credentials
These APIs are free for 90 days after the billing is enabled for your account.
This program takes four inputs 3 in terminal and 1 in the code.
- Enter the file contaning address as csv file with extension(.csv).
- Enter the depot location.
- Enter the min no of orders per pincode.
- Enter the API_Key in the
__main__
function.
Example Inputs:
Enter the file name of the csv file with extension .csv : list.csv
Enter the pickup depot location : tirupati
Enter the min_orders : 10
The are two types of outputs for this project.
Termianl Output HTML files Output
These outputs contains two types of data one being calcualated using shortest distance and the other using shortest duartion.
- Shortest Distance Path
Route based on shortest distance:
tirupati -> Narasingapuram 517102 -> Chandragiri Fort 517102 -> Bopparajupalle 517102 -> Dornakambala 517102 ->
Buchinaidupalle 517102 -> Mungilipattu 517102 -> Kotala 517102 -> Rangampet 517102 -> Seshapuram 517102 -> Bhimavaram 517102 ->
Kalyani Dam 517102 -> Sree Vidynaikethan Eng College 517102 -> Kmm institute of technology 517102 -> Mangapuram 517102 -> tirupati
Route distance: 111.775km
Route duration: 3:41:45
- Shortest Duration Path
tirupati -> Kmm institute of technology 517102 -> Sree Vidynaikethan Eng College 517102 -> Seshapuram 517102 ->
Bhimavaram 517102 -> Rangampet 517102 -> Kalyani Dam 517102 -> Narasingapuram 517102 -> Bopparajupalle 517102 -> Dornakambala 517102 ->
Buchinaidupalle 517102 -> Mungilipattu 517102 -> Kotala 517102 -> Chandragiri Fort 517102 -> Mangapuram 517102 -> tirupati
Route distance: 114.844km
Route duration: 3:34:15
- Shortest Distance Path
This returns a HTML file Pickup(distance)map.html
- Shortest Duration Path
This returns a HTML file Pickup(duration)map.html
This project is licensed under the MIT License.
For any inquiries or feedback, please contact:
- Jithendra Varma
- Email: jithendra9367@gmail.com