[bb-puzzles] Re: several messages
Constraint Logic can solve word logic puzzles.
Brought to you by:
dougedmunds
From: Carl D. <de...@ma...> - 2001-03-21 07:08:01
|
On Tue, 20 Mar 2001, Doug Edmunds wrote: > The 'Minor Confusion' puzzle is a one-pivot puzzle (a 'zebra'-type > puzzle). I do not understand this concept of "pivot". Rather than explaining it, you could help me out by directing me to a puzzle on your web site that is NOT a one-pivot puzzle. > I had not indicated that that within each group, the values were > different: that each name's variable was different from > each other, each position was different, etc. (hand coding would be A ## D, > A ## G, ...). That is what I call the SDR constraint: System of Distinct Representatives. My program only handles problems with that constraint. However, with a vast number of examples, I show that many problems that are not initially in SDR form can be put into SDR by the addition of a few dummy variables. So I would like see if I can take what you consider to be a multi-pivot puzzle and convert to a one-pivot problem. Is the terminology "pivot" standard? If so, I'll have to use it in my paper. > Eclipse has the 'alldifferent' function, used thus: > > alldifferent([A,D,G,J,R,S]), > alldifferent([BI,CH,DI,LE,ST,TI]), > alldifferent([CF,FB,PI,RF,SS,TB]), > alldifferent([BA,FO,MA,NO,PE,TR]), > alldifferent([CA,EE,GR,NA,PU,TO]), Identical to the 'Distinct' operator in my program. > I added those 5 lines to my code (copy attached) and the solution time > dropped from 12+ seconds to <.5 seconds, which is close to the time > needed just to load the file. I will be uploading the new file to the > website soon. Eclipse is a compiled language, right? I guess then that my solution time of 3 seconds in the huge, lumbering, interpretted system Maple is pretty good. I can do the zebra puzzle in .5 seconds. (All times are on an AMD K6 600 MHz or on a Sparc Ultra 1). That Eclipse time is to find the feasible solution AND prove it unique, right? That you for the references; I will check them out. I will send you my program and numerous very detailed examples of its use if you want. |