Abstract

In this paper we consider modeling techniques for the mathematical puzzle KenKen. It is an interesting puzzle from modeling point of view since it has different kind of mathematical restrictions that are not trivial to express as linear constraints. We give an integer program for solving KenKen and and its implementation on modeling language AMPL. Our integer program uses an innovative way for converting product restrictions into linear constraints. It can be also used for teaching various integer programming techniques in an Operations Research course.

Highlights

  • A KenKen puzzle is a grid of n by n cells

  • The numbers entered into a cage must combine to produce the target number using the arithmetic operation

  • While the binary variables defined are useful for giving the Latin square constraints, there is not a good way of using them to express the arithmetic restrictions by linear constraints

Read more

Summary

Introduction

A KenKen puzzle is a grid of n by n cells (see Figure 1). An additional feature of KenKen (compared to a similar puzzle Sudoku) is that the grid is partitioned into “cages”. The top left corner of each cage has a target number and an arithmetic operation (sum, difference, product, ratio). The numbers entered into a cage must combine (in any order) to produce the target number using the arithmetic operation. Thanks to its mathematical constraints, it creates a different level of interest and challenge for the solver. It is a more challenging task to create a mathematical model that can solve the puzzle.

Melkonian
Latin Square Constraints
Addition Constraints
Difference Constraints
Division Constraints
Product Constraints
Method 1 for Product Restrictions
The AMPL Model and Its Solution
The AMPL Model
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call