← Back to list

TNFR: exploring structural continuity on graph-coupled networks

What a graph-dynamics engine does and a reproducible pattern in its behaviour

fmg · 2026-03-07 15:27 · 0 claps · 7.6 min read
#tnfr #complex-systems #graph-theory #network-science #computational-physics
Open on Medium ↗
Wiki topics: ⚛️ · Physics 🔬 · Science · General

TNFR: exploring structural continuity on graph-coupled networks

What a graph-dynamics engine does and a reproducible pattern in its behaviour

This article describes TNFR (Resonant Fractal Nature Theory) — an open-source Python engine for studying coherent patterns on graph-coupled networks — and one pattern we have observed in its behaviour: when the grammar rules hold, a charge-like structural quantity remains approximately conserved; when they are broken, conservation degrades measurably.

We describe what the engine does, explain how the conservation property was measured and present a simplified reproducible benchmark — published as a Zenodo open-access package (DOI: 10.5281/zenodo.18901015) — that isolates and tests this property in a controlled setting.

The engine source is here: github.com/fermga/TNFR-Python-Engine

What the engine does

TNFR models coherent dynamic patterns on finite graphs. Each node carries:

  • a phase (synchronisation angle),
  • a structural frequency ν_f (reorganisation rate),
  • and a pressure term ΔNFR (structural mismatch with neighbours).

The starting point for the dynamics is the nodal equation:

∂EPI/∂t = ν_f · ΔNFR(t)

where EPI (Primary Information Structure) is the coherent structural configuration at each node.

In practice, the engine organises the evolution of EPI, frequency and phase through sequences of canonical operators. The equation above is the theoretical target that motivates the operator design, though the actual implementation involves discrete time steps, graph-specific approximations and numerical choices that any reader is encouraged to inspect in the source code.

Operator-based evolution

Structural changes in TNFR are channelled through 13 defined operators: Emission, Reception, Coherence, Dissonance, Coupling, Resonance, Silence, Expansion, Contraction, Self-organisation, Mutation, Transition, and Recursivity.

Each operator has:

  • A specified effect on the structural state (how it modifies EPI, ν_f, or phase)
  • Pre/post contracts that constrain its application
  • A grammar classification (generator, stabiliser, destabiliser, or closure)

The design intent is that all structural modifications go through these operators.

In practice, the codebase also includes initialisation routines, SDK convenience methods and numerical utilities that interact with node state — so the claim is architectural rather than an absolute invariant. The operator framework is the primary channel for intentional structural change; the source code is public for anyone who wants to trace the details.

Grammar rules (U1–U6)

Not every operator sequence is valid. TNFR imposes six grammar rules motivated by the nodal equation:

  • U1: Sequences start from generators and end at closures.
  • U2: Destabilisers require accompanying stabilisers, ensuring that ∫ ν_f · ΔNFR dt converges rather than diverging.
  • U3: Coupling and Resonance require phase compatibility: |φ_i - φ_j| ≤ Δφ_max
  • U4: Bifurcation triggers need handlers; transformers need recent destabiliser context.
  • U5: Nested EPIs require stabilisers at each hierarchical level.
  • U6: Structural potential Φ_s must stay below a confinement threshold.

The grammar-dynamics module attempts to enforce these proactively — filtering candidate operators before application rather than only validating sequences after the fact. How completely this works in all code paths is an implementation question; the grammar validation logic and its tests are in the repository for inspection.

Four structural fields

Every node is characterised by four structural fields, computed from the phase and pressure state:

Structural Potential (Φ_s) Global pressure aggregation, computed with inverse-square weighting.

Phase Gradient (∇φ) Local phase mismatch across neighbouring nodes.

Phase Curvature (K_φ) Geometric torsion, measured as deviation from the local circular mean.

Coherence Length (ξ_C) Spatial correlation scale of local coherence.

Their safety thresholds are derived from four mathematical constants — φ, γ, π, and e — rather than fitted from data. The derivations are documented in:

  • FUNDAMENTAL_THEORY.md
  • UNIFIED_GRAMMAR_RULES.md

Whether this “zero empirical fitting” claim holds up to scrutiny depends on how one views the choice of functional forms: the constants are canonical, but the functional relationships are design decisions within the theory.

Conservation monitoring

This is the property that motivated the Zenodo benchmark.

The engine computes a structural charge density at each node:

ρ = Φ_s + K_φ

and an associated structural current J through graph edges.

If evolution is well-behaved, the discrete balance

Δρ/Δt + ∇_G · J ≈ S

should produce a small source term S.

The ConservationTracker class monitors this balance as the system evolves.

What do the numbers look like?

In internal experiments run during development — specifically conservation-focused tests on ring, random, small-world, scale-free, and complete topologies with fixed seeds and small-to-medium graph sizes (N ~ 10–50) — the observed median charge drift was in the range of hundredths of a percent (< 0.03%).

Relative structural charge drift under valid and invalid dynamics across five graph topologies. In this benchmark, grammar-inspired valid evolution keeps drift low in most topologies, while deliberately broken dynamics produce substantially larger deviations.

Relative structural charge drift under valid and invalid dynamics across five graph topologies. In this benchmark, grammar-inspired valid evolution keeps drift low in most topologies, while deliberately broken dynamics produce substantially larger deviations.

The integrity module can flag sequences that degrade conservation and optionally halt execution — making the monitoring active rather than purely diagnostic.

Lyapunov energy functional

The engine tracks a structural energy functional:

E[G] = (1/2) Σ_i [ Φ_s(i)^2 + |∇φ|(i)^2 + K_φ(i)^2 + J_φ(i)^2 + J_ΔNFR(i)^2 ]

Per-operator energy bounds are derived from canonical constants:

  • stabilisers are designed to guarantee ΔE ≤ 0
  • destabilisers have bounded positive contributions

Grammar rule U2 requires that stabilisers accompany destabilisers, so the net energy change across a valid sequence should be non-positive. This is the Lyapunov argument for structural stability. A complete formal proof of asymptotic stability remains open.

The SDK

The API exposes the core capabilities:

from tnfr.sdk import TNFR
net = TNFR.create(20).ring().evolve(5)
tetrad = net.tetrad()                 # Structural field snapshot
cons = net.conservation()             # Conservation report
net.evolve_grammar_aware(steps=10)    # Grammar-checked evolution
report = net.integrity_check()        # Operator postcondition verification

The Zenodo benchmark: isolating the conservation property

The full engine has many moving parts. To share evidence for the conservation property in a controlled, self-contained way, we extracted a simplified benchmark published at Zenodo (DOI: 10.5281/zenodo.18901015).

Structural charge over time for the benchmark regimes. Under grammar-inspired valid dynamics the charge remains comparatively stable, while perturbed and invalid dynamics produce visibly larger deviations over the same horizon.

Structural charge over time for the benchmark regimes. Under grammar-inspired valid dynamics the charge remains comparatively stable, while perturbed and invalid dynamics produce visibly larger deviations over the same horizon.

This package deliberately strips away most of the engine:

  • No EPI evolution, no operators, no grammar module. It implements a simplified proxy: phase updates and diffusive ΔNFR relaxation that follow the spirit of the grammar constraints (bounded, locally coupled, stabilised) without using the formal operator pipeline.
  • Five graph topologies: path, cycle, grid, binary tree, Erdős–Rényi
  • N ≤ 31 nodes, fixed seeds
  • Three regimes: grammar-inspired (valid), perturbed (with noise), and invalid (deliberately broken rules)
  • 30 automated tests that verify every stated claim

What the benchmark shows

Topology-level summary of the benchmark across valid, perturbed, and invalid regimes. The figure shows that approximate continuity is strongest on path, cycle, grid, and Erdős–Rényi graphs, while trees behave anomalously.

Topology-level summary of the benchmark across valid, perturbed, and invalid regimes. The figure shows that approximate continuity is strongest on path, cycle, grid, and Erdős–Rényi graphs, while trees behave anomalously.

Approximate conservation under valid dynamics On four of five topologies, relative charge drift stays below 0.5%.

Measurable degradation under violation Breaking the grammar rules increases drift by factors of ×8 to ×74,000 depending on topology.

Energy monotonicity (mostly) The Lyapunov functional is non-increasing on every time step for path, cycle, grid, and Erdős–Rényi graphs under valid dynamics.

Trees are anomalous Binary trees at intermediate depths (d = 3–5) show positive energy growth even under valid dynamics. The smallest and largest tested trees are stable, suggesting a finite-size crossover. Characterising this boundary analytically remains an open problem.

What the benchmark does not claim

Not a physical conservation law The structural charge is defined within the TNFR formalism; it does not correspond to energy, momentum, or any quantity in conventional physics.

Not a proof The analogy with Noether’s theorem is structural and motivational. A formal proof that discrete grammar constraints imply conservation on finite graphs is an open problem.

EPI is not evolved The full engine does evolve EPI; the benchmark works on phase-derived fields only.

Grammar-inspired, not grammar-enforced The benchmark uses simplified evolution steps, not the formal grammar validator.

Small scale, fixed conditions Generalisation to larger or more diverse graphs is untested.

The benchmark isolates one property of interest in a stripped-down setting. The engine implements the full framework, including the parts the benchmark leaves out.

Interpretation

The grammar rules were designed to ensure coherent evolution — bounded dynamics, phase-compatible coupling, convergent sequences. Conservation was not an explicit design goal.

