I'm using a linear VRPTW with time windows also on vehicles
A vehicle starts on depot and goes firstly to a node assigned to him with a fixed time window based on the start of his working day, then goes A->B->C->D....->last node (assigned with a fixed time window based on the end of his working day) and then depot
When the solver gives a solution, I use the times given from that solution to set a fixed time windows to each location (imagine I call to my client to notify him that time), but when I add some new locations, it dont want to return any solution.
Google api says it takes 139 minutes to go from Vehicle 12 node 70 to that new location (since 9:00), and that new location has a wide time window (until 15:00) so the location is highly feasible
Find attached two minimum examples, one of them is working while the other (with 1 location more) is not, so the question is: why is the solver not returning any solution?
I'm using time dimensions:
routing.addDimension(transitCallbackIndex, // transit callback
30000000, // allow waiting time
30000000, // vehicle maximum capacities
false, // start cumul to zero
"Time");
RoutingDimension timeDimension = routing.getMutableDimension("Time");
Setting time windows is done this way:
// Add time window constraints for each location except depot.
This is my solver config:
RoutingSearchParameters searchParameters = main.defaultRoutingSearchParameters()
.toBuilder()
.setFirstSolutionStrategy(FirstSolutionStrategy.Value.SEQUENTIAL_CHEAPEST_INSERTION)
.setTimeLimit(Duration.newBuilder().setSeconds(30))
.setLocalSearchMetaheuristic(LocalSearchMetaheuristic.Value.GENERIC_TABU_SEARCH)
.setSolutionLimit(1)
.build();
Solution limit is 1 because otherwise, solver cannot return solutions after fixing time windows, sequential_cheapest_insertion because only sequential or parallel cheapest are returning a result in a low amount of time (the others take +20 minutes to never)
I readed about linear programming, quite a lot ortools documentations and looked at the examples but I don't really know why this is failing, I'm not 100% familiar to constraint-programming so I appreciate that any suggestions comes with a little code snippet
I am surely missing something although it looks like my solution should be working
Initial solution (before fixing time windows) is:
Vehicle 0 node 0 (0-0)
Vehicle 0 node 2 (480-480)
Vehicle 0 node 27 (540-558)
Vehicle 0 node 37 (589-607)
Vehicle 0 node 40 (670-688)
Vehicle 0 node 56 (718-736)
Vehicle 0 node 45 (765-783)
Vehicle 0 node 39 (873-900)
Vehicle 0 node 63 (983-1021)
Vehicle 0 node 1 (1200-1200)
Vehicle 1 node 0 (0-0)
Vehicle 1 node 4 (480-480)
Vehicle 1 node 35 (519-522)
Vehicle 1 node 28 (598-601)
Vehicle 1 node 44 (647-650)
Vehicle 1 node 29 (717-720)
Vehicle 1 node 34 (816-840)
Vehicle 1 node 49 (915-966)
Vehicle 1 node 3 (1200-1200)
Vehicle 2 node 0 (0-0)
Vehicle 2 node 6 (480-480)
Vehicle 2 node 62 (540-576)
Vehicle 2 node 60 (604-640)
Vehicle 2 node 30 (684-720)
Vehicle 2 node 58 (783-840)
Vehicle 2 node 46 (956-1016)
Vehicle 2 node 5 (1200-1200)
Vehicle 3 node 0 (0-0)
Vehicle 3 node 8 (480-480)
Vehicle 3 node 31 (540-574)
Vehicle 3 node 51 (626-660)
Vehicle 3 node 50 (786-840)
Vehicle 3 node 7 (1200-1200)
Vehicle 4 node 0 (0-0)
Vehicle 4 node 10 (480-480)
Vehicle 4 node 48 (480-488)
Vehicle 4 node 32 (605-613)
Vehicle 4 node 69 (701-709)
Vehicle 4 node 9 (1200-1200)
Vehicle 5 node 0 (0-0)
Vehicle 5 node 12 (480-480)
Vehicle 5 node 33 (566-588)
Vehicle 5 node 47 (638-660)
Vehicle 5 node 68 (751-784)
Vehicle 5 node 61 (867-900)
Vehicle 5 node 11 (1200-1200)
Vehicle 6 node 0 (0-0)
Vehicle 6 node 14 (480-480)
Vehicle 6 node 38 (540-545)
Vehicle 6 node 36 (627-632)
Vehicle 6 node 41 (743-748)
Vehicle 6 node 66 (835-840)
Vehicle 6 node 13 (1200-1200)
Vehicle 7 node 0 (0-0)
Vehicle 7 node 16 (480-480)
Vehicle 7 node 57 (480-497)
Vehicle 7 node 42 (613-630)
Vehicle 7 node 55 (800-840)
Vehicle 7 node 15 (1200-1200)
Vehicle 8 node 0 (0-0)
Vehicle 8 node 18 (480-480)
Vehicle 8 node 43 (540-543)
Vehicle 8 node 54 (627-630)
Vehicle 8 node 17 (1200-1200)
Vehicle 9 node 0 (0-0)
Vehicle 9 node 20 (480-480)
Vehicle 9 node 52 (510-570)
Vehicle 9 node 64 (630-720)
Vehicle 9 node 19 (1200-1200)
Vehicle 10 node 0 (0-0)
Vehicle 10 node 22 (480-480)
Vehicle 10 node 53 (480-534)
Vehicle 10 node 59 (636-690)
Vehicle 10 node 21 (1200-1200)
Vehicle 11 node 0 (0-0)
Vehicle 11 node 24 (480-480)
Vehicle 11 node 65 (510-511)
Vehicle 11 node 67 (659-660)
Vehicle 11 node 23 (1200-1200)
Vehicle 12 node 0 (0-0)
Vehicle 12 node 26 (480-480)
Vehicle 12 node 70 (544-664)
Vehicle 12 node 25 (1200-1200)
I've been dealing with this problem since may, so any help is hugely appreciated
Thank you a lot in advance
--
You received this message because you are subscribed to a topic in the Google Groups "or-tools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/or-tools-discuss/rvnbHeftYzs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/d41dc657-6c5e-412d-8fd2-90aa553dd674n%40googlegroups.com.
- When you are adding new solution, the solver may not found an new initial solution.
- When you add new node, did you use a disjunction ? sometime it's better to start from the previous initial solution, then let the local search try to insert the new location (if possible)
- If you add a new location without using disjunction, then your previous solution is NOT an initial solution for the new problem since you are not visiting the new mandatory location.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/e3fc56a7-adb0-4144-9f5c-8f99d6f4fd7bn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/20200901145952.GA1%40099d5fd9ec1a.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/20200901145952.GA1%40099d5fd9ec1a.
On Sep 2, 2020, at 05:20, I. Sanzol <intis...@gmail.com> wrote:
Update: (Sry for double post)
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/2d4cae19-31ca-45d5-9d9d-0a0db51a0e6bn%40googlegroups.com.
On Sep 3, 2020, at 02:50, I. Sanzol <intis...@gmail.com> wrote:
Time windows are tight but possible (see below),
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/f1a63b74-9f29-45ee-a2ac-e7d1ce0696a7n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/20200904151822.GA1%40f8d28623015d.