How to constraint transportation time to successor within limit in CP-SAT

42 views
Skip to first unread message

YINXIONG CHEN

unread,
Aug 28, 2025, 4:57:57 AMAug 28
to or-tools-discuss
I am using cp.SAT 9.14 cpModel for a scheduling problem. Basically is to schedule jobs to workers. Jobs are workers are located in different latitude and longitude. 

The requirement is to constraint workers do not spend more than X hours on transportation time when transit from one job to another. 

add_circuit is able to achieve this by removing the edge when transportation time between lat-long of two nodes is larger than X hours. But it is very time consuming. 

Is there any other way to achieve that?

YINXIONG CHEN

unread,
Aug 28, 2025, 5:11:07 AMAug 28
to or-tools-discuss
Forgot to mention how do I build circuit. Each workorder as one node. 

1. Build one circuit for one worker in one day. If there are 5 workers and 7 days to schedule, there will be 35 circuits. All possible nodes for the user will be in every circuit.
2. Remove edge if transportation time is more than X hours.
3. Remove one direction from edges if a subset of nodes are precedence. 

Reply all
Reply to author
Forward
0 new messages