Top all-time · #2654
hakank.org
Personal blog · hakank.org · on HN as hakankprogrammingmathscience
hakank.org is a personal blog at hakank.org about programming, math and science. Since 2011, 32 different Hacker News readers have linked it 58 times, most often “My MiniZinc Page”. No feed was found, so read it on the site itself.
Most-linked posts?
- /picat/3 people · 3 mentions · first linked 2018-07-27
- /2 people · 3 mentions · first linked 2020-03-15
- /z3/2 people · 2 mentions · first linked 2021-01-31
- /k/2 people · 2 mentions · first linked 2011-06-07
- My MiniZinc Page2 people · 2 mentions · first linked 2018-01-20
- /2 people · 2 mentions · first linked 2025-03-17
- The SETL programming language2 people · 2 mentions · first linked 2014-11-20
- /minizinc/2 people · 2 mentions · first linked 2017-04-07
- A first look at the Picat programming language2 people · 2 mentions · first linked 2013-09-29
What Hacker News says?
It looks like Hakan K (has a super cool website where he solves all kinds of optimization problems for fun) was able to solve it using the Picat language in a very small amount of code with a solution (not sure if optimal): http://hakank.org/picat/dogbunny_puzzle.pi His website is a treasure trove for these kinds of problems and worth studying.
Comment linking /picat/dogbunny_puzzle.pi
on “Show HN: I may have created a new type of puzzle”Submitted The SETL programming language as a story · 29 points
HN discussionWhenever constraint programming languages come up, you can’t miss mentioning Håkan Kjellerstrand. He’s put together an amazing collection of problems and examples—including plenty for MiniZinc—on his site: https://www.hakank.org/minizinc/
Comment linking /minizinc/
on “Many hard LeetCode problems are easy constraint problems”Submitted My MiniZinc Page as a story · 3 points
HN discussionActually, the Peaceable Army (or Armies) of Queens problem is a separate problem and much harder than the n-queens problem. Here is a MiniZinc model: http://hakank.org/minizinc/peaceableArmyOfQueens.mzn , and a Picat model: http://hakank.org/picat/peaceableArmyOfQueens.pi (Also: Thanks for your links to my site.)
Comment linking /picat/peaceableArmyOfQueens.pi
on “Employee Scheduling”Submitted Common Constraint Programming Problems as a story · 2 points
HN discussionSounds similar to n-Queens, check out http://www.hakank.org/google_or_tools/nqueens.py http://www.hakank.org/google_or_tools/nqueens2.py http://www.hakank.org/google_or_tools/nqueens3.py for inspiration
Comment linking /google_or_tools/nqueens3.py
on “Employee Scheduling”Submitted SETL – The Set Programming Language (2010) as a story · 2 points
HN discussionUsing Excel sounds like a pain to maintain but if it works it works. Your problem sounds like a JSP (job shop scheduling problem). If it is you could use MiniZinc https://www.minizinc.org/ and look at Håkan Kjellstrans MiniZinc page http://www.hakank.org/minizinc/ , it has a couple of different JSP models.
Comment linking /minizinc/
on “Employee Scheduling”Submitted A first look at the Picat programming language as a story · 2 points
HN discussionI'm glad to see the domain of constraint programming and operational research in general generate interest so I thought I would take the opportunity to share some links and resources I have found useful. Personally, I've spent most of my time on the routing (TSP, VRP, VRPTW) side of things using CP (OscaR-CP). Discrete optimization and constraint programming can be a bit difficult to get into. There are two great fr…
Comment linking /
on “Employee Scheduling”Submitted Open source constraint programming models as a story · 2 points
HN discussionYou should check out http://www.hakank.org/ for a fantastic resource of optimization models for a huge variety of solvers and problems
Comment linking /
on “Employee Scheduling”Submitted Tai Chi Chuan - The ASCII Art version as a story · 2 points
HN discussionYes, the underlying engine of Picat is - a slightly altered- B-Prolog, which is available as the "bp" module, from which one can use many of traditional Prolog constructs, for example `bp.length/2` instead of Picat's `length/1` function. This can help when porting Prolog programs to Picat. In fact, quite a few Prolog programs can be run directly in Picat, perhaps with just some few adjustment. For some example of th…
Comment linking /picat/
on “Planner programming blows my mind”For those interested, HN user hakank (Hakan Kjellerstrand), who is a very active member of the constraint programming community (among others), has a ton of Picat resources and examples on his website: http://www.hakank.org/picat/
Comment linking /picat/
on “Planner programming blows my mind”http://www.hakank.org/picat/ has the most examples, good explanation of the problems, and elegant, short solutions.
Comment linking /picat/
on “Ask HN: Any good examples of learning through games/puzzles, for adults?”I work a lot with sat solvers, but with using in a proper language. Either cbmc for C (not Klee, not Z3 as these require extensive translations to obscure languages), or picat for a proper functional language with support for normal non-functional coding styles. The sudoku sample is a few lines there, and it used to win many CSP contests. http://www.hakank.org/picat/sudoku_pi.pi cbmc is esp. nice to autocreate prope…
Comment linking /picat/sudoku_pi.pi
on “Modern SAT solvers: fast, neat and underused”What I can see, of these 72 solutions, there are at most 9 distinct solutions when symmetries are removed (rotation, transpose, flipping). I might have missed some solution. Though, of these 9 solutions there are more similarities, i.e. some of them are the same rows except that the positions are switched. Some other thing. if the lines are sorted, there are only 4 distinct variants. Also, the solution of the origin…
Comment linking /picat/miracle_sudoku.pi
on “Solving the “Miracle Sudoku” in Prolog”The solution is to look at a lot of examples https://www.hakank.org/
Comment linking /
on “A dumb introduction to z3”Have you seen http://www.hakank.org/ ? Mostly about constraint programming, but definitely in the realm of operations research.
Comment linking /
on “Scaling up linear programming with PDLP”Not forgetting Picat! https://www.hakank.org/picat/
Comment linking /picat/
on “The Simplicity of Prolog”As an asm tutorial / case study, I found this neat. In terms of a conclusion, I found it potentially neat, but found myself wondering: cool, but how much of a win is all this special-cased effort, versus some kind of off-the-shelf constraint solver written in portable code? It'd be interesting to see a benchmark so we could have an idea if we're talking about a 50% win, orders of magnitude win, etc. To get a rough b…
Comment linking /answer_set_programming/nqueens.lp
on “Overkilling the 8-queens Problem”Every time some OR or constraint programming language comes up, Håkan Kjellerstrand is an obligatory mention. He has a whole page dedicated to problems and examples for those, including MiniZinc: http://www.hakank.org/minizinc/index.html
Comment linking /minizinc/index.html
on “MiniZinc: free and open-source constraint modeling language”They are similar, although SABR tends to be more verbose as it keeps a polynomial relationship between size of SABR programs and the underlying SAT. It can in some ways be easier to reason about, but that's sort of in the eye of the beholder. In the past I've prototyped simple examples in SABR then written a generator in python for the full program. Here's a great resource for those interested in constraint programm…
Comment linking /answer_set_programming/sudoku.lp
on “Cracking Minesweeper with Z3 SMT Solver”https://www.hakank.org/z3/
Comment linking /z3/
on “Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines (2015)”These are other good resources: - rise4fun https://rise4fun.com/z3/tutorialcontent/guide - https://ericpony.github.io/z3py-tutorial/guide-examples.htm - Programming Z3 - https://theory.stanford.edu/~nikolaj/programmingz3.html - Nikolaj Bjorner's tutorial https://youtu.be/nGwyNmsxX6I - Hakank's examples http://www.hakank.org/z3/ - Yurichev's book "SMT by Example" https://yurichev.com/writings/SAT_SMT_by_example.pdf -…
Comment linking /z3/
on “Software Verification and Analysis Using Z3”I have no idea if it is possible to use Minizinc models with CP Optimizer, but I would guess not. It doesn't feel like a feature that would be of business interest to IBM to develop. As for Håkans pages, http://www.hakank.org/common_cp_models/#xkcd has a list of 21 implementations of the xkcd problem.
Comment linking /common_cp_models/
on “A CP Solution for XKCD NP Complete Restaurant Order”Note that CPLEX and CP Optimizer are two completely different products. AFAIK, a license key for one of them can not be used for the other. But I've never actually used either myself, so don't take my word for it. Also, since you seem to be interested in using Minizinc for modelling, you can use other back-ends than the built in one for solving models. For some more code examples, see also Håkan Kjellerstrands blog…
Comment linking /constraint_programming_blog/
on “A CP Solution for XKCD NP Complete Restaurant Order”Here's a link to Picat's main site: http://picat-lang.org/ . My Picat page have quite a few examples of CP/SAT models (also non-CP programs): http://www.hakank.org/picat/ .
Comment linking /picat/
on “Constraint Programming”