6

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!

1 Answer 1

14

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.