• Operational Research Web Services
    • LIMOS 2012 : Webservices' Development
    • LOGO LIMOS

    •    Homepage   
    •    Svg2Png   
    •    Job shop   
    •    GPS for pedestrian   
    •    Job shop time lags   
    •    VRP   
    •    Community-based GPS    
    •    Bin packing    
    •    NFC android    
    •    Sudoku PPC    
  • Team   |   Introduction   |   Sudoku example   |   Sudoku Application

    • Developpers  
    • photo de Florian
      Florian Harscoet

      Email : florian.harscoet@etu.uca.fr
      ISIMA student
      UCA University
      1 Rue de la Chebarde, 63178 Aubière CEDEX
    • photo de Maxime
      Maxime Plard

      Email : maxime.plard@etu.uca.fr
      ISIMA student
      UCA University
      1 Rue de la Chebarde, 63178 Aubière CEDEX
     
    • Introduction to constraint programming  

      • Constraint programming ?

        • - a way to solve non-linear problems

        • - a solver of constraints based problems

     
    • Constraint programming applied to sudoku
     
    • Sudoku rules :

      • A grid of sudoku is composed of 9 rows and 9 columns packed by groups of three. The goal is to fill all the cases with digits between 1 and 9 with the following rules:
      • A digit can not appear more than once on a given row,


      • A digit can not appear more than once on a given column,

      • A digit can not appear more than once on a given block.



      Solved sudoku grid
    • The constraints using Choco Solver
    • Choco Solver :

    • We used Choco solver, which is a Java library made to use constraint programming easily. To use it, one only have to write the constraints.

    • The constraints in LP :

    • The sudoku solving problem can be summarized in linear programming as follows:

      • ∀(i,j)∈[1,9],M(i,j) : content of the matrix at (i,j)

      • ∀(i,j)∈[1,9],∀k∈[1,9] k!=i, M(k,j) != M(i,j)

      • ∀(i,j)∈[1,9],∀k∈[1,9] k!=j, M(i,k) != M(i,j)

      • ∀(i,j)∈[1,9],∀(k,l)∈[j/3*3+1,j/3*3 + 3]*[i/3*3+1,i/3*3+3] k!=i,l!=j, M(k,l) != M(i,j)

    • The constraints in Choco :

    • The sudoku solving problem in constraint programming can be summarized :

      • mon_modele.allDifferent(ligne).post();

      • mon_modele.allDifferent(colonne).post();

      • mon_modele.allDifferent(carre).post();

      • ligne, colonne and carre being an array containing the elements of, respectively, a line, a column and a square

    • Sudoku Application
     

        Application is available here : Download
        Code source available here : Download


        Picture of the software before loading a grid :
      window before grid

        Picture of the software in the menu to open a grid :
      openmenu

        Picture of the grid.txt:
      gridtxt

        Picture of the software after loading the grid:
      grid

        Picture of the software after using the solve button:
      gridsolved


     

    • Number of visitors : 3612
    |
      Last update : 15 december 2015