molfoundry.FlowSolution#
- class molfoundry.FlowSolution(dg, flow, in_flow, out_flow, obj_value)#
A solved integer hyperflow over a derivation graph: how many times each reaction fires, plus the inflow / outflow on each boundary species.
The flow is an aggregate — it says how many times each reaction fires, not in what order. Whether some order actually realizes it is answered by
is_realizable(); an explicit witness order is aFlowSolutionCertificatefromenumerate_certificates().It is produced by the
FlowModel/FlowModelSMTsolvers.- Parameters:
- is_realizable()#
Return
Trueiff at least one firing order realizes the flow.Delegates to the library-agnostic coverability search on the TS side (it needs only the flow itself, no ILP / SMT solver).
- Return type:
- svg() str#
- svg(printer: DGPrinter | None = None) str
Render the flow overlaid on its derivation graph and return the SVG string — the filtered flow drawing (only the flowing reactions / touched species, each reaction labeled with its firing count and each boundary species with its inflow / outflow).
- print() None#
- print(printer: DGPrinter | None = None) None
Emit the flow drawing (see
svg()) as a summary card.- Parameters:
printer (DGPrinter | None)
- Return type:
None
- enumerate_certificates(limit=None)#
Enumerate valid firing orders (certificates) that realize the flow.
Each is a
FlowSolutionCertificate: a concrete order in which to fire the reactions so no reactant is ever consumed before it exists. This search is library-specific (z3), so it stays on the Python side; it yields up tolimitdistinct orders (all of them whenlimitisNone).- Parameters:
limit (int | None)
- Return type: