January 2017
Intermediate to advanced
565 pages
13h 46m
English
Now that we are well versed with the various constructs from the core.logic library, let's look at some real world problems that can be solved through logic programming.
The n-queens problem is an interesting problem that can be implemented using logical relations. The objective of the n-queens problem is to place n queens on an n x n sized chessboard such that no two queens are a threat to each other. This problem is a generalization of the eight queens problem published by Max Bezzel in 1848, which involves eight queens. In fact, we can actually solve the n-queens problem for any number of queens, as long as we are dealing with four or more queens. Traditionally, this problem can be ...
Read now
Unlock full access