Related jobs in JSprit

浪子不回头ぞ 提交于 2019-11-27 18:44:54

问题


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:


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

capacityConstraints

job 13 and 21 in same route

job 13 and 21 in same route AND 21 before 13

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

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.



来源:https://stackoverflow.com/questions/24447451/related-jobs-in-jsprit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!