Search code examples
c#optimizationor-toolsvehicle-routing

Could not understand how to set time_window Google or-tools


I am new to google or-tools. I am trying to solve time window constraint problem in c# but did not understand about time window values.

Time Matrix Obtain from Distance Matrix API

[0, 668, 2165, 1668, 0, 606, 2634], 
[505, 0, 1944, 1594, 505, 164, 2414], 
[1976, 1998, 0, 2639, 1976, 1937, 777], 
[1393, 1259, 2633, 0, 1393, 1197, 3130], 
[0, 668, 2165, 1668, 0, 606, 2634], 
[341, 304, 2001, 1532, 341, 0, 2471], 
[2338, 2406, 856, 3139, 2338, 2344, 0]

Questions

How to set depot value?
What are the values of time window if i have
2:00PM To 3:00PM //Loc 1
4:00PM To 6:00PM //Loc 2
7:00PM To 8:00PM //Loc 3

Solution

  • Few thing to do

    • You must choose a reference point e.g. 12pm will be 0

    • you must choose a resolution e.g. 1hour equal 1 unit

    then 2:00pm to 3:00pm will be the interval [2, 3]