SlideShare a Scribd company logo
Sudoku solving with CVXOPT




                        Sudoku solving with CVXOPT

                                     Ben Moran
                             http://transnite.wordpress.com

                                 09 December 2009
Sudoku solving with CVXOPT
  Background




      1 Background



      2 Sudoku as matrix and vectors



      3 Sparsity and solving



      4 Conclusion
Sudoku solving with CVXOPT
  Background
Sudoku solving with CVXOPT
  Background



Based on. . .


              a paper by Babu, Pelckmans, Stoica:
                   Linear Systems, Sparse Solutions, and Sudoku   1

              Solve Sudoku by turning it into a linear programming problem,
              inspired by new signal processing paradigm: compressed
              sensing 2
              I thought it was interesting and reimplemented it in Python
              with CVXOPT



         1
             http://www.it.uu.se/katalog/praba420/Sudoku.pdf
         2
             http://nuit-blanche.blogspot.com/
Sudoku solving with CVXOPT
  Background



Why?




            Ben Laurie - Sudoku is a   denial of service attack on human

            intellect

            It's a solved problem!
Sudoku solving with CVXOPT
  Background



Existing solutions


             Knuth's Dancing Links (DLX)     3

             Norvig's constraint propagation (also Python)    4

             Sinkhorn method 5
             And many others




         3
           http://en.wikipedia.org/wiki/Dancing_Links
         4
           http://norvig.com/sudoku.html
         5
           http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=4802290arnumber=4804
Sudoku solving with CVXOPT
  Background



But. . .


            This is still an interesting way into the brand new eld of
            compressed sensing
            And what have Sudoku got to do with. . .
                  signal processing
                  sensor networks
                  single-pixel cameras
                  satellite imaging?
            Our solution will be interesting, as the solver won't know the
            rules of Sudoku at all!
Sudoku solving with CVXOPT
  Sudoku as matrix and vectors



What are linear systems?

             Matrix - Vector multiplication

                                 1 3           2         11
                                                    =
                                 4 −1          3          5
                                          Ax   =b
             In Python:
             import numpy
             numpy . m a t r i x ( ' 1 3 ; 4 −1 ' ) ∗ 
                   numpy . m a t r i x ( ' 2 ; 3 ' )
            matrix ( [ [ 1 1 ] ,
                       [ 5]])
Sudoku solving with CVXOPT
  Sudoku as matrix and vectors



Solving a linear system


             Given
                    1 3                          11
             A   =                and   b   =          , what is x?
                    4 −1                          5
             In Python:
             import numpy
             numpy . l i n a l g . s o l v e ( numpy . m a t r i x ( ' 1 3 ; 4 −1 ' ) ,
                                                  numpy . m a t r i x ( ' 1 1 ; 5 ' ) )
            matrix ( [ [ 2 . ] ,
                       [ 3.]])
Sudoku solving with CVXOPT
  Sudoku as matrix and vectors



Sudoku board as an indicator vector
             We can turn a 9x9 Sudoku board into a single vector with
             9x9x9 = 729 elements
             Each 9 entries corresponds to one cell, most are zero
             Put a 1 in the rst place for 1, in the second place for 2. . .
             p = Problem (  1 2 . .  ,N=2)
             numpy . m a t r i x ( p . t o _ i n d i c a t o r _ v e c t o r ( ) , ' i ' )
            matrix ( [ [ 1 ] ,
                       [ 0 ],
                       [ 0 ],
                       [ 1 ],
                       [ 0 ],
                       [ 0 ],
                       [ 0 ],
                       [ 0 ]])
Sudoku solving with CVXOPT
  Sudoku as matrix and vectors



Sudoku rules as a matrix system
             Now we can set up a special matrix to enforce the rules of
             Sudoku
             It will have one row for each constraint, and 9x9x9 = 729
             columns
             When you multiply this with the indicator vector, you

             get all 1's if the board is valid

             Here are some of the rules for 2x2 Sudoku:
             p = Problem (  1 2 . .  ,N=2)
             numpy . m a t r i x ( p . m a t r i x ( ) )
            matrix ( [ [ 1 , 1 , 0 , 0 , 0 ,                  0,   0,   0.]   ,
                       [ 0, 0, 1, 1, 0,                       0,   0,   0.]   ,
                       [ 0, 0, 0, 0, 1,                       1,   0,   0.]   ,
                       [ 0, 0, 0, 0, 0,                       0,   1,   1.]   ,
                       [ 1, 0, 1, 0, 0,                       0,   0,   0.]   ,
                                                  ...
                       [ 0, 0, 0, 1, 0,                       0,   0,   0.]])
Sudoku solving with CVXOPT
  Sudoku as matrix and vectors



Rules for 2x2 Sudoku

                                 1 2
                                 _ _
