Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #10254

Re: Sumbrero puzzle solver

From mhx@iae.nl (Marcel Hendrix)
Subject Re: Sumbrero puzzle solver
Newsgroups comp.lang.forth
Message-ID <69911215008435@frunobulax.edu> (permalink)
Date 2012-03-20 23:12 +0200
References <58671515008435@frunobulax.edu>
Organization Wanadoo

Show all headers | View raw


mhx@iae.nl (Marcel Hendrix) writes Subject: Re: Sumbrero puzzle solver
[..]
>> Reducing the solution space is a core topic in constraint programming.
>> see f.ex.
>> http://kti.ms.mff.cuni.cz/~bartak/constraints/index.html

> I learned a few interesting things there. Unfortunately/amazingly these
> codes all seem to be proprietary.
[..]

MINION isn't proprietary, is very good (at most 200x slower than handcoded), 
and has a very easy to understand syntax.  

-marcel

-- ----------------------
MINION 3

**VARIABLES**

BOUND a {1..9}
BOUND b {1..9}
BOUND c {1..9}
BOUND d {1..9}
BOUND e {1..9}
BOUND f {1..9}
BOUND g {1..9}
BOUND h {1..9}
BOUND i {1..9}
BOUND j {1..9}
BOUND k {1..9}
BOUND l {1..9}
BOUND m {1..9}
BOUND n {1..9}
BOUND o {1..9}

**SEARCH** 

PRINT [ [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o] ]

**CONSTRAINTS**

sumgeq([a,d], 4)
sumleq([a,d], 4)
alldiff([a,d])

sumgeq([b,e,g,j], 10)
sumleq([b,e,g,j], 10)
alldiff([b,e,g,j])

sumgeq([c,f,h,k,m], 26)
sumleq([c,f,h,k,m], 26)
alldiff([c,f,h,k,m])

sumgeq([i,l,n], 14)
sumleq([i,l,n], 14)
alldiff([i,l,n])

sumgeq([b,f,i], 7)
sumleq([b,f,i], 7)
alldiff([b,f,i])

sumgeq([a,e,h,l,o], 19)
sumleq([a,e,h,l,o], 19)
alldiff([a,e,h,l,o])

sumgeq([d,g,k,n], 14)
sumleq([d,g,k,n], 14)
alldiff([d,g,k,n])

sumgeq([j,m], 13)
sumleq([j,m], 13)
alldiff([j,m])

sumgeq([a,b,c], 6)
sumleq([a,b,c], 6)
alldiff([a,b,c])

sumgeq([d,e,f], 7)
sumleq([d,e,f], 7)
alldiff([d,e,f])

sumgeq([g,h,i], 10)
sumleq([g,h,i], 10)
alldiff([g,h,i])

sumgeq([j,k,l], 18)
sumleq([j,k,l], 18)
alldiff([j,k,l])

sumgeq([m,n,o], 14)
sumleq([m,n,o], 14)
alldiff([m,n,o])

**EOF**

C:\minion\minion-0.12\bin>minion sumbrero5x3.minion
# Minion Version 0.12
# Git version: 65512633daee570de1fdf16a0025d919f6f3753e
# Git last changed date: Mon Feb 8 17:33:56 2010 +0000
# Run at: UTC Tue Mar 20 21:57:52 2012

# http://minion.sourceforge.net
# Minion is still very new and in active development.
# If you have problems with Minion or find any bugs, please tell us!
# Mailing list at: https://mail.cs.st-andrews.ac.uk/mailman/listinfo/mug
# Input filename: sumbrero5x3.minion
# Command line: minion sumbrero5x3.minion
Parsing Time: 0.031200
Setup Time: 0.015600
First Node Time: 0.000000
Initial Propagate: 0.000000
First node time: 0.000000
Sol: 3 1 2 1 2 4 3 5 2 4 6 8 9 4 1

Solution Number: 1
Time:0.000000
Nodes: 6

Solve Time: 0.000000
Total Time: 0.046800
Total System Time: 0.031200
Total Wall Time: 0.179000
Maximum Memory (kB): 0
Total Nodes: 6
Problem solvable?: yes
Solutions Found: 1

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-10 18:24 +0200
  Re: Sumbrero puzzle solver David Kuehling <dvdkhlng@gmx.de> - 2012-03-11 00:30 +0100
    Re: Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-11 01:25 +0200
      Re: Sumbrero puzzle solver David Kuehling <dvdkhlng@gmx.de> - 2012-03-11 23:27 +0100
        Re: Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-19 00:00 +0200
          Re: Sumbrero puzzle solver "A. K." <akk@nospam.org> - 2012-03-19 08:24 +0100
            Re: Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-20 20:36 +0200
              Re: Sumbrero puzzle solver mhx@iae.nl (Marcel Hendrix) - 2012-03-20 23:12 +0200
              Re: Sumbrero puzzle solver "A. K." <akk@nospam.org> - 2012-03-21 12:06 +0100
  Re: Sumbrero puzzle solver "A. K." <minforth@arcor.de> - 2012-03-11 12:10 +0100
    Re: Sumbrero puzzle solver "A. K." <akk@nospam.org> - 2012-03-12 21:51 +0100
  Re: Sumbrero puzzle solver Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-11 19:22 +0000
    Re: Sumbrero puzzle solver David Kuehling <dvdkhlng@gmx.de> - 2012-03-11 22:35 +0100
    Re: Sumbrero puzzle solver C G Montgomery <cgm@physics.utoledo.edu> - 2012-03-11 18:23 -0400

csiph-web