|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectExamplesJaCoP.Example
ExamplesJaCoP.SurvoPuzzle
public class SurvoPuzzle
It solves Survo puzzle. http://en.wikipedia.org/wiki/Survo_Puzzle """ Survo puzzle is a kind of logic puzzle presented (in April 2006) and studied by Seppo Mustonen. The name of the puzzle is associated to Mustonen's Survo system which is a general environment for statistical computing and related areas. In a Survo puzzle the task is to fill an m * n table by integers 1,2,...,m*n so that each of these numbers appears only once and their row and column sums are equal to integers given on the bottom and the right side of the table. Often some of the integers are given readily in the table in order to guarantee uniqueness of the solution and/or for making the task easier. """ See also http://www.survo.fi/english/index.html http://www.survo.fi/puzzles/index.html References: - Mustonen, S. (2006b). "On certain cross sum puzzles" http://www.survo.fi/papers/puzzles.pdf - Mustonen, S. (2007b). "Enumeration of uniquely solvable open Survo puzzles." http://www.survo.fi/papers/enum_survo_puzzles.pdf - Kimmo Vehkalahti: "Some comments on magic squares and Survo puzzles" http://www.helsinki.fi/~kvehkala/Kimmo_Vehkalahti_Windsor.pdf
| Field Summary |
|---|
| Fields inherited from class ExamplesJaCoP.Example |
|---|
cost, search, store, vars |
| Constructor Summary | |
|---|---|
SurvoPuzzle()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
It executes the program to solve the specified SurvoPuzzle. |
void |
model()
model() |
static void |
printMatrix(IntVar[][] matrix,
int rows,
int cols)
It prints a matrix of variables. |
void |
readFile(java.lang.String file)
readFile() Reads a Survo puzzle in the following format % From http://www.survo.fi/puzzles/280708.txt % Survo puzzle 128/2008 (1700) #364-35846 A B C D E F 1 * * * * * * 30 2 * * 18 * * * 86 3 * * * * * * 55 22 11 42 32 27 37 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SurvoPuzzle()
| Method Detail |
|---|
public void model()
model in class Example
public static void printMatrix(IntVar[][] matrix,
int rows,
int cols)
matrix - matrix containing the grounded variables.rows - number of elements in the first dimension.cols - number of elements in the second dimension.public void readFile(java.lang.String file)
file - the filename containing the problem description.public static void main(java.lang.String[] args)
args - the first argument specifies the filename containing the puzzle to be solved.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||