combinatorial-problems-0.0.5: A number of data structures to represent and allow the manipulation of standard combinatorial problems, used as test problems in computer science.

MaintainerRichard Senington <>
Safe HaskellSafe-Inferred



A library for the representation and manipulation of Time Tabling Problems. Still experimental and not particularly general. The underlying problem description is that used by the International Timetabling Competition, and the code is rather specialised towards that, with the aim of being used for meta-heuristics.



data TimeTable Source

Core concepts, location, timeslot, person, two events cannot happen in the same place at the same time. This version expects a constrained data set, so that the roomEvent lookup for example only yields events that can reasonably be scheduled in that room.

Originally I intended the objectives (low over scheduling of people) and the soft objectives to be handled somewhere else. At this time, I am unsure how to abstract this, and I want a system that works now, so I will over specialise to the time tabling competition specifications. Hopefully this can be rectified in a later version.


viewConstrainedProblem :: TimeTable -> StringSource

Splitting off the two parts of show, so we have a simple show for the state of the solution, a more complex solution description and the constant constrained problem.

descheduleEvent :: EventNumber -> TimeTable -> TimeTableSource

Fails silently if the event is not currently scheduled.

descheduleSlot :: TimeSlot -> RoomNumber -> TimeTable -> TimeTableSource

Fails silently if the time slot and room number are not booked.

schedule :: TimeSlot -> RoomNumber -> EventNumber -> TimeTable -> TimeTableSource

Fails silently and does no update the schedule if the very hard constraints fail.

viewTimeTableDetails :: TimeTable -> StringSource

The other part of the time table data type. See the current status of the solution.

ittcValidity :: TimeTable -> BoolSource

The validity function as specific by the 2002 competition rules. Basically no clashes at this point.

ittcObjectiveValue :: TimeTable -> IntSource

The objective function as specific by the 2002 competition rules.

timeTableDetailsAsCSV :: TimeTable -> StringSource

A simple spread sheet display seems like a good idea.

timeTableForRoomAsCSV :: TimeTable -> RoomNumber -> StringSource

Maybe a helper, making it public anyway.

currentlyScheduledEvents :: TimeTable -> [EventNumber]Source

Just a combination of existing useful functions.