core/edge_classes.py — The ten abstract reaction-edge classes (Layer 1).
Host-independent. Implements the elementary edge-class catalogue of
Ghoniem (2026), *A Generalized Graph-Based Cluster Dynamics Framework*,
Section 2.2.
Every edge of a reaction admissibility graph (RAG) falls into exactly one
of ten classes, identified by the pattern of polarity and population at
its endpoints and by the form of its stoichiometric tuple. This module
defines the class taxonomy and, for each class, the *abstract
stoichiometric contract* — how many precursor vertices it has, whether it
crosses the polarity layers, and how it shifts size / population /
composition. The concrete, size-resolved rate kernels are supplied by a
host material (Layer 2); the abstract core only fixes the contract that
every host edge of a given class must obey.
The graph-walker assembles the master-equation right-hand side
dc_a/dt = G_a + sum_r S_ar J_r(c) - D_a c_a
by iterating edges; each edge contributes its signed flux S_ar J_r to the
affected vertices. Because the contract below fixes the sign pattern of
S_ar per class, conservation of signed lattice-defect content is a
structural property of the graph, not something re-derived per host.