Hacker Blogs
Work in progress: 15,409 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #2654

H

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.

No feed foundVisit the blog
58mentions?
32HN people?
2011–2025first – last linked?
Links on Hacker News per year · peak 7 in 2020

The author on HN?

hakank · 60 karma · member since 2018

http://hakank.org/ GitHub: https://github.com/hakank/hakank Swedish software developer (retired) / Independent researcher. Interested in programming, mathematics (mostly recreational), constraint programming/modeling, logic programming, machine learning/data mining, inductive (logic) programming, probabilistic programming, genetic programming (especially symbolic regression)and AI (both GOFAI and newer stuff). Favourite programming languages/systems: Picat, MiniZinc, Prolog, Perl, K, Java, Math…

From their public HN profile, which links to this site.

Most-linked posts?

  1. /picat/
    3 people · 3 mentions · first linked 2018-07-27
  2. /
    2 people · 3 mentions · first linked 2020-03-15
  3. /z3/
    2 people · 2 mentions · first linked 2021-01-31
  4. /k/
    2 people · 2 mentions · first linked 2011-06-07
  5. My MiniZinc Page
    2 people · 2 mentions · first linked 2018-01-20
  6. /
    2 people · 2 mentions · first linked 2025-03-17
  7. The SETL programming language
    2 people · 2 mentions · first linked 2014-11-20
  8. /minizinc/
    2 people · 2 mentions · first linked 2017-04-07
  9. A first look at the Picat programming language
    2 people · 2 mentions · first linked 2013-09-29

What Hacker News says?

  1. 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”
  2. Submitted The SETL programming language as a story · 29 points

    HN discussion
  3. Whenever 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”
  4. Submitted My MiniZinc Page as a story · 3 points

    HN discussion
  5. Actually, 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”
  6. Submitted Common Constraint Programming Problems as a story · 2 points

    HN discussion
  7. Sounds 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”
  8. Submitted SETL – The Set Programming Language (2010) as a story · 2 points

    HN discussion
  9. Using 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”
  10. Submitted A first look at the Picat programming language as a story · 2 points

    HN discussion
  11. I'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”
  12. Submitted Open source constraint programming models as a story · 2 points

    HN discussion
  13. You 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”
  14. Submitted Tai Chi Chuan - The ASCII Art version as a story · 2 points

    HN discussion
  15. Yes, 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”
  16. 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”
  17. 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?”
  18. 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”
  19. 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”
  20. The solution is to look at a lot of examples https://www.hakank.org/

    Comment linking /

    on “A dumb introduction to z3”
  21. 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”
  22. Not forgetting Picat! https://www.hakank.org/picat/

    Comment linking /picat/

    on “The Simplicity of Prolog”
  23. 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”
  24. 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”
  25. 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”
  26. https://www.hakank.org/z3/

    Comment linking /z3/

    on “Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines (2015)”
  27. 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”
  28. 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”
  29. 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”
  30. 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”

Search all of HN for hakank.org

Linked by the same people?