<< sudoku_order Utilities

Sudoku Toolbox >> Utilities > sudoku_permute

sudoku_permute

Permute a sudoku.

Calling Sequence

Y = sudoku_permute ( X )

Parameters

X:

a 9x9 matrix

Y:

a permuted 9x9 matrix.

Description

Generates a permuted sudoku Y from the sudoku X by performing permutations of rows within a band, columns within a band and bands (a set of 3 rows inside a block is a band). This way, X and Y are within the same class and, if X is a valid sudoku, then Y is a valid sudoku.

Examples

X = [
6    7    3    1    5    8    2    4    9
4    1    8    2    6    9    5    3    7
9    2    5    4    3    7    8    6    1
5    8    2    3    4    1    7    9    6
3    4    7    6    9    2    1    8    5
1    9    6    7    8    5    3    2    4
7    5    4    8    2    6    9    1    3
2    3    1    9    7    4    6    5    8
8    6    9    5    1    3    4    7    2
];
Y = sudoku_permute ( X )
Y = sudoku_permute ( X )
Y = sudoku_permute ( X )
Y = sudoku_permute ( X )

Authors


<< sudoku_order Utilities