timefold-solver icon indicating copy to clipboard operation
timefold-solver copied to clipboard

Using overconstraint with way more shifts than people can handle seems to make hard constraints unusable

Open athoik opened this issue 1 year ago • 1 comments

Dear TimefoldAI,

Describe the bug I created a basic demonstration of a timeshift employee schedule. It uses overconstraint in order to leave unassinged shifts. But having extra shifts, way more that people can handle, the hard constraint consecutive_employee_shift_assignments breaks without written on the solver summary.

Expected behavior In the uploaded sample available here https://github.com/athoik/timefold I am creating more shifts than employees can handle. Having a hard constraint applied we expect some shifts to stay unassigned, taking into consideration that overconstraint is enabled too.

Actual behavior All employes are getting shifts, without hard contraint consecutive_employee_shift_assignments complaining.

To Reproduce Here is a sample to reproduce issue https://github.com/athoik/timefold

Environment

Timefold Solver Version or Git ref:

timefold 1.16.0b0

Output of java -version:

java version "23.0.1" 2024-10-15
Java(TM) SE Runtime Environment (build 23.0.1+11-39)
Java HotSpot(TM) 64-Bit Server VM (build 23.0.1+11-39, mixed mode, sharing)

Output of uname -a or ver:

Linux PC 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 GNU/Linux

Thank you for your great support!

Regards, Athanasios

athoik avatar Dec 06 '24 15:12 athoik

Hello @athoik, and thanks for reporting! What you're reporting looks like a bug - we'll look into it when time permits.

triceo avatar Dec 10 '24 05:12 triceo

As of today, Timefold halted any further development of the Python solver. Find out more here: https://github.com/TimefoldAI/timefold-solver/discussions/1698

Closing this issue.

triceo avatar Jul 11 '25 11:07 triceo

Hi @triceo

We also experience this issue and it has been opened wit the java solver, might the python label tag be a mistake?

Thank you!

L-U-C-K-Y avatar Jul 21 '25 15:07 L-U-C-K-Y

@L-U-C-K-Y The original reproducer came in Python, which is why the label was applied - but you are right, this is not related to Python and is likely to work the exact same way with Java. Thanks for pointing this out.

At the same time, I do not believe that this is a bug - rather a modeling issue. I recommend writing a test for the constraint and tweaking the constraint until the test passes. Alternatively, feel free to start a conversation with the community as to what the best way of modeling this might be.

triceo avatar Jul 21 '25 15:07 triceo