Sudoku solving with CVXOPT
  Sudoku as matrix and vectors



                             _   _   _   1   5   _    _   7    _
                                                                  
                            1   _   6   _   _   _    8   2    _   
                             3   _   _   8   6   _    _   4    _
                                                                  
                                                                  
                             9   _   _   4   _   _    5   6    7
                                                                  
                                                                  
                             _   _   4   7   _   8    3   _    _
                                                                  
                                                                  
                             7   3   2   _   _   6    _   _    4
                                                                  
                                                                  
                             _   4   _   _   8   1    _   _    9
                                                                  
                                                                  
                                                                  
                            _   1   7   _   _   _    2   _    8   
                             _   5   _   _   3   7    _   _    _
                                 Figure: Full size 9x9 board
Sudoku solving with CVXOPT
  Sudoku as matrix and vectors




                                 Figure: Full size 9x9 rules matrix
Sudoku solving with CVXOPT
  Sparsity and solving



What do we gain by writing Sudoku like that?


            We can check solutions with a matrix-vector multiply
                  Turn the proposed solution into an indicator vector
                  Multiply it with the the rules matrix
                  If the solution is valid, the answer will be all ones
            Solve Ax = [1 1 1 1 1] to nd the answer?
            . . . No - there is an innite number of answers, most won't
            give valid boards
            Need something else to nd our true correct answer
Sudoku solving with CVXOPT
  Sparsity and solving



Sparsity

            The true solution if it exists will be the   sparsest

            (Sparse vector == mostly zeros)
                                        0                        3
                                                                   
                                       1                      1    
                                        0                       0.1
                                                                   
                                                                   
                             Sparse    0    vs non-sparse     4
                                                                   
                                                                      
                                        0                       −2
                                                                   
                                                                   
                                        1                        1
                                                                   
                                                                   
                                        0                       .5
            That still doesn't help. . . no ecient method to solve that
            directly
Sudoku solving with CVXOPT
  Sparsity and solving



