frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Solving LinkedIn Queens Using Haskell

https://imiron.io/post/linkedin-queens/
39•agnishom•3h ago

Comments

LandR•2h ago
Does anyone know of any algorithms for generating these game boards ?

That will produce challenging boards ?

CJefferson•2h ago
It's a hard problem, for a bunch of reasons :)

1) It's not too hard to make a problem with at least one solution (just put the queens down first, then draw boxes), but there isn't any good way of making levels with unique solutions.

2) Once you've accomplished that, it's hard to predict how hard a level will be, and then it's hard to make levels easier / harder.

I happen to be currently researching this topic (well, I'm doing all kinds of these grid-based puzzles, but this is an example). The algorithm tries to make "good" levels, but there is a good probability it will end up with something useless we need to throw away, and then try again.

It's easy to make levels which are trivial, and similarly easy to make levels which are far beyond human ability, but hitting things in the 'human tricky but solvable' sweet-spot is where most of the difficulty comes from.

I should probably try writing up a human-readable version of how I do it. It involves a bunch of Rust code, so I can hit a whole bunch of trendy topics!

vjerancrnjak•1h ago
Given that this could be a variant of "exact cover", using zdds to explore the problem space might simplify finding exact puzzles in addition to puzzles that require lookahead.
mzl•1h ago
Generally what is needed is a subroutine that can tell you 1) if the problem has a solution, and 2) if the solution is unique (common requirement for puzzles like these). Using such a model as a sub-routine, a heuristic search can be done to gradually build up puzzles. If your solver technology of choice can handle quantified problems, that could be used to integrate those two problems into one, but that is quite a lot harder to to.

