Skip to content

Variable: Flow

@kortexya/reasoninglayer


@kortexya/reasoninglayer / Flow

const Flow: object

Defined in: src/builders/flow.ts:223

classifyEdges(input): FlowBuilderProblem<ClassifyEdgesVars>

Build a Dulmage-Mendelsohn edge-classification problem.

Each edge is classified as "always", "never", or "sometimes" used across the space of all max flows (or all min-cost max flows when optimal: true).

ClassifyEdgesInput

FlowBuilderProblem<ClassifyEdgesVars>

classifyEdgesObjective(opts): TermInputArg

Low-level: build a single flow_classify_edges_constraint psi-term.

string

boolean

string

string

TermInputArg

edge(from, to, cap, options?): TermInputArg

Low-level: build a single flow_edge_constraint psi-term.

string

string

number

FlowEdgeOptions = {}

TermInputArg

maxFlow(input): FlowBuilderProblem<MaxFlowVars>

Build a max-flow problem.

Emits one flow_edge_constraint per edge, one flow_max_constraint with the requested output binding, and a flow_solve_constraint trigger. Returns the constraint terms plus the names of every output variable.

MaxFlowInput

FlowBuilderProblem<MaxFlowVars>

maxObjective(opts): TermInputArg

Low-level: build a single flow_max_constraint psi-term.

string

string

string

TermInputArg

const constraints = [
Flow.edge('s', 'a', 10),
Flow.edge('a', 't', 10),
Flow.maxObjective({ source: 's', sink: 't', flowValue: '?V' }),
Flow.solve('s', 't'),
];

minCostMaxFlow(input): FlowBuilderProblem<MinCostMaxFlowVars>

Build a min-cost-max-flow problem. Per-edge cost is required for the optimisation to be meaningful (defaults to 0 if absent).

MinCostMaxFlowInput

FlowBuilderProblem<MinCostMaxFlowVars>

minCostMaxFlowObjective(opts): TermInputArg

Low-level: build a single flow_min_cost_max_flow_constraint psi-term.

string

string

string

string

TermInputArg

minCut(input): FlowBuilderProblem<MinCutVars>

Build a min-cut problem.

Emits flow_min_cut_constraint and binds cut_value, cut_edges, source_side, sink_side to the requested variable names (auto-generated when omitted).

MinCutInput

FlowBuilderProblem<MinCutVars>

minCutObjective(opts): TermInputArg

Low-level: build a single flow_min_cut_constraint psi-term.

string

string

string

string

string

string

TermInputArg

node(name): object

Low-level: get the node-variable reference used to identify a node name in goals built by this builder. Exposed so callers composing constraints by hand can refer to the same logical node the high-level helpers would produce — e.g., to add a feature test on the same node term inside the same goal.

string

object

name: string

solve(source, sink): TermInputArg

Low-level: build a single flow_solve_constraint psi-term.

string

string

TermInputArg