Skip to content

Add CSPLib examples from DCP-Bench-Open#1015

Open
kostis-init wants to merge 4 commits into
masterfrom
add-missing-csplib-examples
Open

Add CSPLib examples from DCP-Bench-Open#1015
kostis-init wants to merge 4 commits into
masterfrom
add-missing-csplib-examples

Conversation

@kostis-init

Copy link
Copy Markdown
Collaborator

No description provided.

@kostis-init kostis-init requested a review from IgnaceBleukx June 12, 2026 09:08

@IgnaceBleukx IgnaceBleukx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks for the extra examples.

Most of them look very clean, but we should make sure they follow our own guidelines.
I.e., use import cpmpy as cp and cp.sum etc instead of from cpmpy import *.

Other comments are mainly related to default arguments, and what happens if we change them.

Comment thread examples/csplib/prob003_quasigroup_existence.py Outdated
Comment thread examples/csplib/prob016_traffic_lights.py Outdated
Comment thread examples/csplib/prob018_water_bucket.py Outdated

model = Model()

x = boolvar(shape=num_shifts, name="x")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so the goal is just to select the shifts, not necessarily asign them to worker too?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seems like a minimal version, in which each worker is assigned to a shift trivially.

Comment thread examples/csplib/prob022_bus_driver_scheduling.py Outdated
Comment thread examples/csplib/prob023_magic_hexagon.py Outdated
Comment thread examples/csplib/prob014_solitaire_battleships.py Outdated
Comment thread examples/csplib/prob014_solitaire_battleships.py Outdated
Comment thread examples/csplib/prob034_warehouse_location.py Outdated
Comment thread examples/csplib/prob021_crossfigures.py
@kostis-init

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback, let me know if you have any further comments!

@IgnaceBleukx IgnaceBleukx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement already.
I've had some fun with prob18 as there were lots of simplifications possible, let me know if you don't like some stuff ; )

Some more comments, and a general theme: how to handle the default case?
I would just put them as default arguments, and add asserts to ensure the dimensions of all arguments provided to the function are compatible

Comment thread examples/csplib/prob014_solitaire_battleships.py Outdated
Comment thread examples/csplib/prob016_traffic_lights.py Outdated
Comment thread examples/csplib/prob021_crossfigures.py Outdated
Comment thread examples/csplib/prob003_quasigroup_existence.py Outdated
Comment thread examples/csplib/prob003_quasigroup_existence.py Outdated
Comment thread examples/csplib/prob023_magic_hexagon.py Outdated
Comment thread examples/csplib/prob034_warehouse_location.py Outdated
Comment thread examples/csplib/prob041_n_fractions.py Outdated
Comment thread examples/csplib/prob057_killer_sudoku.py Outdated
Comment thread examples/csplib/prob067_quasigroup_completion.py Outdated
@kostis-init

Copy link
Copy Markdown
Collaborator Author

Thanks for the detailed comments, I think most of them are addressed, let me know if anything else remains!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants