# Integer programming sandbox

- Human page: https://happytails.ai/en/calculators/integer-programming-sandbox/
- Markdown: https://happytails.ai/en/calculators/integer-programming-sandbox.md
- Structured JSON: https://happytails.ai/agents/en/calculators/integer-programming-sandbox/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `integer-programming-sandbox` |
| Category | calculators |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | run_current_tool |

### Implementation notes

Runs exact branch and bound on your device for up to 8 variables and reports whether the best point is proven optimal.

### Inputs and settings

Text input: Integer program.

Example or placeholder shown in the interface (not a validated fixture):

```text
maximize 5x + 4y
6x + 4y <= 24
```

First line: maximize or minimize and the objective. Then one constraint per line. Up to 4,000 characters. Review the settings before running.

| Setting | Meaning | Control type | Default | Constraints |
| --- | --- | --- | --- | --- |
| `nodes` | Node limit | number | "500" | min=1 max=5000 step=1 |

### Browser-agent workflow

1. Open the human page in a browser that supports WebMCP.
2. Discover the interface exposed by that page; use its actual schema.
3. Select files on the page first when the tool requires files.
4. Call `run_current_tool` with valid input and settings.
5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.

Calls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.

### Planning specification

Programs are limited to 4,000 characters and 40 lines, 8 variables and 8 constraints with two or more variables; the node limit is 1 to 5,000 and the search also stops after 3,000,000 exact arithmetic steps. Everything is computed on your device in a background worker with a 15 second limit. Downloads are a JSON report and a CSV of nodes.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "integer-programming-sandbox",
  "category": "calculators",
  "built": true,
  "requirements": "Programs are limited to 4,000 characters and 40 lines, 8 variables and 8 constraints with two or more variables; the node limit is 1 to 5,000 and the search also stops after 3,000,000 exact arithmetic steps. Everything is computed on your device in a background worker with a 15 second limit. Downloads are a JSON report and a CSV of nodes.",
  "implementation": {
    "fields": [
      {
        "key": "nodes",
        "label": "Node limit",
        "value": "500",
        "type": "number",
        "min": 1,
        "max": 5000,
        "step": 1,
        "help": "The search stops after this many branch-and-bound nodes, from 1 to 5,000."
      }
    ],
    "presentation": "metrics",
    "inputCodeDirection": "ltr",
    "registrationFamily": "exact-math-discrete",
    "inputMaxLength": 4000,
    "inputErrorCode": "EXACT_MATH_DISCRETE_PROGRAM_TOO_LONG",
    "note": "Runs exact branch and bound on your device for up to 8 variables and reports whether the best point is proven optimal.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 4000,
      "inputMode": "text",
      "label": "Integer program",
      "placeholder": "maximize 5x + 4y\n6x + 4y <= 24",
      "help": "First line: maximize or minimize and the objective. Then one constraint per line. Up to 4,000 characters. Review the settings before running.",
      "helpParts": [
        "First line: maximize or minimize and the objective. Then one constraint per line.",
        "Up to 4,000 characters.",
        "Review the settings before running."
      ],
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}
```

## Page guide

Solve a small integer linear program with exact branch and bound and see every node of the search. The best point is reported as proven optimal only when the whole tree has been explored.

### How to use Integer programming sandbox

1. Write the objective on the first line, such as maximize 5x + 4y.
2. Add one constraint per line, bounds such as x, y >= 0, and optional lines such as integer x or binary z.
3. Set the node limit and run the search.
4. Read the status, the incumbent, the best bound and the gap, then download the JSON report or the CSV of nodes.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

## Useful next steps

- [Linear system solver](https://happytails.ai/en/calculators/linear-system-solver/) ([Markdown](https://happytails.ai/en/calculators/linear-system-solver.md))

- [Diophantine equation solver](https://happytails.ai/en/calculators/diophantine-equation-solver/) ([Markdown](https://happytails.ai/en/calculators/diophantine-equation-solver.md))

- [Matrix workspace](https://happytails.ai/en/calculators/matrix-workspace/) ([Markdown](https://happytails.ai/en/calculators/matrix-workspace.md))

Programs are limited to 4,000 characters and 40 lines, 8 variables and 8 constraints with two or more variables; the node limit is 1 to 5,000 and the search also stops after 3,000,000 exact arithmetic steps. Everything is computed on your device in a background worker with a 15 second limit. Downloads are a JSON report and a CSV of nodes.

## Branch and bound

Each node solves the linear relaxation exactly with the simplex method. A fractional integer variable is split into two branches, x <= floor and x >= ceiling. Nodes are pruned when their relaxation is infeasible or cannot beat the best integer point found. Method: Wolsey, Integer Programming, 2nd edition, chapter 7 (2020).

### What proven means

When every node has been solved or pruned with an exact bound, the incumbent is proven optimal, or the problem is proven infeasible. If the node limit or the step budget stops the search first, the incumbent is only the best point found so far, and the report gives the best bound and the gap between them.

### Input rules

Variables are integer unless you list some with integer x, y, in which case the others are continuous. Single-variable constraints become bounds. A relaxation that is unbounded stops the search, because the integer program may then be unbounded or infeasible.