Dierent kinds of distance: L-2 norm, Pythagoras

            You measure the length of a vector with a              norm

            This is an       L-p   norm (for a 3d vector):

                                      (|x1 |p + |x2 |p + |x3 |p )1/p
            If you plug in p=2, you get normal Euclidean distance
            (Pythagoras' theorem):

                                         (|x1 |2 + |x2 |2 + |x3 |2 )
            We can choose the solution with the smallest L2-norm. . .
Sudoku solving with CVXOPT
  Sparsity and solving



Dierent kinds of distance: L-2 norm, Pythagoras
            But we don't get a valid answer
           # Least squares s o l u t i o n
            M = numpy . m a t r i x ( s a m p l e ( ) . m a t r i x ( ) )
            o n e s =numpy . o n e s ( (M. s h a p e [ 0 ] , 1 ) )
            v = numpy . l i n a l g . p i n v (M) ∗ o n e s
            (M∗ v ) [ : 4 ]
           matrix ( [ [ 1 . ] ,
                       [ 1.] ,
                       [ 1.] ,
                       [ 1.]])
            v [ : 4 ]
           matrix ([[ −0.0735114 ] ,
                       [ 0.24178992] ,
                       [ 0.00310795] ,
                       [ 0.28139045]])
Sudoku solving with CVXOPT
  Sparsity and solving



Dierent kinds of distance: L-0 norm, sparsity



            Plug in   p=0    and you get L0, sparsity (number of non-zeros):

                                     |x1 |0 + |x2 |0 + |x3 |0
            The right solution    will   have the lowest L0 norm
            But we've no way of nding it, besides solving the Sudoku!
Sudoku solving with CVXOPT
  Sparsity and solving



Dierent kinds of distance: L-1 norm
            With   p=1       you get the absolute sum, taxicab distance

                                       |x1 |1 + |x2 |1 + |x3 |1
Sudoku solving with CVXOPT
  Sparsity and solving



Why is L-1 important?



            There are ecient methods of solving it (linear programming)
            And for many matrices, the minimum L1 norm solution turns
            out to also minimize L0
            (Smallest L1 then nds the sparsest solution)
            This insight is central to the compressed sensing revolution
Sudoku solving with CVXOPT
  Sparsity and solving



Python - CVXOPT


              Now we can install    python-cvxopt
                                                    6   and solve the problem!
              CVXOPT is a GPL library for optimization
                   linear programming
                   Other kinds of convex optimization
              We can use it to nd the solution x of Ax=b, with the smallest
              L1-norm
              The result comes out as a binary vector of 0s and 1s (without
              being constrained to do so!)



         6
             http://abel.ee.ucla.edu/cvxopt/
Sudoku solving with CVXOPT
  Sparsity and solving



Python - CVXOPT
            After all that work to set up the question, the answer is one
            line!
            h e l p c v x o p t . s o l v e r s . l p
           Help on f u n c t i o n l p i n module c v x o p t . c o n e p r o g :

            l p ( c , G , h , A=None , b=None , s o l v e r=None , . . . )
                    S o l v e s a p a i r o f p r i m a l and d u a l LPs
                            minimize          c ' ∗x
                            s u b j e c t t o G∗ x + s = h
                                              A∗ x = b
                                              s = 0
            ...

           # S o l v e w i t h CVXOPT
            c v x o p t . s o l v e r s . l p ( c0 , G , hh )
Sudoku solving with CVXOPT
  Conclusion



Caveats


            This won't solve every Sudoku - it tends to solve the easier
            ones
            It fails when the L1 minimum doesn't nd the L0 minimum
            There are other methods, from the compressed sensing
            literature, like iterative reweighting, that solve more
            For Sudoku, which puzzles are hard  why is still an open
            problem at the frontiers of research
Sudoku solving with CVXOPT
  Conclusion



Compressed sensing

              Very many important, real world signals are sparse: images,
              sounds, gene expressions
              Instead of capturing the raw signal and compressing. . .
              . . . compressed sensing means you can capture them
              pre-compressed, with fewer measurements
                   (below the Nyquist rate: 44.1kHz CDs to play back 22kHz
                   frequencies)
              Less hardware needed will mean better images or cheaper kit
              Single-pixel camera   7



         7
             http://dsp.rice.edu/cscamera
Sudoku solving with CVXOPT
  Conclusion



Code, links and slides



            Code is at http://github.com/benmoran/L1-Sudoku/
            Sporadic blog: http://transnite.wordpress.com
            Find CVXOPT at
            http://abel.ee.ucla.edu/cvxopt/examples/index.html
            And the nice CVXMOD wrapper at http://cvxmod.net

More Related Content

What's hot

Lesson 1: Functions and their representations (slides)
Lesson 1: Functions and their representations (slides)Lesson 1: Functions and their representations (slides)
Lesson 1: Functions and their representations (slides)
Matthew Leingang
 
D0111720
D0111720D0111720
D0111720
IJRES Journal
 
Protein Secondary Structure Prediction using Deep Learning methods
Protein Secondary Structure Prediction using Deep Learning methodsProtein Secondary Structure Prediction using Deep Learning methods
Protein Secondary Structure Prediction using Deep Learning methods
Chrysoula Kosma
 
A fusion of soft expert set and matrix models
A fusion of soft expert set and matrix modelsA fusion of soft expert set and matrix models
A fusion of soft expert set and matrix models
eSAT Journals
 
Logic gates
Logic gatesLogic gates
Unification and Refactoring of Clones
Unification and Refactoring of ClonesUnification and Refactoring of Clones
Unification and Refactoring of ClonesNikolaos Tsantalis
 
C0531519
C0531519C0531519
C0531519
IOSR Journals
 
Ch1 2 (2)
Ch1 2 (2)Ch1 2 (2)
Ch1 2 (2)
Selvi Thangavel
 
08 - Complexity
08 - Complexity08 - Complexity
08 - Complexity
Tudor Girba
 
LEC 6-DS ALGO(updated).pdf
LEC 6-DS  ALGO(updated).pdfLEC 6-DS  ALGO(updated).pdf
LEC 6-DS ALGO(updated).pdf
MuhammadUmerIhtisham
 
Int Math 2 Section 6-6 1011
Int Math 2 Section 6-6 1011Int Math 2 Section 6-6 1011
Int Math 2 Section 6-6 1011
Jimbo Lamb
 
Integrated Math 2 Section 6-6
Integrated Math 2 Section 6-6Integrated Math 2 Section 6-6
Integrated Math 2 Section 6-6
Jimbo Lamb
 
RNN sharing at Trend Micro
RNN sharing at Trend MicroRNN sharing at Trend Micro
RNN sharing at Trend Micro
Chun Hao Wang
 

What's hot (16)

Lesson 1: Functions and their representations (slides)
Lesson 1: Functions and their representations (slides)Lesson 1: Functions and their representations (slides)
Lesson 1: Functions and their representations (slides)
 
Derivadas
DerivadasDerivadas
Derivadas
 
D0111720
D0111720D0111720
D0111720
 
Protein Secondary Structure Prediction using Deep Learning methods
Protein Secondary Structure Prediction using Deep Learning methodsProtein Secondary Structure Prediction using Deep Learning methods
Protein Secondary Structure Prediction using Deep Learning methods
 
A fusion of soft expert set and matrix models
A fusion of soft expert set and matrix modelsA fusion of soft expert set and matrix models
A fusion of soft expert set and matrix models
 
Logic gates
Logic gatesLogic gates
Logic gates
 
Unification and Refactoring of Clones
Unification and Refactoring of ClonesUnification and Refactoring of Clones
Unification and Refactoring of Clones
 
Sect1 6
Sect1 6Sect1 6
Sect1 6
 
C0531519
C0531519C0531519
C0531519
 
Ch1 2 (2)
Ch1 2 (2)Ch1 2 (2)
Ch1 2 (2)
 
08 - Complexity
08 - Complexity08 - Complexity
08 - Complexity
 
LEC 6-DS ALGO(updated).pdf
LEC 6-DS  ALGO(updated).pdfLEC 6-DS  ALGO(updated).pdf
LEC 6-DS ALGO(updated).pdf
 
Int Math 2 Section 6-6 1011
Int Math 2 Section 6-6 1011Int Math 2 Section 6-6 1011
Int Math 2 Section 6-6 1011
 
Integrated Math 2 Section 6-6
Integrated Math 2 Section 6-6Integrated Math 2 Section 6-6
Integrated Math 2 Section 6-6
 
RNN sharing at Trend Micro
RNN sharing at Trend MicroRNN sharing at Trend Micro
RNN sharing at Trend Micro
 
Semi-Magic Squares From Snake-Shaped Matrices
Semi-Magic Squares From Snake-Shaped MatricesSemi-Magic Squares From Snake-Shaped Matrices
Semi-Magic Squares From Snake-Shaped Matrices
 

Viewers also liked

Sudoku
SudokuSudoku
Sudoku powerpoint
Sudoku powerpointSudoku powerpoint
Sudoku powerpoint
union40
 
Sudoku ppt
Sudoku pptSudoku ppt
Presentation - Sudoku Assignment
Presentation - Sudoku  AssignmentPresentation - Sudoku  Assignment
Presentation - Sudoku Assignment
Cj Uni
 
Sudoku
SudokuSudoku
Intelligent Sudoku Solver
Intelligent Sudoku SolverIntelligent Sudoku Solver
Intelligent Sudoku Solver
Amrish Jhaveri
 
บทเรียนการพัฒนาระบบเครือข่ายบริการทางการแพทย์
บทเรียนการพัฒนาระบบเครือข่ายบริการทางการแพทย์บทเรียนการพัฒนาระบบเครือข่ายบริการทางการแพทย์
บทเรียนการพัฒนาระบบเครือข่ายบริการทางการแพทย์
Thira Woratanarat
 
การดูแลสุขภาพระยะยาวเขตบริการสุขภาพที่ 9
การดูแลสุขภาพระยะยาวเขตบริการสุขภาพที่ 9การดูแลสุขภาพระยะยาวเขตบริการสุขภาพที่ 9
การดูแลสุขภาพระยะยาวเขตบริการสุขภาพที่ 9
ทอง บุญยศ
 
Clinical Practice Guideline for Dementia 2008
Clinical Practice Guideline for Dementia 2008Clinical Practice Guideline for Dementia 2008
Clinical Practice Guideline for Dementia 2008
Utai Sukviwatsirikul
 
ซูโดกุ สสวท
ซูโดกุ สสวทซูโดกุ สสวท
ซูโดกุ สสวท
Nat Krub
 
แนวทางเวชปฏิบัติภาวะสมองเสื่อม 2557
แนวทางเวชปฏิบัติภาวะสมองเสื่อม 2557แนวทางเวชปฏิบัติภาวะสมองเสื่อม 2557
แนวทางเวชปฏิบัติภาวะสมองเสื่อม 2557
Utai Sukviwatsirikul
 
การทบทวนสถานการณ์และกลไกจัดการความแตกฉานด้านสุขภาพ
การทบทวนสถานการณ์และกลไกจัดการความแตกฉานด้านสุขภาพการทบทวนสถานการณ์และกลไกจัดการความแตกฉานด้านสุขภาพ
การทบทวนสถานการณ์และกลไกจัดการความแตกฉานด้านสุขภาพ
Thira Woratanarat
 
Sudoku Solving with Computational Intelligence
Sudoku Solving with Computational IntelligenceSudoku Solving with Computational Intelligence
Sudoku Solving with Computational Intelligence
haraldhiss
 
คู่มือ การสื่อสารกับผู้ป่วยชาวต่างชาติ โรงพยาบาลนพรัตนราชธานี
คู่มือ การสื่อสารกับผู้ป่วยชาวต่างชาติ โรงพยาบาลนพรัตนราชธานีคู่มือ การสื่อสารกับผู้ป่วยชาวต่างชาติ โรงพยาบาลนพรัตนราชธานี
คู่มือ การสื่อสารกับผู้ป่วยชาวต่างชาติ โรงพยาบาลนพรัตนราชธานี
topsaby99
 
Cpg copd
Cpg copdCpg copd
ซูโดกุขนาด 9x9 ช่อง แบบตัวอักษร
ซูโดกุขนาด 9x9 ช่อง แบบตัวอักษรซูโดกุขนาด 9x9 ช่อง แบบตัวอักษร
ซูโดกุขนาด 9x9 ช่อง แบบตัวอักษรPawaputanon Mahasarakham
 
กายภาพบำบัดในผู้ป่วยAsthma
กายภาพบำบัดในผู้ป่วยAsthmaกายภาพบำบัดในผู้ป่วยAsthma
กายภาพบำบัดในผู้ป่วยAsthmaSureerut Physiotherapist
 

Viewers also liked (20)

Sudoku
SudokuSudoku
Sudoku
 
Sudoku powerpoint
Sudoku powerpointSudoku powerpoint
Sudoku powerpoint
 
Sudoku
SudokuSudoku
Sudoku
 
Sudoku ppt
Sudoku pptSudoku ppt
Sudoku ppt
 
Presentation - Sudoku Assignment
Presentation - Sudoku  AssignmentPresentation - Sudoku  Assignment
Presentation - Sudoku Assignment
 
Sudoku
SudokuSudoku
Sudoku
 
Intelligent Sudoku Solver
Intelligent Sudoku SolverIntelligent Sudoku Solver
Intelligent Sudoku Solver
 
บทเรียนการพัฒนาระบบเครือข่ายบริการทางการแพทย์
บทเรียนการพัฒนาระบบเครือข่ายบริการทางการแพทย์บทเรียนการพัฒนาระบบเครือข่ายบริการทางการแพทย์
บทเรียนการพัฒนาระบบเครือข่ายบริการทางการแพทย์
 
การดูแลสุขภาพระยะยาวเขตบริการสุขภาพที่ 9
การดูแลสุขภาพระยะยาวเขตบริการสุขภาพที่ 9การดูแลสุขภาพระยะยาวเขตบริการสุขภาพที่ 9
การดูแลสุขภาพระยะยาวเขตบริการสุขภาพที่ 9
 
Sudoku puzzles
Sudoku puzzlesSudoku puzzles
Sudoku puzzles
 
Clinical Practice Guideline for Dementia 2008
Clinical Practice Guideline for Dementia 2008Clinical Practice Guideline for Dementia 2008
Clinical Practice Guideline for Dementia 2008
 
Sudoku valencia 2
Sudoku valencia  2Sudoku valencia  2
Sudoku valencia 2
 
ซูโดกุ สสวท
ซูโดกุ สสวทซูโดกุ สสวท
ซูโดกุ สสวท
 
แนวทางเวชปฏิบัติภาวะสมองเสื่อม 2557
แนวทางเวชปฏิบัติภาวะสมองเสื่อม 2557แนวทางเวชปฏิบัติภาวะสมองเสื่อม 2557
แนวทางเวชปฏิบัติภาวะสมองเสื่อม 2557
 
การทบทวนสถานการณ์และกลไกจัดการความแตกฉานด้านสุขภาพ
การทบทวนสถานการณ์และกลไกจัดการความแตกฉานด้านสุขภาพการทบทวนสถานการณ์และกลไกจัดการความแตกฉานด้านสุขภาพ
การทบทวนสถานการณ์และกลไกจัดการความแตกฉานด้านสุขภาพ
 
Sudoku Solving with Computational Intelligence
Sudoku Solving with Computational IntelligenceSudoku Solving with Computational Intelligence
Sudoku Solving with Computational Intelligence
 
คู่มือ การสื่อสารกับผู้ป่วยชาวต่างชาติ โรงพยาบาลนพรัตนราชธานี
คู่มือ การสื่อสารกับผู้ป่วยชาวต่างชาติ โรงพยาบาลนพรัตนราชธานีคู่มือ การสื่อสารกับผู้ป่วยชาวต่างชาติ โรงพยาบาลนพรัตนราชธานี
คู่มือ การสื่อสารกับผู้ป่วยชาวต่างชาติ โรงพยาบาลนพรัตนราชธานี
 
Cpg copd
Cpg copdCpg copd
Cpg copd
 
ซูโดกุขนาด 9x9 ช่อง แบบตัวอักษร
ซูโดกุขนาด 9x9 ช่อง แบบตัวอักษรซูโดกุขนาด 9x9 ช่อง แบบตัวอักษร
ซูโดกุขนาด 9x9 ช่อง แบบตัวอักษร
 
กายภาพบำบัดในผู้ป่วยAsthma
กายภาพบำบัดในผู้ป่วยAsthmaกายภาพบำบัดในผู้ป่วยAsthma
กายภาพบำบัดในผู้ป่วยAsthma
 

Similar to L1 Sudoku

Thesis writing - week9
Thesis writing - week9Thesis writing - week9
Thesis writing - week9
s1160123
 
4th Semester Computer Science and Engineering (ACU-2022) Question Paper
4th Semester Computer Science and Engineering (ACU-2022) Question Paper4th Semester Computer Science and Engineering (ACU-2022) Question Paper
4th Semester Computer Science and Engineering (ACU-2022) Question Paper
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back trackingTech_MX
 
Enter The Matrix
Enter The MatrixEnter The Matrix
Enter The Matrix
Mike Anderson
 
DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
Masahiro Sakai
 
Taller parcial 2
Taller parcial 2Taller parcial 2
Taller parcial 2
RubenAlfredoTomalaVe
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
Families of Triangular Norm Based Kernel Function and Its Application to Kern...
Families of Triangular Norm Based Kernel Function and Its Application to Kern...Families of Triangular Norm Based Kernel Function and Its Application to Kern...
Families of Triangular Norm Based Kernel Function and Its Application to Kern...
Okamoto Laboratory, The University of Electro-Communications
 
Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In RubyRoss Lawley
 
Hierarchical matrix techniques for maximum likelihood covariance estimation
Hierarchical matrix techniques for maximum likelihood covariance estimationHierarchical matrix techniques for maximum likelihood covariance estimation
Hierarchical matrix techniques for maximum likelihood covariance estimation
Alexander Litvinenko
 
3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta
Janie Clayton
 
There are two types of ciphers - Block and Stream. Block is used to .docx
There are two types of ciphers - Block and Stream. Block is used to .docxThere are two types of ciphers - Block and Stream. Block is used to .docx
There are two types of ciphers - Block and Stream. Block is used to .docx
relaine1
 
R part II
R part IIR part II
R part II
Ruru Chowdhury
 
Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01Sunil0108
 
INTRODUCTION TO MATLAB session with notes
  INTRODUCTION TO MATLAB   session with  notes  INTRODUCTION TO MATLAB   session with  notes
INTRODUCTION TO MATLAB session with notes
Infinity Tech Solutions
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabkrishna_093
 

Similar to L1 Sudoku (20)

19 Jo P July 08
19 Jo P July 0819 Jo P July 08
19 Jo P July 08
 
Thesis writing - week9
Thesis writing - week9Thesis writing - week9
Thesis writing - week9
 
4th Semester Computer Science and Engineering (ACU-2022) Question Paper
4th Semester Computer Science and Engineering (ACU-2022) Question Paper4th Semester Computer Science and Engineering (ACU-2022) Question Paper
4th Semester Computer Science and Engineering (ACU-2022) Question Paper
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
 
Assignment4
Assignment4Assignment4
Assignment4
 
Enter The Matrix
Enter The MatrixEnter The Matrix
Enter The Matrix
 
DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
 
Taller parcial 2
Taller parcial 2Taller parcial 2
Taller parcial 2
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
 
Families of Triangular Norm Based Kernel Function and Its Application to Kern...
Families of Triangular Norm Based Kernel Function and Its Application to Kern...Families of Triangular Norm Based Kernel Function and Its Application to Kern...
Families of Triangular Norm Based Kernel Function and Its Application to Kern...
 
Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In Ruby
 
Lec3
Lec3Lec3
Lec3
 
Ch07 linearspacealignment
Ch07 linearspacealignmentCh07 linearspacealignment
Ch07 linearspacealignment
 
Hierarchical matrix techniques for maximum likelihood covariance estimation
Hierarchical matrix techniques for maximum likelihood covariance estimationHierarchical matrix techniques for maximum likelihood covariance estimation
Hierarchical matrix techniques for maximum likelihood covariance estimation
 
3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta3D Math Primer: CocoaConf Atlanta
3D Math Primer: CocoaConf Atlanta
 
There are two types of ciphers - Block and Stream. Block is used to .docx
There are two types of ciphers - Block and Stream. Block is used to .docxThere are two types of ciphers - Block and Stream. Block is used to .docx
There are two types of ciphers - Block and Stream. Block is used to .docx
 
R part II
R part IIR part II
R part II
 
Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01
 
INTRODUCTION TO MATLAB session with notes
  INTRODUCTION TO MATLAB   session with  notes  INTRODUCTION TO MATLAB   session with  notes
INTRODUCTION TO MATLAB session with notes
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 

Recently uploaded

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

L1 Sudoku

  • 1. Sudoku solving with CVXOPT Sudoku solving with CVXOPT Ben Moran http://transnite.wordpress.com 09 December 2009
  • 2. Sudoku solving with CVXOPT Background 1 Background 2 Sudoku as matrix and vectors 3 Sparsity and solving 4 Conclusion
  • 3. Sudoku solving with CVXOPT Background
  • 4. Sudoku solving with CVXOPT Background Based on. . . a paper by Babu, Pelckmans, Stoica: Linear Systems, Sparse Solutions, and Sudoku 1 Solve Sudoku by turning it into a linear programming problem, inspired by new signal processing paradigm: compressed sensing 2 I thought it was interesting and reimplemented it in Python with CVXOPT 1 http://www.it.uu.se/katalog/praba420/Sudoku.pdf 2 http://nuit-blanche.blogspot.com/
  • 5. Sudoku solving with CVXOPT Background Why? Ben Laurie - Sudoku is a denial of service attack on human intellect It's a solved problem!
  • 6. Sudoku solving with CVXOPT Background Existing solutions Knuth's Dancing Links (DLX) 3 Norvig's constraint propagation (also Python) 4 Sinkhorn method 5 And many others 3 http://en.wikipedia.org/wiki/Dancing_Links 4 http://norvig.com/sudoku.html 5 http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=4802290arnumber=4804
  • 7. Sudoku solving with CVXOPT Background But. . . This is still an interesting way into the brand new eld of compressed sensing And what have Sudoku got to do with. . . signal processing sensor networks single-pixel cameras satellite imaging? Our solution will be interesting, as the solver won't know the rules of Sudoku at all!
  • 8. Sudoku solving with CVXOPT Sudoku as matrix and vectors What are linear systems? Matrix - Vector multiplication 1 3 2 11 = 4 −1 3 5 Ax =b In Python: import numpy numpy . m a t r i x ( ' 1 3 ; 4 −1 ' ) ∗ numpy . m a t r i x ( ' 2 ; 3 ' ) matrix ( [ [ 1 1 ] , [ 5]])
  • 9. Sudoku solving with CVXOPT Sudoku as matrix and vectors Solving a linear system Given 1 3 11 A = and b = , what is x? 4 −1 5 In Python: import numpy numpy . l i n a l g . s o l v e ( numpy . m a t r i x ( ' 1 3 ; 4 −1 ' ) , numpy . m a t r i x ( ' 1 1 ; 5 ' ) ) matrix ( [ [ 2 . ] , [ 3.]])
  • 10. Sudoku solving with CVXOPT Sudoku as matrix and vectors Sudoku board as an indicator vector We can turn a 9x9 Sudoku board into a single vector with 9x9x9 = 729 elements Each 9 entries corresponds to one cell, most are zero Put a 1 in the rst place for 1, in the second place for 2. . . p = Problem ( 1 2 . . ,N=2) numpy . m a t r i x ( p . t o _ i n d i c a t o r _ v e c t o r ( ) , ' i ' ) matrix ( [ [ 1 ] , [ 0 ], [ 0 ], [ 1 ], [ 0 ], [ 0 ], [ 0 ], [ 0 ]])
  • 11. Sudoku solving with CVXOPT Sudoku as matrix and vectors Sudoku rules as a matrix system Now we can set up a special matrix to enforce the rules of Sudoku It will have one row for each constraint, and 9x9x9 = 729 columns When you multiply this with the indicator vector, you get all 1's if the board is valid Here are some of the rules for 2x2 Sudoku: p = Problem ( 1 2 . . ,N=2) numpy . m a t r i x ( p . m a t r i x ( ) ) matrix ( [ [ 1 , 1 , 0 , 0 , 0 , 0, 0, 0.] , [ 0, 0, 1, 1, 0, 0, 0, 0.] , [ 0, 0, 0, 0, 1, 1, 0, 0.] , [ 0, 0, 0, 0, 0, 0, 1, 1.] , [ 1, 0, 1, 0, 0, 0, 0, 0.] , ... [ 0, 0, 0, 1, 0, 0, 0, 0.]])
  • 12. Sudoku solving with CVXOPT Sudoku as matrix and vectors Rules for 2x2 Sudoku 1 2 _ _
  • 13. Sudoku solving with CVXOPT Sudoku as matrix and vectors _ _ _ 1 5 _ _ 7 _    1 _ 6 _ _ _ 8 2 _  3 _ _ 8 6 _ _ 4 _     9 _ _ 4 _ _ 5 6 7     _ _ 4 7 _ 8 3 _ _     7 3 2 _ _ 6 _ _ 4     _ 4 _ _ 8 1 _ _ 9        _ 1 7 _ _ _ 2 _ 8  _ 5 _ _ 3 7 _ _ _ Figure: Full size 9x9 board
  • 14. Sudoku solving with CVXOPT Sudoku as matrix and vectors Figure: Full size 9x9 rules matrix
  • 15. Sudoku solving with CVXOPT Sparsity and solving What do we gain by writing Sudoku like that? We can check solutions with a matrix-vector multiply Turn the proposed solution into an indicator vector Multiply it with the the rules matrix If the solution is valid, the answer will be all ones Solve Ax = [1 1 1 1 1] to nd the answer? . . . No - there is an innite number of answers, most won't give valid boards Need something else to nd our true correct answer
  • 16. Sudoku solving with CVXOPT Sparsity and solving Sparsity The true solution if it exists will be the sparsest (Sparse vector == mostly zeros) 0 3      1   1  0 0.1         Sparse  0  vs non-sparse  4      0 −2         1 1         0 .5 That still doesn't help. . . no ecient method to solve that directly
  • 17. Sudoku solving with CVXOPT Sparsity and solving Dierent kinds of distance: L-2 norm, Pythagoras You measure the length of a vector with a norm This is an L-p norm (for a 3d vector): (|x1 |p + |x2 |p + |x3 |p )1/p If you plug in p=2, you get normal Euclidean distance (Pythagoras' theorem): (|x1 |2 + |x2 |2 + |x3 |2 ) We can choose the solution with the smallest L2-norm. . .
  • 18. Sudoku solving with CVXOPT Sparsity and solving Dierent kinds of distance: L-2 norm, Pythagoras But we don't get a valid answer # Least squares s o l u t i o n M = numpy . m a t r i x ( s a m p l e ( ) . m a t r i x ( ) ) o n e s =numpy . o n e s ( (M. s h a p e [ 0 ] , 1 ) ) v = numpy . l i n a l g . p i n v (M) ∗ o n e s (M∗ v ) [ : 4 ] matrix ( [ [ 1 . ] , [ 1.] , [ 1.] , [ 1.]]) v [ : 4 ] matrix ([[ −0.0735114 ] , [ 0.24178992] , [ 0.00310795] , [ 0.28139045]])
  • 19. Sudoku solving with CVXOPT Sparsity and solving Dierent kinds of distance: L-0 norm, sparsity Plug in p=0 and you get L0, sparsity (number of non-zeros): |x1 |0 + |x2 |0 + |x3 |0 The right solution will have the lowest L0 norm But we've no way of nding it, besides solving the Sudoku!
  • 20. Sudoku solving with CVXOPT Sparsity and solving Dierent kinds of distance: L-1 norm With p=1 you get the absolute sum, taxicab distance |x1 |1 + |x2 |1 + |x3 |1
  • 21. Sudoku solving with CVXOPT Sparsity and solving Why is L-1 important? There are ecient methods of solving it (linear programming) And for many matrices, the minimum L1 norm solution turns out to also minimize L0 (Smallest L1 then nds the sparsest solution) This insight is central to the compressed sensing revolution
  • 22. Sudoku solving with CVXOPT Sparsity and solving Python - CVXOPT Now we can install python-cvxopt 6 and solve the problem! CVXOPT is a GPL library for optimization linear programming Other kinds of convex optimization We can use it to nd the solution x of Ax=b, with the smallest L1-norm The result comes out as a binary vector of 0s and 1s (without being constrained to do so!) 6 http://abel.ee.ucla.edu/cvxopt/
  • 23. Sudoku solving with CVXOPT Sparsity and solving Python - CVXOPT After all that work to set up the question, the answer is one line! h e l p c v x o p t . s o l v e r s . l p Help on f u n c t i o n l p i n module c v x o p t . c o n e p r o g : l p ( c , G , h , A=None , b=None , s o l v e r=None , . . . ) S o l v e s a p a i r o f p r i m a l and d u a l LPs minimize c ' ∗x s u b j e c t t o G∗ x + s = h A∗ x = b s = 0 ... # S o l v e w i t h CVXOPT c v x o p t . s o l v e r s . l p ( c0 , G , hh )
  • 24. Sudoku solving with CVXOPT Conclusion Caveats This won't solve every Sudoku - it tends to solve the easier ones It fails when the L1 minimum doesn't nd the L0 minimum There are other methods, from the compressed sensing literature, like iterative reweighting, that solve more For Sudoku, which puzzles are hard why is still an open problem at the frontiers of research
  • 25. Sudoku solving with CVXOPT Conclusion Compressed sensing Very many important, real world signals are sparse: images, sounds, gene expressions Instead of capturing the raw signal and compressing. . . . . . compressed sensing means you can capture them pre-compressed, with fewer measurements (below the Nyquist rate: 44.1kHz CDs to play back 22kHz frequencies) Less hardware needed will mean better images or cheaper kit Single-pixel camera 7 7 http://dsp.rice.edu/cscamera
  • 26. Sudoku solving with CVXOPT Conclusion Code, links and slides Code is at http://github.com/benmoran/L1-Sudoku/ Sporadic blog: http://transnite.wordpress.com Find CVXOPT at http://abel.ee.ucla.edu/cvxopt/examples/index.html And the nice CVXMOD wrapper at http://cvxmod.net