Validity of a VRP formulation and code
回答済みA delivery company is operating in Virginia and has a fleet of trucks that are used to deliver groceries from supermarkets to consumers. The company delivers orders and operates its fleet for one shift per day that is between 12 PM and 11:59 PM.
Each day by 12 PM, the company receives a list of all deliveries required from all supermarkets. Each order is defined by the supermarket location, delivery location, and delivery time window. The company should deliver all orders. The goal of the business is to minimize its costs which are defined as follows:
𝐶𝑜𝑠𝑡 = (𝛽 × 𝑇) + (𝛾 × 𝐷)
𝛽: the fixed cost per each used truck per day.
𝑇: the number of used trucks per day.
𝛾: the cost per unit travel distance in km.
𝐷: the total travel distance from all trucks per day in km.
All trucks should start and end their operation at the depot. The location of the depot is at: [25.1371,55.25042]. The average service time per order is 5 minutes (i.e., the time needed to take the order to the front door of the customer after arriving at their location).
Assumptions:
• All distances are assumed to be haversine distances.
• The average driving speed of the truck is 20 km/hr.
• 𝛽 = 300/truck/𝑡𝑟𝑢𝑐𝑘
• 𝛾 = 0.5/km/𝑘𝑚
• Trucks have infinite capacity.
Hence, a truck can pick up multiple orders’ deliveries and then deliver them. You are given the data for 6 different days. Days 1, 2, and 3 had a low amount of demand, while days 4, 5, and 6 had a high amount of demand. You need to come up with the operational plan deciding how many trucks to use and the route of each truck. (i.e., deal with each day as a separate problem, so the optimal number of trucks per day can be two on day 1 and five on day 2, and so on).
Here is my formulation:


I'm new in vrp. I need to solve the problem for a) the best possible solution (heuristics/metaheuristics) Using the nearest neighbor. b) formulation for the exact solution
what needs to be added or modified in the formulation to get the desired results for both.
Here is my code:
-
正式なコメント
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Taposh Kumar,
Several model components are missing that model the trucks' routes in your VRP with time windows.
Here are Jupyter notebooks that discuss different ways to model the Capacitated VRP and the VRP with time windows. It might give you some hints on the missing parts.
Best regards,
Mario1 -
Thanks for your comments. Could you please suggest any resources to solve vrp with heuristics /metaheuristics in python?
1 -
Solving VRPs with (meta)heuristics is outside the scope of this forum since this is not Gurobi-related.
I do not know of any public Python implementations of VRP heuristics, but I usually recommend the book "Vehicle Routing" by Toth and Vigo.
0
投稿コメントは受け付けていません。
コメント
4件のコメント