| » ASP Competition | |
|
» Login
|
Blocked N-QueensProblem descriptionThe blocked N-queens problem is a variant of the N-queens problem. In the blocked N-queens problem we have an NxN board and N queens. Each square on the board can hold at most one queen. Some squares on the board are blocked and cannot hold any queen. A conflict arises when any two queens are assigned to the same row, column or diagonal. Input formatThe input of the blocked N-queens problem specifies the blocked squares on the board, and the number N of queens. Input data are stored in a plain text file, The format of the file is as follows:a. The file starts by defining the size of the problem (the number of queens, and all row and column indices) using a predicate "num". num(1). num(2). ... num(N). b. The file then specifies the squares on the board that are blocked, using a predicate "block" . Each fact has the form "block(i,j).", meaning that the square in row i and column j is blocked. Example input: Output formatThe solution must be encoded by a binary predicate "queen" , where "queen(i,j)" stands for "there is a queen in square (i,j)''.For the example input given above, the following is a valid assignment: queen(2,1). queen(4,2). queen(1,3). queen(3,4). The corresponding answer set produced by a solver must contain exactly these ground atoms of the form queen(i,j) Authors: Gayathri Namasivayam and Miroslaw Truszczynski |