1

I am studying a project in Python. It's a vehicle routing problem with time-window. In this study, depot is denoted by 1. And there are 14 customers which are fulfilled with 4 vehicles. Each vehicle has 50 tons capacity. Travel time between every pair of locations i and j is 10 min. Also, distance between each customer are given. And also, every customer's demands are given. In addition, a customer's demand can be met by more than one vehicle. I solved vehicle routing part but I can't add time window. What I used:

 import numpy as np
 import matplotlib.pyplot as plt
 from docplex.mp.model import Model

How I can add time window constraints? If it is possible, I would like to solve with docplex.mp.model.

Shmn
  • 681
  • 1
  • 4
  • 22
ayca
  • 11
  • 1
  • I have never used docplex, but given that you are using solving a linear programming model you'd want to add a constraint at each node (customer). A quick glance at the documentation shows that there is a `add_constraint()` method on `Model.` So my guess is you'd have to loop over the customer nodes and set the constraint at each node with the min value and max value for the time window. See [here](http://ibmdecisionoptimization.github.io/docplex-doc/mp/docplex.mp.model.html#docplex.mp.model.Model.add_constraint) – k88 Oct 25 '20 at 15:30

0 Answers0