Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Related jobs in JSprit

Tags:

java

jobs

jsprit

Is it possible to handle relations between jobs (in this case services) in jsprit?

For instance one job has to start at the same time with one or more other jobs. Or one job must not start before the end of another job (normal sequence).

If not, do you know other java libraries that can handle such kind of restrictions?

Thank you!

like image 533
Peter Avatar asked Jun 27 '14 08:06

Peter


1 Answers

Yes you can handle such relations with jsprit. It is a bit of coding, but - I think - easy to implement. To illustrate it, I prepared you five examples that are based on the Vehicle Routing Problems (VRP) developed by Christofides-Mingozzi-Toth's* (first benchmarking instance). Follow the links behind the individual headlines and you get to the code. Note that the first activity in a route is marked with a triangle. The labels denote jobIds.

noConstraints

noConstraintsAtAll

capacityConstraints

enter image description here

job 13 and 21 in same route

enter image description here

job 13 and 21 in same route AND 21 before 13

enter image description here

job 13 and 21 in same route AND 13 right after 21

enter image description here

Visit http://jsprit.github.io/ and you get to a number of code examples and docs.

*N. Christofides, A. Mingozzi, and P. Toth. The vehicle routing problem. In N. Christofides, A. Mingozzi, P. Toth, and C. Sandi, editors, Combinatorial Optimization. John Wiley, Chichester, 1979.

like image 109
Stefan Schröder Avatar answered Nov 10 '22 03:11

Stefan Schröder