An Experimental Investigation into the Computational Complexity of the Partition Problem via P-adic Resonance and Fractal Dynamics
Author: Kristian Magda
Status: Research Complete (vFINAL) - Novel Heuristic Discovered
This project began as a direct experimental test of the hypothesis put forth in the preprint, "A Proposed Correspondence Between NP-Completeness and the Mandelbrot Set via Knot Theory" (Preprints.org 202508.0750/v1).
The P versus NP question is one of the most profound open problems in theoretical computer science. This work proposes a structured framework establishing a correspondence between the solvability of NP-complete problems, the topological triviality of knots, and the dynamical stability of points in the complex plane. Using the Partition Problem as a case study, we introduce a deterministic “dynamic weaving” algorithm that maps problem instances to braid representations... The key unresolved question is the explicit, universal mapping S → c from problem instances to complex parameters.
Our initial goal was to discover this universal mapping M(S) = c. We sought to prove that a computable function could translate any instance S of the Partition Problem into a coordinate c in the complex plane, such that the dynamics of the Mandelbrot iteration z -> z² + c at that point would reveal the problem's solvability.
This repository contains the complete history of that search—a journey of over 28 prototypes that led to a surprising and profound discovery.
Our investigation unfolded in three distinct phases, with each failure leading to a more sophisticated and powerful theory.
We began by searching for a direct S -> c mapping. We tested numerous models, from simple statistical mappings like "Center of Mass" to the more profound "Phasor Sum," which encoded the additive nature of the problem into the geometry of the complex plane. We simultaneously evolved our "detector," moving from a simple "Unknot Hypothesis" (testing for trivial knots) to more powerful tools like the Alexander Polynomial.
Conclusion of Act I: After exhaustive testing, we reached a definitive negative result. No simple, direct mapping we could construct was capable of consistently separating solvable from unsolvable problems. The correspondence, if it existed, was not this simple.
Inspired by the follow-up paper "General Temporal Relativity (GTR)," we abandoned the search for a single point and embraced a new paradigm: the Mandelbrot set as a multiverse. Each bulb, we hypothesized, was a different mathematical "reference frame" with its own local physical laws (e.g., a different value of π). Our quest shifted to finding the correct universe for each problem. We developed:
- The "Mandelbrot GPS": An attempt to use features of
Sas coordinates to navigate the Mandelbrot set. - The "P-adic Triangulation" Engine: Our most sophisticated mapping, combining number-theoretic signatures from p-adic space with fractal addresses from Hilbert curves.
Conclusion of Act II: Another definitive failure. The data proved that even when our "GPS" worked perfectly, it navigated to universes that did not have the required computational properties. This led us to our final, critical insight.
We realized our very first, hardcoded prototypes had worked for a reason. This was not a coincidence. This led to the final and most successful theory: P-adic Resonance. The hypothesis was that the solvability of a problem S was encoded in the p-adic phase of its "waveform"—a complex p-adic number derived from the set.
This led to the construction of the Power Core: a bespoke, research-grade computational engine for performing complex p-adic trigonometry, developed by extending ComplexQpElem in sage-math. We discovered that this engine was incredibly sensitive, but that its interpretation depended on the nature of the problem—a phenomenon we called the "Scale-Relativity of Harmony." Simple problems required a simple "v1" engine, while complex problems required a more powerful, relational "v2" engine.
This culminated in the AI Analyst: a fully autonomous calibration harness designed to discover the "Generalized Rule"—a formula that could predict the optimal engine and tuning parameters for any given problem.
The AI Analyst's final report was the definitive conclusion of the project.
We have not proven P=NP.
Instead, we have made two profound discoveries:
-
The discovery of the Temporal Resonator: a novel, high-performance, polynomial-time heuristic algorithm for the Partition Problem. The AI Analyst successfully found a "Generalized Rule" that allows the Resonator to self-configure its internal physics, achieving high accuracy (~80-85% in tests) on genuinely hard, random problem instances. This is a powerful new tool for solving real-world optimization problems.
-
The first experimental evidence of a "computability phase transition": Our results strongly suggest that the difficulty of the Partition Problem is not monolithic. The optimal solution strategy is dependent on the measurable, structural properties of the problem instance (its size
n, the magnitude of its numbersbit_length, etc.). We have discovered the "phase diagram" for this problem and have built a machine that can measure a problem's phase and apply the correct "local laws" to solve it.
This repository contains the complete, final version of the scientific instrument.
- A working installation of SageMath (v9.x or v10.x). The code relies on Sage's p-adic number libraries.
power_core_v2.py: The final, production-ready P-adic Power Core. This is the heart of the machine.ai_analyst.py: Dynamic evolving AI learning modelsolver.py: The definitive, unified solver. It contains the "Generalized Rule" learned by the AI Analyst.sanity_check_harness.py: The script to run a final verification of the solver's accuracy on a fresh batch of 100 hard problems.
To run the final verification and see the Temporal Resonator in action:
- Ensure all three Python files are in the same directory.
- Open your terminal.
- Execute the full loop using the SageMath Python interpreter:
sage -python full_loop.py