Posts

Showing posts with the label Solving

Computer Science: It Is Not Programming But Problem Solving

I have had the pleasure and the opportunity to do one of my favorite hobbies in the past two years, and that is teaching. I have had the opportunity of teaching several different topics in the field of computer science, from introductory courses to upper division courses, and I have seen a pattern along the students which has been a puzzle for me especially in the upper division classes. One of the main surprising facts I have noticed, is that most of the students have little or no practical experience in software development, especially in the upper division classes. That is, they have not been given enough opportunity to do hands on projects to improve and fine tune their programming skills in the lower division classes, and when they take courses such as Software Engineering, most of them don’t have the ability to create a fully functional system from the ground up. Now I can understand if this is the first year for the student and they are just starting out and getting to know...

Solving the Sudoku Using Integer Programming

A 9 X9 SUDOKU puzzle has the following rules. Every row and column should have the numbers between 1 and 9 and each of the inner boxes should have the numbers between 1 and 9. Each number in every column and row and in every small box should occur only once. Let us just define Xijk for all values of I, j and k from 1 to 9 to be 1. If the cell (I,j) contains the number k where I, j and k all range between 1 and 9. Here I denotes the ith row and j denotes the jth column and k denotes an integer between 1 and 9. When X134 = 1, it means that the cell (1,3) contains the number 4. This would also imply that none of the other elements of the 1st row or the 3rd column except the cell (1,3) can be equal to 4. In order to model the SUDOKU we will use a total of 729 variables. Let us now algebraically formulate each of the three class of rules. Every row should contain a number between 1 and 9 exactly only once. For the first row, this rule would appear as ( termed as “Constraint” In t...