EXCALIBUR
Adaptive Constraint-Based Agents in Artificial Environments

[CONSTRAINT PROGRAMMING]   [Example]

[ Please note: The project has been discontinued as of May 31, 2005 and is superseded by the projects of the ii Labs. There won't be further updates to these pages. ]

The "Send More Money" Problem

(Related publication: [PUBLink])

The example describes the classic crypt-arithmetic puzzle "send more money". A different digit for each letter of the following equation has to be found:

  S E N D
+ M O R E
---------
M O N E Y

The "Send More Money" Specification

To specify the problem for a constraint solver, we have to declare the variables and their domains:

S, E, N, D, M, O, R, Y    {0..9}

In addition, the problem involves the following two constraints:

                    1000 × S + 100 × E + 10 × N + D 
1)                + 1000 × M + 100 × O + 10 × R + E 
      = 10000 × M + 1000 × O + 100 × N + 10 × E + Y
2)    alldifferent({S, E, N, D, M, O, R, Y})

The "Send More Money" Solution

Giving this information to a constraint solver, a solution is produced immediately:

{S = 2, E = 8, N = 1, D = 7, M = 0, O = 3, R = 6, Y = 5}

Notice that there was no solving method given. The solver produced only one solution, but of course all other possible solutions can be listed as well. If special solutions are prefered, an optimization can be applied.


[CONSTRAINT PROGRAMMING]   [Example]

For questions, comments or suggestions, please contact us.

Last update:
May 19, 2001 by Alexander Nareyek