Skip to content

v2.2.0

Choose a tag to compare

@rcrida rcrida released this 13 May 11:17
· 176 commits to main since this release

New features

  • BooleanDomain — singleton domain containing {true, false}, suitable for binary assignment problems
  • AtMostOneConstraint — n-ary constraint ensuring at most one boolean variable in a set is true; decomposes into pairwise binary constraints via getAsBinaryConstraints() for arc consistency and min-conflicts
  • atMostOneConstraint(Set<Variable>) — new CSP.Builder helper, consistent with allDiffConstraint

New example: timetabling as a binary assignment problem

TimetableSchedulingBinaryAssignmentTest demonstrates modelling timetabling as a multi-dimensional 0-1 assignment problem. Each variable z[lesson][teacherSlot] is a boolean that is true when a lesson is assigned to a specific teacher and room-slot combination. Constraints are expressed as atMostOneConstraint sets — one per room-slot (room conflict), one per teacher-timeslot (teacher conflict), and one per group-timeslot (student conflict). The problem is solved using MinConflictsSolver with random restarts.

This complements the graph-colouring formulation in TimetableSchedulingViaColouringTest, which models the same problem using slot-valued variables.