If the base solver you have is a system that can be run in various configurations with different levels of reasoning and assumption as well as a report on the amount of search needed if any, that can be very useful as a way to measure the hardness. In Sudoku as a Constraint problem (https://citeseerx.ist.psu.edu/document?doi=4f069d85116ab6b4c...), Helmut Simonis tested lots of 9x9 Sudoku puzzles against various levels of propagation and pre-processing as a way to measure the hardness of Sudoku puzzles by categorizing them by the level of reasoning needed to solve without search. The MiniZinc model for LinkedIn Queens (https://news.ycombinator.com/item?id=44353731) can be used with various solvers and levels of propagation as such a subroutine.

Now, for production-level puzzle making, such as what King does for Candy Crush, the problems and requirements are even harder. I've heard presentation where they talk about training neural networks to play like human testers, so not optimal play but most human like play, in order to test the hardness level of the puzzles.

tikotus•54m ago
It's the same problem as with generating good sudoku boards. It's not easy, and there's not many publicly available solutions, but solutions exist.

A common opinion is that a good board is solvable without the use of backtracking. A set of known techniques should be enough to solve the board. To validate if a board is "fun" you need to have a program that can solve the board using these known techniques. Making that program is much harder than just making a general solver. And then you need to find the boards that can be validated as fun. Either you search through random boards, or you get clever...

Macuyiko•46m ago
I've noticed that puzzles that can be solved with CP-SAT's presolver so that the SAT search does not even need to be invoked basically adhere to this (no backtracking, known rules), e.g.:

    #Variables: 121 (91 primary variables)
      - 121 Booleans in [0,1]
    #kLinear1: 200 (#enforced: 200)
    #kLinear2: 1
    #kLinear3: 2
    #kLinearN: 30 (#terms: 355)

    Presolve summary:
      - 1 affine relations were detected.
      - rule 'affine: new relation' was applied 1 time.
      - rule 'at_most_one: empty or all false' was applied 148 times.
      - rule 'at_most_one: removed literals' was applied 148 times.
      - rule 'at_most_one: satisfied' was applied 36 times.
      - rule 'deductions: 200 stored' was applied 1 time.
      - rule 'exactly_one: removed literals' was applied 2 times.
      - rule 'exactly_one: satisfied' was applied 31 times.
      - rule 'linear: empty' was applied 1 time.
      - rule 'linear: fixed or dup variables' was applied 12 times.
      - rule 'linear: positive equal one' was applied 31 times.
      - rule 'linear: reduced variable domains' was applied 1 time.
      - rule 'linear: remapped using affine relations' was applied 4 times.
      - rule 'presolve: 120 unused variables removed.' was applied 1 time.
      - rule 'presolve: iteration' was applied 2 times.

    Presolved satisfaction model '': (model_fingerprint: 0xa5b85c5e198ed849)
    #Variables: 0 (0 primary variables)

    The solution hint is complete and is feasible.

    #1       0.00s main
      a    a    a    a    a    a    a    a    a    a   *A* 
      a    a    a    b    b    b    b   *B*   a    a    a  
      a    a   *C*   b    d    d    d    b    b    a    a  
      a    c    c    d    d   *E*   d    d    b    b    a  
      a    c    d   *D*   d    e    d    d    d    b    a  
      a    f    d    d    d    e    e    e    d   *G*   a  
      a   *F*   d    d    d    d    d    d    d    g    a  
      a    f    f    d    d    d    d    d   *H*   g    a  
     *I*   i    f    f    d    d    d    h    h    a    a  
      i    i    i    f   *J*   j    j    j    a    a    a  
      i    i    i    i    i    k   *K*   j    a    a    a
Together with validating that there is only 1 solution you would probably be able to make the search for good boards a more guided than random creation.
croisillon•2h ago
related:

- with SMT (11 days ago, 47 comments) https://news.ycombinator.com/item?id=44259476

- with APL (10 days ago, 1 comment) https://news.ycombinator.com/item?id=44273489 and (8 days ago, 20 comments) https://news.ycombinator.com/item?id=44275900

- with MiniZinc (1 day ago, 0 comment) https://news.ycombinator.com/item?id=44353731

agnishom•2h ago
- with SAT (27 days ago, 1 comment) https://news.ycombinator.com/item?id=44115866
codethief•2h ago
Reminds me of this classic: https://aphyr.com/posts/342-typing-the-technical-interview
roland35•55m ago
Just when I start thinking I am smart, someone drops this :) Haskell certainly looks graceful but is imposing! I feel pretty good if I can do functional stuff in Rust, but this is next level.
agnishom•2m ago
You should write a "Solving LinkedIn Queens with Rust" post :)
TheSilva•47m ago
Anything similar with Zip? That's the one I enjoy in the mornings.
alpineman•38m ago
So you're the co-worker playing Queens according to my LinkedIn notifications!
agnishom•8m ago
That's probably Ryan Berger. They have a Firefox extension: https://ryanberger.me/posts/queens/
miningape•4m ago
Awesome, I'm writing a "logical solver" just like this - I'll hopefully also have something to post here when I'm done.

I'm trying to use it during the generation process to evaluate the difficulty a basic heuristic I'm trying to work with is counting the number of times a particular colour is eliminated - the higher the count the harder the problem since it requires more iteration of the rules to solve.

Stop blackpilling, forget p(doom), and learn to love building GPT wrappers

https://ard.ninja/blog/2025-06-17-stop-blackpilling-stop-dooming-forget-p-doom-and-learn-to-love-building-gpt-wrappers/
1•ardme•1m ago•0 comments

Writing a basic Linux device driver when you know nothing about drivers or USB

https://crescentro.se/posts/writing-drivers/
1•asicsp•2m ago•0 comments

LR(1) Parse-Tables Generator

https://github.com/wldfngrs/parser-generator
2•Bogdanp•3m ago•0 comments

Vertically stacked monolithic perovskite colour photodetectors

https://www.nature.com/articles/s41586-025-09062-3
1•bookofjoe•5m ago•0 comments

Dead Ends and Gateway

https://herbertlui.net/dead-ends-and-gateways/
1•fside•5m ago•0 comments

Show HN: My £250 Fiverr disaster led me to build and open-source DeepScrape

