Question: Logic Seating Problem

Birthday_LP.mw

I am attempting to solve the following using C.Loves Logicproblem package. But i do not know how to tell it either/or constaints. being a circular arrangement might also throw a spanner in the works.

Alans Birthday Logic Problem

It is Alan’s birthday and he is having a party. Seven other people will attend: Amy, Brad, Beth, Charles, Debbie, Emily and Frances.

Everyone will sit around the circular dining table. The seating arrangement must meet the following conditions:

• Amy and Alan sit together

• Brad and Beth sit together

• Charles sits next to either Debbie or Emily

• Frances sits next to Debbie

• Amy and Alan do not sit next to either Brad or Beth

• Brad does not sit next to Charles or Frances

• Debbie and Emily do not sit next to each other

• Alan does not sit next to either Debbie or Emily

• Amy does not sit next to Charles

Arrange the guests around the table to meet all of the conditions listed above.

restart:

Vars:= [Name,PN]:

Name:= [Alan,Amy, Brad, Beth, Charles, Debbie, Emily,Frances]:

PN:=[$1..8]:

Cons:= [NextTo(Amy,Alan,PN),NextTo(Brad,Beth,PN),NextTo(Charles,Debbie,PN),NextTo(Charl es,Emily,PN),NextTo(Frances,Debbie,PN),Rel(NotNextTo,Amy,Brad,PN),Rel(NotNextTo, Amy,Beth,PN),Rel(NotNextTo,Alan,Brad,PN),Rel(NotNextTo,Alan,Beth,PN),Rel(NotNext To,Brad,Charles,PN),Rel(NotNextTo,Brad,Frances,PN),

Rel(NotNextTo,Debbie,Emily,PN),Rel(NotNextTo,Alan,Debbie,PN),Rel(NotNextTo,Alan,Emily,PN),

Rel(NotNextTo,Amy,Charles,PN)]:

read "LogicProblem.mpl";

Birthday:= LogicProblem(Vars):

with(Birthday):

 

 

Please Wait...