mixed-integer-programming

mixed-integer-programming is a skill for Claude Code, Codex from VeryMath/AI4Math-Optimization. It costs 30 tokens per session (1,092 once invoked), scanned A, original, MIT.

A tool for modelling and solving mixed-integer linear programs, which are optimisation problems with linear goals and rules where some decisions must be whole numbers or yes/no choices.

In plain words
What is it for?
Use it for problems such as knapsacks, travelling-salesperson routes, production schedules, vehicle routing, network design, and other models with integer or binary decisions.
Why use it?
It helps find the best combination of decisions when ordinary continuous values are not enough, such as choosing locations, assigning work, or scheduling resources.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for problems such as knapsacks, travelling-salesperson routes, production schedules, vehicle routing, network design, and other models with integer or binary decisions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/verymath/ai4math-optimization/mixed-integer-programming
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add VeryMath/AI4Math-Optimization --skill mixed-integer-programming
Clone the repo
git clone --depth 1 https://github.com/VeryMath/AI4Math-Optimization

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mixed-integer-programming

README.md
[![agentmods](https://agentmods.dev/badge/skills/verymath/ai4math-optimization/mixed-integer-programming/github.svg)](https://agentmods.dev/skills/verymath/ai4math-optimization/mixed-integer-programming)
Your own site
<a href="https://agentmods.dev/skills/verymath/ai4math-optimization/mixed-integer-programming"><img src="https://agentmods.dev/badge/skills/verymath/ai4math-optimization/mixed-integer-programming/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mixed-integer-programming

Your own site · 80×15
<a href="https://agentmods.dev/skills/verymath/ai4math-optimization/mixed-integer-programming"><img src="https://agentmods.dev/badge/skills/verymath/ai4math-optimization/mixed-integer-programming.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,092 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.01092
Opus 5.5 $0.00012 $0.00437
Sonnet 5.5 $0.00006 $0.00218
Haiku 4.5 $0.00003 $0.00109

Measured 1mo ago against content hash 59f06f7ebd43, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mixed-integer-programming scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mixed-integer-programming/SKILL.md · 108 lines

What it actually says

混合整数规划(Mixed-Integer Programming, MIP)求解

适用场景

  • 混合整数线性规划:线性目标、线性约束,部分或全部变量为整数。
  • 二进制决策问题:选址、指派、覆盖、启停、固定费用建模。
  • 组合优化建模:背包、TSP、排产、车辆路径、网络设计等。
  • 可线性化问题:逻辑约束、Big-M、indicator、SOS1/SOS2 等。

输入:可以是自然语言/应用题,也可以是矩阵、JSON、已有模型代码或求解器报错。

Quick Start(先做这个)

按下面清单执行并在回答中保留结构。环境准备必须先于求解。

  • 求解器选择与环境准备:
    1. 本建模任务先确认问题类型为 MIP/MILP,并明确用户或当前任务已选定的求解器和接口。
    2. 目标需要安装或配置时,将求解器名称、接口、Python 环境及实际报错交给 ../or-solver/SKILL.md;该 skill 只配置指定目标。
    3. 配置后由本任务继续求解;配置失败时,由本任务决定下一步,必要时走 GitHub 搜索路径。
  • 路径判断:用户给的是自然语言、矩阵/JSON、代码,还是要求从 GitHub 找代码。
  • 符号化:列变量、变量类型、目标、约束和单位。
  • 数值化:给出矩阵、JSON,或直接用求解器 API 建模。
  • 求解并报告:状态、目标值、变量值、MIP gap、求解时间。
  • 验证:检查约束可行性和整数变量取值。

执行流程(三条路径)

flowchart LR
  A[Matrix_or_JSON]
  B[Natural_language]
  C[GitHub_search]
  A --> A1[Build_or_solve_mip]
  B --> B1[Restate]
  B1 --> B2[Clarify_or_assume]
  B2 --> B3[Symbolic_model]
  B3 --> B4[Numeric_or_solver_API]
  B4 --> B5[Solve_and_report]
  A1 --> B5
  C --> C1[Search_GitHub_for_MIP_code]
  C1 --> C2[Fetch_and_adapt_code]
  C2 --> C3[Run_and_report]

路径 A:已有矩阵、JSON 或模型

  1. 核对维度、变量类型、上下界、约束方向和目标方向。
  2. 优先复用已有建模结构,避免把稀疏模型强行转成稠密矩阵。
  3. 使用可用求解器求解,并保存求解器状态和日志要点。

路径 B:自然语言 / 应用题

用户未给数字矩阵时,不要先索要 JSON。按下面顺序推进:

步骤 内容
1. 重述 用一两句话复述题意,便于用户确认。
2. 变量 列出变量名称、含义、单位、类型(binary/integer/continuous)。
3. 模型 写出目标函数和约束,并标明 <= / >= / =。
4. 求解 建模求解,报告目标值、变量值、gap 和状态。
5. 解释 用 1-2 句解释业务含义,必要时说明假设。

路径 C:GitHub 搜索开源代码

当本地无可用求解器,或用户明确要求从 GitHub 找代码时,搜索:

site:github.com mixed integer programming solver python <problem feature>

优先选择近期维护、有 README、纯 Python 或主流求解器接口的项目。抓取 README 和关键文件后,适配用户数据并注明来源。

输出模板(推荐)

### 环境与依赖
- Python 版本:...
- 可用求解器:...
- 选用求解器:...

### 问题重述
...

### 符号化模型
- 决策变量:...
- 目标函数:...
- 约束:...

### 求解结果
- status: ...
- objective: ...
- variables: ...
- mip_gap: ...

### 验证与解释
...
Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed 59f06f7ebd43
  2. 1mo ago First seen · 108 lines · 30 tokens per session scan A ada745e183c2

Subscribe to this mod's changes

mixed-integer-programming is a skill published in the GitHub repository VeryMath/AI4Math-Optimization (11 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 1,092 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

math-beamer

Use when creating, revising, or auditing source-grounded mathematical Beamer slide decks from papers, notes, proofs, lectures, experiments, or existing LaTeX slides across pure mathematics, applied mathematics, computational mathematics, statistics, optimization, geometry, topology, algebra, number theory…

VeryMath/AI4Math-Writing · 100 tokens

paper-writing

Use when drafting, revising, or auditing source-grounded mathematical paper text, including abstracts, introductions, related work, theorem exposition, experiment narratives, revision plans, and response letters.

VeryMath/AI4Math-Writing · 40 tokens

latex-build-and-layout-audit

Use when checking LaTeX paper projects for compilation, latexmk logs, undefined references, citation issues, duplicate labels, macro/package hygiene, layout warnings, floats, arXiv, or venue compatibility.

VeryMath/AI4Math-Writing · 48 tokens

claim-evidence-ledger

Use when auditing mathematical paper drafts for supported claims, missing citations, overclaims, proof status, experiment support, or source-to-text traceability.

VeryMath/AI4Math-Writing · 35 tokens

paper-skeleton-and-logical-architecture

Use when turning mathematical notes, theorem statements, proof sketches, experiments, or reading outputs into a paper skeleton, section plan, result dependency map, or contribution architecture before prose drafting.

VeryMath/AI4Math-Writing · 45 tokens

proof-obligation-and-assumption-audit

Use when checking mathematical paper results for assumptions, quantifiers, domains, dependency fit, edge cases, external theorem use, proof coverage, or theorem-to-claim consistency.

VeryMath/AI4Math-Writing · 43 tokens