home / skills / a5c-ai / babysitter / flow-network-builder
This skill models optimization problems as network flow problems, building flow networks and selecting optimal algorithms to solve them.
npx playbooks add skill a5c-ai/babysitter --skill flow-network-builderReview the files below or copy the command above to add this skill to your agents.
---
name: flow-network-builder
description: Model optimization problems as network flow problems
allowed-tools:
- Read
- Write
- Grep
- Glob
---
# Flow Network Builder Skill
## Purpose
Model optimization problems as network flow problems, constructing appropriate flow networks and selecting optimal algorithms.
## Capabilities
- Identify max-flow/min-cut modeling opportunities
- Construct flow network from problem description
- Select optimal flow algorithm
- Handle min-cost flow variants
- Bipartite matching reduction
- Circulation problems
## Target Processes
- advanced-graph-algorithms
- graph-modeling
- optimization problems
## Flow Problem Types
1. **Maximum Flow**: Find max flow from source to sink
2. **Minimum Cut**: Partition minimizing cut capacity
3. **Bipartite Matching**: Maximum matching via flow
4. **Min-Cost Max-Flow**: Cheapest maximum flow
5. **Circulation**: Flow with lower bounds
## Reduction Patterns
- Assignment problems -> Bipartite matching
- Scheduling -> Flow with constraints
- Path cover -> Flow reduction
- Edge-disjoint paths -> Unit capacity flow
## Input Schema
```json
{
"type": "object",
"properties": {
"problemDescription": { "type": "string" },
"problemType": {
"type": "string",
"enum": ["maxFlow", "minCut", "matching", "minCostFlow", "circulation"]
},
"constraints": { "type": "object" }
},
"required": ["problemDescription"]
}
```
## Output Schema
```json
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"networkDescription": { "type": "string" },
"nodes": { "type": "array" },
"edges": { "type": "array" },
"source": { "type": "string" },
"sink": { "type": "string" },
"algorithm": { "type": "string" },
"reduction": { "type": "string" }
},
"required": ["success"]
}
```
This skill models optimization problems as network flow problems and produces concrete flow network designs ready for algorithmic solving. It helps translate verbal or formal problem descriptions into nodes, edges, capacities, costs, source/sink selection, and recommended algorithms. The goal is to make graph-modeling decisions explicit so downstream code or solvers can be plugged in deterministically.
Given a problem description and optional problemType or constraints, the skill identifies whether a flow reduction applies (max flow, min cut, bipartite matching, min-cost flow, or circulation). It constructs a networkDescription plus explicit nodes and edges with capacities and costs, selects an algorithm suited to scale and problem type, and indicates any reduction pattern used. The output follows a predictable schema so orchestrators can validate and resume execution.
What input yields the best network designs?
A concise problemDescription plus explicit constraints and expected size lets the skill choose precise node/edge mappings and the most efficient algorithm.
Which algorithms will you recommend?
Recommendations depend on type and scale: Dinic or push-relabel for large max-flow, Edmonds–Karp for clarity, successive shortest path or capacity-scaling for min-cost, and circulation-specific reductions when lower bounds exist.
Can you handle mixed objectives or soft constraints?
Soft constraints are modeled via costs or additional penalty edges; specify priorities so the skill encodes them as min-cost elements or separate feasibility checks.