This document discusses solving Sudoku puzzles using linear programming and sparsity techniques from the field of compressed sensing. It describes representing a Sudoku board as an indicator vector and encoding the rules as a matrix system. Solving this system to find the sparsest solution that satisfies the rules allows automatically solving Sudoku puzzles. The document explains how this can be implemented in Python using the CVXOPT library to solve the linear program and find a binary solution vector corresponding to the solved Sudoku board.
IJRET : International Journal of Research in Engineering and Technology is an international peer reviewed, online journal published by eSAT Publishing House for the enhancement of research in various disciplines of Engineering and Technology. The aim and scope of the journal is to provide an academic medium and an important reference for the advancement and dissemination of research results that support high-level learning, teaching and research in the fields of Engineering and Technology. We bring together Scientists, Academician, Field Engineers, Scholars and Students of related fields of Engineering and Technology
IJRET : International Journal of Research in Engineering and Technology is an international peer reviewed, online journal published by eSAT Publishing House for the enhancement of research in various disciplines of Engineering and Technology. The aim and scope of the journal is to provide an academic medium and an important reference for the advancement and dissemination of research results that support high-level learning, teaching and research in the fields of Engineering and Technology. We bring together Scientists, Academician, Field Engineers, Scholars and Students of related fields of Engineering and Technology
International Journal of Research in Engineering and Science is an open access peer-reviewed international forum for scientists involved in research to publish quality and refereed papers. Papers reporting original research or experimentally proved review work are welcome. Papers for publication are selected through peer review to ensure originality, relevance, and readability.
Protein Secondary Structure Prediction using Deep Learning methodsChrysoula Kosma
Presentation for my thesis defence. Topic: Protein Secondary Structure Prediction using Deep Learning Methods.
Full text: http://artemis.cslab.ece.ntua.gr:8080/jspui/handle/123456789/17443
A fusion of soft expert set and matrix modelseSAT Journals
Abstract
The purpose of this paper is to define different types of matrices in the light of soft expert sets. We then propose a decision making
model based on soft expert set.
Keywords: Soft set, soft expert set, Soft Expert matrix.
IOSR Journal of Electronics and Communication Engineering(IOSR-JECE) is an open access international journal that provides rapid publication (within a month) of articles in all areas of electronics and communication engineering and its applications. The journal welcomes publications of high quality papers on theoretical developments and practical applications in electronics and communication engineering. Original research papers, state-of-the-art reviews, and high quality technical notes are invited for publications.
I used this set of slides for the lecture on Complexity I gave at the University of Zurich for the 1st year students following the course of Formale Grundlagen der Informatik.
An entry level sharing for trend micro scan engine team member. The sharing would take a binary classification on script type classification task as demonstrate. Topics would start from machine learning problem definition and covered computational graph for deep neural network (DNN), recurrent neural network, LSTM, GRU and some RNN fine tune tricks.
International Journal of Research in Engineering and Science is an open access peer-reviewed international forum for scientists involved in research to publish quality and refereed papers. Papers reporting original research or experimentally proved review work are welcome. Papers for publication are selected through peer review to ensure originality, relevance, and readability.
Protein Secondary Structure Prediction using Deep Learning methodsChrysoula Kosma
Presentation for my thesis defence. Topic: Protein Secondary Structure Prediction using Deep Learning Methods.
Full text: http://artemis.cslab.ece.ntua.gr:8080/jspui/handle/123456789/17443
A fusion of soft expert set and matrix modelseSAT Journals
Abstract
The purpose of this paper is to define different types of matrices in the light of soft expert sets. We then propose a decision making
model based on soft expert set.
Keywords: Soft set, soft expert set, Soft Expert matrix.
IOSR Journal of Electronics and Communication Engineering(IOSR-JECE) is an open access international journal that provides rapid publication (within a month) of articles in all areas of electronics and communication engineering and its applications. The journal welcomes publications of high quality papers on theoretical developments and practical applications in electronics and communication engineering. Original research papers, state-of-the-art reviews, and high quality technical notes are invited for publications.
I used this set of slides for the lecture on Complexity I gave at the University of Zurich for the 1st year students following the course of Formale Grundlagen der Informatik.
An entry level sharing for trend micro scan engine team member. The sharing would take a binary classification on script type classification task as demonstrate. Topics would start from machine learning problem definition and covered computational graph for deep neural network (DNN), recurrent neural network, LSTM, GRU and some RNN fine tune tricks.
Intelligent Sudoku Solver:
Area: Intelligent Algorithm
Duration: June 2012- June 2013
Abstract: Sudoku solving algorithm which is more efficient and faster than the common Sudoku algorithms, based on the pattern identification.
Application: Its major application would be in Steganography, when difficult Sudoku puzzles can be solved quickly.
Sudoku Solving with Computational Intelligenceharaldhiss
Computers can create convincing results – the cinemas are presenting the latest overwhelming 3D multimedia spectacles. The results and benefits aren’t restricted to the amusement and movies, modern methods for our machines bring further considerable improvements to reality. Programs and algorithms evolve in bioinformatics and public health. Computational intelligence can also be utilized in solving brainteasing tasks. This article is presenting a computational intelligence approach for solving Sudoku brainteasers.
A scanning strategy introduces Sudoku and solves the first example. The article presents an estimation of the complexity with stochastic methods. Sudoku-specific advanced strategies refine the scanning technique from the introduction. A software-architecture for efficiently implementing a rule-based solver is integrating the strategies and is using annotations that are updated with notifications. When no rule can be applied, a backtracking search is started. The parametrized solver offers policies for searching. A logging mechanism is presented supporting the search saving memory for the efficient implementation.
The author, Dr. Harald Hiss, has obtained the diploma in software-engineering in 2004 and he has graduated in databases in 2008 at the university of Freiburg supported by the interdisciplinary graduate programme logic and applications. This article is presenting a new Sudoku solver that performs best. The computer scientist is presenting Sudoku-specific strategies and a solver architecture for the fast and simple implementation using the latest technologies.
Engineering Mathematics [Y
Q P Code: 60401
Additional Mathematics - II
Q P Code: 604A7
Analysis and Design of Algorithms
Q P Code: 60402
Microprocessor and Microcontroller
Q P Code: 60403
Object Oriented Programming with C++
Q P Code: 60404
Soft skills Development
Presentation given at the 2013 Clojure Conj on core.matrix, a library that brings muli-dimensional array and matrix programming capabilities to Clojure
Unix and Shell Programming,
Q P Code: 60305.
Additional Mathematics I
Q P Code: 60306
Computer Organization and Architecture
Q P Code: 62303
Data Structures Using C
Q P Code: 60303
Discrete Mathematical Structures
Q P Code: 60304
Engineering Mathematics - III
Q P Code: 60301
Soft Skill Development
Q P Code: 60307
Kazushi Okamoto: Families of Triangular Norm Based Kernel Function and Its Application to Kernel k-means, Joint 8th International Conference on Soft Computing and Intelligent Systems and 17th International Symposium on Advanced Intelligent Systems (SCIS-ISIS2016), 2016.08.25
Hierarchical matrix techniques for maximum likelihood covariance estimationAlexander Litvinenko
1. We apply hierarchical matrix techniques (HLIB, hlibpro) to approximate huge covariance matrices. We are able to work with 250K-350K non-regular grid nodes.
2. We maximize a non-linear, non-convex Gaussian log-likelihood function to identify hyper-parameters of covariance.
This is the version of my 3D math talk that I used at CocoaConf Atlanta. This version includes the graphic representations of the different steps in implementing the shader.
There are two types of ciphers - Block and Stream. Block is used to .docxrelaine1
There are two types of ciphers - Block and Stream. Block is used to encrypt a block of bits at one time. Stream cipher is used to encrypt one bit at a time.
Modes of CiphersUnderstanding Modes
Electronic Code Book (ECB) Mode
This mode is a most straightforward way of processing a series of sequentially listed message blocks.
Operation
The user takes the first block of plaintext and encrypts it with the key to produce the first block of ciphertext.
He then takes the second block of plaintext and follows the same process with same key and so on so forth.
The ECB mode is deterministic, that is, if plaintext block P1, P2,…, Pm are encrypted twice under the same key, the output ciphertext blocks will be the same
Cipher Block Chaining (CBC) Mode
CBC mode of operation provides message dependence for generating ciphertext and makes the system non-deterministic.
Operation
The operation of CBC mode is depicted in the following illustration. The steps are as follows −
Load the n-bit Initialization Vector (IV) in the top register.
XOR the n-bit plaintext block with data value in top register.
Encrypt the result of XOR operation with underlying block cipher with key K.
Feed ciphertext block into top register and continue the operation till all plaintext blocks are processed.
For decryption, IV data is XORed with first ciphertext block decrypted. The first ciphertext block is also fed into to register replacing IV for decrypting next ciphertext block.
Output Feedback (OFB) Mode
It involves feeding the successive output blocks from the underlying block cipher back to it. These feedback blocks provide string of bits to feed the encryption algorithm which act as the key-stream generator as in case of CFB mode.
The key stream generated is XOR-ed with the plaintext blocks. The OFB mode requires an IV as the initial random n-bit input block. The IV need not be secret.
Counter (CTR) Mode
It can be considered as a counter-based version of CFB mode without the feedback. In this mode, both the sender and receiver need to access to a reliable counter, which computes a new shared value each time a ciphertext block is exchanged. This shared counter is not necessarily a secret value, but challenge is that both sides must keep the counter synchronized.
Operation
Both encryption and decryption in CTR mode are depicted in the following illustration. Steps in operation are −
Load the initial counter value in the top register is the same for both the sender and the receiver. It plays the same role as the IV in CFB (and CBC) mode.
Encrypt the contents of the counter with the key and place the result in the bottom register.
Take the first plaintext block P1 and XOR this to the contents of the bottom register. The result of this is C1. Send C1 to the receiver and update the counter. The counter update replaces the ciphertext feedback in CFB mode.
Continue in this manner until the last plaintext block has been encrypted.
The decryption is.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
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!
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
_ _
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