https://github.com/stretchcloud/deepscrape
1•jit2600•9m ago•1 comments

A Mysterious Website I Stumbled Upon

https://www.sbnation.com/a/17776-football
2•_Yguy_•10m ago•0 comments

Reinforcement Learning Teachers of Test Time Scaling

https://sakana.ai/rlt/
1•mottiden•10m ago•0 comments

Deciphering the Language of Nature for Scientific Discovery

https://naturelm.github.io
1•nlmdev•13m ago•0 comments

U.K. Space Weather Prediction System Goes Operational

https://eos.org/research-spotlights/u-k-space-weather-prediction-system-goes-operational
1•Brajeshwar•13m ago•0 comments

Google faces UK clampdown as watchdog floats market power rules

https://www.theregister.com/2025/06/24/google_strategic_market_status/
1•rntn•15m ago•0 comments

I think EdTech is broken (and what I learned as a struggling student)

https://www.study-graph.com/
1•abilafredkb•16m ago•1 comments

Beyond the Silver Bullet. Navigating Wicked Problems with Frameworks

https://medium.com/@mitseye/beyond-the-silver-bullet-8b5aa1f5a38a
1•adrianhoward•18m ago•0 comments

Show HN: FeedbackOnImage – Point, Click, Comment. Done

https://feedbackonimage.vercel.app/
1•m_abdulrehman•18m ago•0 comments

Show HN: Build Pages Visually, Export as JSON – JsonBloks Just Launched

https://jsonbloks.vercel.app/
2•m_abdulrehman•20m ago•0 comments

Arc Stage – Arc Experience on Chrome

https://chromewebstore.google.com/detail/arc-stage-arc-experience/angnbhooekkhlmohcmnjmlhfogjlfgee
1•nanxiaobei•23m ago•1 comments

Fedora 43 proposal: Drop i686 support

https://fedoraproject.org/wiki/Changes/Drop_i686_support
1•rwmj•24m ago•2 comments

15Minutes – Book Summaries and Analysis PDF – Over 5000 Books

https://www.15minutes.ai
1•fluxx-ai•27m ago•1 comments

Police warn of SMS scams as 'blaster' is used to send texts

https://www.theguardian.com/money/2025/jun/24/police-sms-scams-blaster-texts-smishing
2•chrisjj•29m ago•0 comments

The Tech Coach

https://thetechcoach.io/
2•danbartlett•32m ago•1 comments

Show HN: Vroom – your road trip companion

https://www.vroomapp.uk/
1•gimber•32m ago•0 comments

Circular Microcomputers embedded and powered by repurposed smartphone components

https://citronics.eu/
2•Bluestein•33m ago•0 comments

DSPy for Rubyists

https://github.com/obie/desiru
1•thedayisntgray•34m ago•0 comments

Vibecoded Sentry Clone with Claude Code

https://github.com/mitsuhiko/vibe-minisentry
1•moebrowne•35m ago•0 comments

Microplastics shed by food packaging are contaminating our food, study finds

https://www.cnn.com/2025/06/24/health/microplastics-food-packaging-study-wellness
3•gortok•35m ago•0 comments

Autism, Sociality, and Human Nature

https://somatosphere.com/2014/autism-sociality-and-human-nature.html/
3•bookofjoe•37m ago•0 comments

Joshua Hart Young Author

1•writernews•38m ago•0 comments

Show HN: Zyler – AI agent for marketing data that doesn't hallucinate

https://www.zyler.ai
7•ticktockten•39m ago•3 comments

Researchers create AI-based tool that restores age-damaged artworks in hours

https://www.theguardian.com/science/2025/jun/11/researchers-create-ai-based-tool-that-restores-age-damaged-artworks-in-hours
2•ranit•40m ago•0 comments

Netanyahu decided on Iran war last year, then sought to recruit Trump

https://www.washingtonpost.com/world/2025/06/23/netanyahu-iran-attack-nuclear-intelligence/
3•handfuloflight•44m ago•0 comments