1 Introduction - USNA [PDF]

Oct 27, 2014 - 1. Implement this formulation in GUSEK, and use GLPK to solve the puzzle in Figure 1. 2. Implement an int

5 downloads 3 Views 147KB Size

Recommend Stories


2018 USNA SHIP LIST
Learning never exhausts the mind. Leonardo da Vinci

Tutorial Zemax Introduction 1 1 Introduction
Just as there is no loss of basic energy in the universe, so no thought or action is without its effects,

1. introduction
Every block of stone has a statue inside it and it is the task of the sculptor to discover it. Mich

1 Introduction
When you talk, you are only repeating what you already know. But if you listen, you may learn something

1. introduction
No amount of guilt can solve the past, and no amount of anxiety can change the future. Anonymous

1. Introduction
Never let your sense of morals prevent you from doing what is right. Isaac Asimov

1. Introduction
Live as if you were to die tomorrow. Learn as if you were to live forever. Mahatma Gandhi

1 Introduction
So many books, so little time. Frank Zappa

1 Introduction
Everything in the universe is within you. Ask all from yourself. Rumi

1 Introduction
Learn to light a candle in the darkest moments of someone’s life. Be the light that helps others see; i

Idea Transcript


Sudoku Assignment SA405, Fall 2015 Instructor: Phillips Note: Assignment adapted from Sudoku, by Prof. Matt Carlyle (NPS) and CDR Jay Foraker

Figure 1: A (very difficult) Sudoku puzzle of order three.

1

Introduction

A Sudoku puzzle of order n consists of an n2 × n2 table of squares, each of which is either empty or contains one of the integers one through n2 . The goal of a Sudoku puzzle is to fill in the remaining squares with a number between one and n2 so that each row, each column, and each major n × n block contains a permutation of the numbers {1, . . . , n2 }. Figure 1 shows a puzzle of order three; to solve it we must complete each row, column, and major 3x3 block (with bold borders) with a permutation of the numbers {1, . . . , 9}. The assumption we have to make when we try to solve a Sudoku puzzle is that there is a unique way to fill in each empty square. If we are tyring to design a Sudoku puzzle, we could start with a completely full board and remove values from squares until we get to a point at which removing one more value would yield multiple solutions. To support us in both of these efforts, we present a formulation for puzzles of order three. Sets {members} Rows, columns, and values {1, ..., 9} Row and column blocks {1, 2, 3}

I, J, K P, Q Data [units]

Given value in row i ∈ I, column j ∈ J [integer 0-9]

xij

Decision Variables [units] Yi,j,k =1 if row i ∈ I column j ∈ J has value k ∈ K, 0 otherwise [binary] Formulation X

max Y

s.t.

Yi,j,k

(1)

i∈I,j∈J,k∈K

X

Yi,j,k = 1

∀i ∈ I, k ∈ K

(2)

Yi,j,k = 1

∀j ∈ J, k ∈ K

(3)

X

∀p ∈ P, q ∈ Q, k ∈ K

(4)

∀i ∈ I, j ∈ J

(5)

Yi,j,k = 1

∀ i ∈ I, j ∈ J, k ∈ K : xij = k

(6)

Yi,j,k binary

∀i ∈ I, j ∈ J, k ∈ K

j∈J

X i∈I

Yi,j,k = 1

3(p−1)

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.