Install
$ agentstack add skill-tangledgroup-tangled-skills-cbc-2-10-13 ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ● Shell / process execution Used
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
cbc 2.10.13
Overview
Cbc (Coin-or Branch and Cut) is an open-source mixed-integer linear programming (MILP) solver written in C++. It implements branch-and-cut with configurable cut generators, heuristics, branching rules, and node selection strategies. It can be used as:
- Standalone CLI tool —
cbcexecutable reads MPS/LP files and solves interactively - C API —
#includefor C programs - C++ API —
#includefor full control - OsiSolverInterface —
#includeas a drop-in LP solver replacement
Key capabilities: branch-and-bound with cuts (Gomory, clique, cover, probing, MIR), primal heuristics (rounding, feasibility pump, diving), SOS1/SOS2 constraints, solution pools, MIP start, parallel solving (multi-threaded and multi-process), custom cut callbacks, event handlers, and AMPL/GAMS interfaces.
Usage
CLI
# Solve an MPS file
cbc model.mps
# Interactive mode with parameters
cbc model.mps -solve -quit
# With time limit and other options
cbc model.mps -timeLimit 300 -logLevel 2 -solve -quit
# Read from stdin
cat model.lp | cbc -stdin
C API (minimal)
#include
Cbc_Model *model = Cbc_newModel();
Cbc_readMps(model, "model.mps");
Cbc_setMaximumSeconds(model, 300);
Cbc_solve(model);
if (Cbc_isProvenOptimal(model)) {
double obj = Cbc_getObjValue(model);
const double *sol = Cbc_getColSolution(model);
}
Cbc_deleteModel(model);
C++ API (minimal)
#include
#include
OsiClpSolverInterface solver;
solver.readMps("model.mps");
CbcModel model(solver);
model.branchAndBound();
if (!model.status()) { // 0 = finished
double obj = model.getObjValue();
const double *sol = model.bestSolution();
}
C++ API with CbcMain (full standalone solver features)
#include
#include
#include
OsiClpSolverInterface solver;
solver.readMps("model.mps");
CbcModel model(solver);
CbcMain0(model); // Initialize with default parameters
const char *args[] = { "prog", "-solve", "-quit" };
CbcMain1(3, args, model);
OsiCbcSolverInterface (drop-in solver)
#include
OsiCbcSolverInterface solver;
solver.readMps("model.mps");
solver.initialSolve();
solver.branchAndBound();
Gotchas
- Do not reuse a
CbcModelfor multiple solves —Cbc_solve()andbranchAndBound()mutate internal state. Clone the model withCbc_clone()or create a new one. CbcMain0must be called beforeCbcMain1—CbcMain0initializes default parameters; skipping it means no cut generators, heuristics, or strategy setup.- Model access methods are invalid after solving —
getColLower(),setObjCoeff(), etc. are not valid afterCbc_solve()orbranchAndBound(). Read all data before solving, or clone first. - Solution from solver vs model — After
CbcMain1, the solver is cloned internally. Usemodel.solver()->getColSolution()(current solver) ormodel.bestSolution()(best integer solution found). - Preprocessing loses original variable mapping — If using
CglPreProcess, post-process withprocess.postProcess(*solver)to map solutions back to original variables. OsiCbcSolverInterfacewraps Cbc inside Osi — It works as a drop-in replacement for any Osi-based code, but gives less fine-grained control thanCbcModel.- Parallel solving requires
CBC_THREADdefine — Multi-threaded branch-and-bound needs the library compiled with pthread support. Use-threads NCLI flag ormodel.setNumberThreads(N)in C++. - Status codes need secondary status check —
status() == 0means "finished" but could be optimal or infeasible. CheckisProvenOptimal()orsecondaryStatus()to distinguish. - Cut generators must outlive the model — When adding cut generators with
model.addCutGenerator(&gen, ...), the pointer is stored. Do not let the generator go out of scope during solving. Use heap allocation (new) for safety. - AMPL interface needs ASL library — The AMPL/GMPL interface requires the Ampl Solver Library (ASL). Build with
ThirdParty-ASLvia coinbrew or install separately.
References
- [01-installation](references/01-installation.md) — Dependencies, building from source, package managers, coinbrew
- [02-cli-reference](references/02-cli-reference.md) — Full CLI parameter reference and interactive shell
- [03-c-api](references/03-c-api.md) — C API functions, model creation, solving, solution retrieval
- [04-cpp-api-basics](references/04-cpp-api-basics.md) — CbcModel, OsiCbcSolverInterface, basic solve patterns
- [05-cpp-api-advanced](references/05-cpp-api-advanced.md) — Cut generators, heuristics, branching, callbacks, event handlers
- [06-modeling-integration](references/06-modeling-integration.md) — PuLP, cvxpy, Pyomo, JuMP, MiniZinc, AMPL, GAMS
- [07-python-usage](references/07-python-usage.md) — Detailed Python usage: PuLP, cvxpy, Pyomo, OR-Tools, python-mip, yaposib, subprocess patterns
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: tangledgroup
- Source: tangledgroup/tangled-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.