This page lists every public method on StructuralComputer with
its signature, return type, and a one-line description. For the
formal stability contract see
STABILITY.md.
For runnable examples see:
No arguments. Returns an instance with an internal Orchestrator
that all method calls dispatch through.
Exact perfect-matching count. Smart-path: Kasteleyn-Pfaffian (O(n³)) for planar inputs with a rotation system; brute force otherwise.
One specific perfect matching, if any exists. Empty list if none.
Exact P(no perfect matching survives) under independent edge failure. Brute-force enumeration of edge subsets at small |E| (cap |E| ≤ 24).
Edges whose removal eliminates all perfect matchings.
Compare two configurations on the chosen reliability metric.
Returns a CompareReport with absolute / relative difference
plus a verdict on which is more reliable.
Single-call audit returning classification, matching count, witness, single-points-of-failure, tail probability.
Classify a constraint set: linear A x = b (mod modulus) plus
optional quadratic constraints x^T Q_i x = c_i (mod 2).
Exact count of x satisfying the constraint set. T0 (linear only): 2^(n - rank(A)). T1 (with quadratic): brute force at small n.
One satisfying assignment as MSB-first integer. T0: Gauss-Jordan
in polynomial time. T1: brute force at small n. Returns None
if no solution exists.
All satisfying assignments. Brute-force enumeration capped at n ≤ 20.
Classify a symmetric signature given as a sequence indexed by Hamming weight 0..arity.
Basis-aware matchgate rank. Always in {0, 1, 2} for symmetric signatures.
True iff the signature is matchgate-realisable in some basis.
Minimum-weight perfect matching. Polynomial-time exact via
Hungarian (bipartite) or Edmonds (general). Returns
{"cost", "matching", "feasible"}.
min_cost_schedule(instance, cost_fn, *, allowed_machines=None, time_windows=None, forbidden_edges=None) -> Dict[str, Any]
Min-cost schedule on a holant_tools.SchedulingInstance. The
cost_fn is (job, machine, slot) -> float. Returns
{"cost", "schedule", "feasible"}.
Min-cost flow on a holant_tools.MinCostFlowInstance. Returns
{"cost", "flow", "feasible"}.
Min-cost rostering on a holant_tools.RosteringInstance. The
preference_fn is (employee, shift) -> float. Returns
{"cost", "roster", "feasible"}.
Min-cost record-to-entity assignment for entity deduplication.
The similarity_fn is (record, candidate) -> float
(LOWER = more similar). Returns
{"cost", "assignment", "entity_groups", "feasible"}.
tropical_instance_coordinates(instance, cost_fn, *, compute_field_distance: bool = False) -> TropicalInstanceCoordinates
One-call diagnostic: "is this SchedulingInstance structurally
well-suited for tropical optimisation?" Returns the
TropicalInstanceCoordinates dataclass with the four-coordinate
viewing-frame apparatus plus tropical-rank diagnostics.
Encoding-selection diagnostic on a list of
holant_tools.ConstraintSpec.
Produce a RewriteSetBlueprint describing how rewritable
constraints would be transformed into rank-1 time-slot
equivalents.
Rewrite rank-explosive CP-SAT constraints in a cp_model.CpModel.
Returns a CPSATRewriteResult with helped: bool and
help_reason_text.
verify_cpsat_rewrite(original_model, rewrite_result, *, enumeration_limit: int = 10000, check_objective: bool = True, max_witnesses: int = 5) -> CPSATVerificationResult
Verify that a CP-SAT rewrite preserves the feasible set + optional objective on the original variables.
Exact perfect-matching count on a non-planar graph, computed by
branching on a small set of "extra" edges that makes the residual
planar. Cost is 2^|extra_edges| * O(|V|^3).
systems_metric(source, target, *, transforms=None, equivalence=None, max_depth=4, stay_in_family=True, both_directions=False)
Exact, directed cost between two structured shapes: the cheapest
admissible transformation path carrying source into a shape equivalent
to target, priced in the tropical (min, +) semiring over the morphism
set transforms (any Reduction-protocol objects or callables returning
a ReductionResult; defaults to [NormaliseGraphFormat()], i.e. a strict
equivalence test).
Returns a SystemsMetricResult (feasible, cost, path,
incommensurable, reason, states_explored, .explain()). The cost is
directed (A→B need not equal B→A), obeys the triangle inequality, and
the result is incommensurable=True (an honest-stop, not a number) when
no admissible path is found within max_depth. With both_directions= True returns {forward, backward, symmetric, asymmetry}.
The default equivalence is a necessary structural fingerprint
(vertex/edge counts, degree sequence, classifier tier); pass a stricter
callable for full isomorphism. Also available as the module-level free
function structural_computing.systems_metric(...).
Return the structural classification of a graph (tier, in-family flag, structural meters, reasoning).
Human-readable: what will the framework do with this graph?
Every method on this page is in the Stable tier at v1.0.0. Signatures are semver-protected; breaking changes require a major-version bump. See STABILITY.md for the full contract.