feat(decomp): biconnected component decomposition and solve plan DAG #26
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement
decomposer.py— the three-stage graph decomposition pipeline that splits a constraint problem into a DAG of independent subproblems, ordered for bottom-up solving.Context
This is Owen's core insight (1991): separating pairs in the constraint graph identify independent subproblems that can be solved separately. The decomposition pipeline uses three stages of increasing granularity, each reducing problem size. The output is a solve plan DAG whose shape matches Silo's existing feature DAG infrastructure, enabling parallel dispatch on workers.
Depends on: #24 (constraint graph), #25 (structural analyzer)
Design
Three-stage decomposition
Stage A — Connected components (trivial, O(V+E)):
Independent constraint clusters that share no parts. Each is a fully separate solve problem. Uses
igraph.Graph.decompose()directly.Example: Two sub-assemblies on the same ground plate with no joints between them → two independent problems.
Stage B — Biconnected components (Owen's method, O(V+E)):
Within each connected component, find biconnected subgraphs via Hopcroft-Tarjan. Articulation points (parts shared between biconnected components) are the "hinges" between subproblems. Each biconnected component becomes a subproblem node in the solve plan.
Uses
igraph.Graph.biconnected_components()andigraph.Graph.articulation_points().Example: A chain A—B—C—D where B and C are articulation points → three biconnected components {A,B}, {B,C}, {C,D} solved in dependency order.
Stage C — Pattern recognition (optional, fast):
Within each biconnected component, check for common mate patterns with closed-form solutions. These get extracted as leaf nodes in the solve plan, solved analytically without invoking N-R. Remaining non-pattern subgraph stays as a numerical subproblem.
Delegated to pattern matchers from #27 (closed-form patterns).
Solve plan DAG
Key invariants
Tasks
SolvePlandata structure with topological sortDecomposer.decompose(ctx) -> SolvePlantests/decomposition/test_decomposer.py:Acceptance criteria
Decomposer.decompose(ctx)returns a validSolvePlanfor all test fixtures