DEV Community

Cover image for I tried to solve 9x9 Sudoku using "Entanglement" instead of Backtracking
zy n
zy n

Posted on

I tried to solve 9x9 Sudoku using "Entanglement" instead of Backtracking

The "Eureka" Moment: Cycles as Linear Evolution

While building a Static Topological Task Orchestration Engine (@meshflow/core), I hit a philosophical wall:

In traditional Computer Science, circular dependencies are "errors." In reality, they are just feedback loops.

Inspired by the movie Tenet, I realized: A loop in space is just a linear line in time. If we view a "cycle" within a single execution tick, it’s not a deadlock—it’s an evolutionary convergence. I wanted to see if I could solve a 9x9 Sudoku not by "guessing and checking," but by letting the logic collapse into a solution.

🧪 The Experiment: Causal Resonance

I skipped the traditional Recursive Backtracking (the brute-force way) and built a Sudoku solver where every cell is a node in a causal graph.

  • Size: The core engine is a tiny 10KB (minified).
  • Zero Snapshots: It doesn't save states to go back. No "undo."
  • Pure Pressure: When you enter a number, "causal ripples" propagate through the graph. Contradictions downstream act as back-pressure to modify the state of upstream nodes in real-time.

📉 The Reality: Stochastic Success

The result? The global collapse is stochastically successful. Since I don't use history snapshots, the system often enters a "Logical Deadlock." To a spatial observer, the grid looks like it's "vibrating"—nodes flipping back and forth in a high-entropy state, unable to reach a stable equilibrium. It's like watching a brain trying to resolve a paradox.

🧠 Seeking the "Graph Theory" Giants

I’m currently hitting a wall with Re-oscillation strategies.

I want to avoid "Heavy Snapshots" to keep the engine under 10KB. I'm experimenting with "Inhibitory Persistence"—treating failed paths as negative pressure to "shake" the system into a new state.

My Questions to the Community:

  1. How can I trigger an elegant "Shaking" effect to break a logical deadlock in a cyclic graph?
  2. Is it possible to achieve 100% determinism in a causal field without backtracking?
  3. Have I gone too far into the Tenet rabbit hole?

🕹️ Try the Chaos

Roast my architecture. I’m eager to hear from anyone into Graph Theory, Reactive Logic, or Constraint Programming!

Top comments (0)