Sunday, May 03, 2009

Miss Manners 2009: yet another drools-solver example

A couple of weeks ago James Owen proposed a larger Miss Manners benchmark for rule engines on his blog.
Last weekend he posted the first dataset, so this weekend I took it upon myself to implement this "Manners 2009" as an example in drools-solver.

In Manners 2009, miss Manners is throwing a party again.
  • This time she invited 144 guests and prepared 12 round tables with 12 seats each.
  • Every guest should sit next to someone (left and right) of the opposite gender.
  • And that neighbour should have at least one hobby in common with the guest.
  • Also, this time there should be 2 politicians, 2 doctors, 2 socialites, 2 sports stars, 2 teachers and 2 programmers at each table.
  • And the 2 politicians, 2 doctors, 2 sports stars and 2 programmers shouldn't be the same kind.

Drools-solver solves this planning problem.
Here's a screenshot of a result of a table in drools-solver:

As you can see, all constraints are met. I estimate I've implemented this example in roughly 14 working hours (including the GUI work). So, with drools-solver, planning problems are easy!


  1. Nice work Geoffrey ! I hope you had some time to relax on the weekend !

  2. Geoffrey:

    Nice work indeed. I "thought" that I had set up the data correctly. The reason for giving each person three hobbies out of five was to enable an easier solution and, possibly, guarantee a solution to the problem.

    However, I rather like the idea of every third person having three hobbies, the next person having two hobbies and the next person having only one hobby. This should make it really interesting. Nobody else has submitted a solution so yours i the first.

    Now, we'll have to assign about five or seven persons to the "Puzzle Solution Committee" to judge all of the entries and solutions to see which one is the best of the bunch. That announcement will be made at Pub Night Number Three in October.

    Again, nice work. I'll look at it in more detail later.