Series: Constraint Solver in Julia
- Part One: Setup and backtracking
- Part Two: Pruning
- Part Three: Pruning+Benchmarking
- Part Four: Alldifferent constraint
- Part Five: Better data structure
- Part Six: Sum constraint first part
- Part Seven: Sum constraint speed-up
This is part 8 of the series about: How to build a Constraint Programming solver?
I published 7 posts on this series which started last month hope to work on it further for a while. Either in the next part or part 10 I think I’ll do a recap post which goes through all the parts we’ve done again. Maybe a recap video which will show the code. Not sure yet. If you have some ideas please comment!
Besides that I yesterday saw a tweet by Juan Pablo Vielma who is an Associate Professor of Operations Research at MIT and is active in the Julia community as well.
Congratulations to Google OR-tools’ CP-SAT solver on winning 4 gold medals in the 2019 @minizinc challenge! #cp2019 #orms pic.twitter.com/X2pyBHqy72
— Juan Pablo Vielma (@J_P_Vielma) October 2, 2019
He also mentioned in a comment that he is currently looking into integrating Google OR-tools into JuMP.jl which is the modeling language for mathematical optimization in Julia.
That would be very interesting. Nevertheless I will of course keep working on this as this is for educational reasons (also like how not do some things :D).
Maybe it’s also a good time to mention here why I’m writing these posts the way I do again:
- I think reading blogs where everything works perfectly because the blogger is a specialist in his career doesn’t get you far, similar to why Veritasium asked people questions in his videos not just showing the answer.
- Explaining while you’re still on a similar level as your reader is far easier as explained also by Wait But Why? who is a layman in the topics before writing about them
- I’m writing better code if I have the feeling that I’m watched 😀 I find bugs before I publish (and after 😀 ) after thinking about it because I have to write it down in a reasonable manner.
- You should not take everything you read as if it is the truth. Definitely not on my blog as there are probably way better methods to write a simplex solver or now a constraint programming solver
- Hopefully I can bring you to the stage where you try out coding projects like this by yourself. Often in university or school you often start with: Write a fibonacci or prime function but sometimes it doesn’t get much more difficult than that.
Try out some real problems and make them open source!
Okay so what is this post about?
Sometimes you start like I did with the sudoku puzzle and then want to generalize more and sometimes don’t quite get your actual goal of the project besides enjoying programming and writing about it …
I introduced the sum constraint and realized that we now need a right hand side (rhs
)…