While employing a naive Ruby-based CSP solver for the storybook project, which attempts to perform a variant on a scheduling problem, I wondered whether I was using the wrong tool for the job.
This is a series of experiments comparing different languages for this job. I'll start with Ruby, then move onto Clojure, and then end at Prolog. The goals of this project are to learn how language design affects the way I think about the problem space, and to learn about the real-world application of CSPs.
A volunteer must, each week, assign a book bag to each student. Write a CSP solver to generate a book-bag assignment plan for that week, given the following constraints:
- All students must receive a book-bag.
- Each book-bag may only be assigned to one student at a time.
- A student may not be assigned a book-bag s/he has received before.