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



The loading routines for the TIM file format. I am not sure what (if anything) TIM stands for. The format has been used by the |International Timetabling Competition| which has been run twice so far (2002,2007). Problems in this format can be found on their websites.



data RawTimeTableProblem Source

This is intended to be an internal format only, though I will provide access and visibility to it so that it can be inspected by other programs. In practice I do not expect users to operate upon the raw problem, but instead upon TimeTable.

parseFile :: Parser RawTimeTableProblemSource

parseFile is a file parser for the tim format. For the output format, the FullyDescriptiveTimeTableProblem data type, I have included a number of slots per day and number of days. These are constants in this loading routine.

loadTIMFileRaw :: String -> IO RawTimeTableProblemSource

Load in a TIM file, but keep the data in the original form, as a large number of grids of bits.

loadTIMFile :: String -> IO TimeTableSource

Load a TIM file, and transform it into the constrained data format so that the look up tables no longer give back just ones and zeros, but lists of valid options. This should be easier to work with.

convertToConstrainedProblem :: RawTimeTableProblem -> TimeTableSource

Use the raw data to constrain problem. Only rooms that can reasonably be chosen (feature and size constraints) should be available for specific events and so on. In short I am doing my own constraint (hard coded urg) processing here.

rawToCSV :: RawTimeTableProblem -> StringSource

This is for human readability. It will take a raw format and return a comma and new line separated format as a String. Dump the string to a file and it should now be easy to load into a spread sheet and inspect. I was not comfortable incoding this as a |show| function, it seems to me that there is far too much information here to easily display it to a user, at least in a terminal window.