I'm working on some code that does seating arrangements subject to various contraints in core.logic. Unfortunately, no matter how I seem to express the problem, it takes quite a long time and results in a stack overflow error.
There are 5 tables, with 5 seats per table and a list of 25 guests. There are facts for the ages of the guests and their family relationships. I started an unconstrained (random) arrangement, and that worked fine. Now I've added the constraint that children <= 13 years old must be seated with at least one parent. Seating any number of tables < 5 works quickly, but trying to seat all 5 tables never works in either version of the code. The code is here: https://gist.github.com/metajack/16546860f9ecd22de343 The first version (seatmap2.clj) tries to seat a table at at time and takes the leftover guests to the next tables. The second version (seatmap2b) tries to seat a guest at a time, perhaps also seating a parent if the guest is <= 13 years old. Can anyone offer me any guidance on why the full arrangement can't be completed or suggestions on how to refactor the problem so that it won't have this issue? Thanks, jack. -- You received this message because you are subscribed to the Google Groups "minikanren" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/minikanren. For more options, visit https://groups.google.com/d/optout.