Tree-specific diagnostic showing that intermediate-depth binary trees display anomalous behaviour under otherwise valid dynamics. This finite-size crossover is one of the clearest signs that the observed continuity pattern is non-universal and topology-dependent.

Tree-specific diagnostic showing that intermediate-depth binary trees display anomalous behaviour under otherwise valid dynamics. This finite-size crossover is one of the clearest signs that the observed continuity pattern is non-universal and topology-dependent.

What we observe is that grammar-compliant dynamics produce a measurable pattern of structural continuity: the charge-like quantity ρ = Φ_s + K_φ drifts slowly under valid evolution and drifts rapidly under invalid evolution.

This holds both in the full engine (where the grammar is enforced through operators) and in the simplified benchmark (where only the spirit of the constraints is followed).

We interpret this as suggestive evidence that structured constraints on graph dynamics tend to produce conserved-like quantities — consistent with the general principle that symmetry-like restrictions can induce approximate conservation even in discrete, finite settings.

But we should be clear about what has and has not been shown:

  • Shown: a reproducible computational pattern across specific topologies, sizes, and seeds.
  • Not shown: a general theorem.

For the TNFR research programme specifically the observation provides internal evidence that the grammar is doing more than preventing divergence — it appears to create measurable structural regularity.

Whether this regularity extends beyond the tested conditions is a question for future work.

Possible immediate applications

Although the present work is exploratory and internal to the TNFR framework, the observed continuity pattern suggests several practical directions worth testing.

Anomaly detection in dynamic networks Large departures from approximate structural continuity may provide an early warning signal for faults, attacks, or loss of coordination in graph-coupled systems. In that sense, structural charge drift could act as a lightweight anomaly indicator for networked processes that are expected to remain coherent over time.

Integrity monitoring for graph simulations Charge drift and Lyapunov-style energy can serve as diagnostic tools for detecting unstable, numerically suspect, or internally inconsistent trajectories. This is one of the most immediate uses of the framework: not as a law of nature, but as a runtime consistency check for simulations on finite graphs.

Robust coordination in distributed systems The results suggest that local grammar-like constraints may help keep distributed systems within stable operating regimes. This could be relevant to multi-agent coordination, swarm control or sensor networks, where bounded local interaction rules are often used to preserve global coherence.

Regularisation for learned graph dynamics Approximate structural continuity could also be explored as an auxiliary constraint in graph neural networks or learned simulators. A model trained to minimise not only prediction error but also structural drift might produce more stable and interpretable dynamics on relational data.

These are application hypotheses rather than validated deployments. At this stage, the benchmark supports them only indirectly, by showing that constrained graph dynamics can produce measurable continuity-like behaviour in a controlled setting.

Try it

Full engine:

pip install tnfr
python -c "
from tnfr.sdk import TNFR
net = TNFR.create(20).ring().evolve(5)
print(net.conservation().summary())
print(net.tetrad().summary())
"

Reproducible benchmark:

# Download from Zenodo DOI: 10.5281/zenodo.18901015
pip install -r requirements.txt
python src/run_conservation_experiment.py
python -m pytest tests/ -v

Further reading

For readers who want to dig deeper into the ideas, methods or theory behind this work:

TNFR engine and documentation

  • Repository: github.com/fermga/TNFR-Python-Engine
  • AGENTS.md — primary theoretical reference
  • STRUCTURAL_CONSERVATION_THEOREM.md
  • UNIFIED_GRAMMAR_RULES.md
  • FUNDAMENTAL_THEORY.md

Zenodo benchmark

  • Martinez Gamo, F. F. (2026). A reproducible benchmark for approximate structural continuity in grammar-inspired TNFR dynamics. Zenodo. DOI: 10.5281/zenodo.18901015

Background concepts referenced in this article

  • Noether, E. (1918). Invariante Variationsprobleme.
  • Kuramoto, Y. (1984). Chemical Oscillations, Waves, and Turbulence.
  • Strogatz, S. H. (2000). From Kuramoto to Crawford.
  • Chung, F. R. K. (1997). Spectral Graph Theory.
  • Barrat, A., Barthélemy, M., & Vespignani, A. (2008). Dynamical Processes on Complex Networks.

메타데이터
post_id
e956e5482e50
slug
tnfr-exploring-structural-continuity-on-graph-coupled-networks-e956e5482e50
url
https://medium.com/@fmartinezgamo/tnfr-exploring-structural-continuity-on-graph-coupled-networks-e956e5482e50
canonical_url
https://medium.com/@fmartinezgamo/tnfr-exploring-structural-continuity-on-graph-coupled-networks-e956e5482e50
author_url
https://medium.com/@fmartinezgamo
status
ok
fetched_at
2026-06-09 15:37:30