[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-nvidia-cuopt-numerical-optimization-formulation":3,"mdc--pojbvh-key":31,"related-org-nvidia-cuopt-numerical-optimization-formulation":2237,"related-repo-nvidia-cuopt-numerical-optimization-formulation":2398},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":20,"repoUrl":21,"updatedAt":22,"license":23,"forks":24,"topics":25,"repo":26,"sourceUrl":29,"mdContent":30},"cuopt-numerical-optimization-formulation","formulate numerical optimization problems","LP, MILP, QP — concepts, problem-text parsing, and formulation patterns (parameters, constraints, decisions, objective). Concepts only; no API.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"nvidia","NVIDIA","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fnvidia.png",[12,16,19],{"name":13,"slug":14,"type":15},"Mathematics","mathematics","tag",{"name":17,"slug":18,"type":15},"Optimization","optimization",{"name":9,"slug":8,"type":15},2473,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fskills","2026-07-14T05:29:53.133853","Apache-2.0",281,[],{"repoUrl":21,"stars":20,"forks":24,"topics":27,"description":28},[],"AI agent skills published by NVIDIA","https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Fcuopt-numerical-optimization-formulation","---\nname: cuopt-numerical-optimization-formulation\nversion: \"26.08.00\"\ndescription: LP, MILP, QP — concepts, problem-text parsing, and formulation patterns (parameters, constraints, decisions, objective). Concepts only; no API.\nlicense: Apache-2.0\nmetadata:\n  author: NVIDIA cuOpt Team\n  tags:\n    - linear-programming\n    - milp\n    - qp\n    - formulation\n    - concepts\n---\n\n\n\n# Numerical Optimization Formulation\n\nConcepts and workflow for going from a problem description to a clear formulation across LP, MILP, and QP. No API code here.\n\n## What is LP \u002F MILP \u002F QP\n\n- **LP**: Linear objective, linear constraints, continuous variables.\n- **MILP**: Same as LP plus some integer or binary variables (e.g., scheduling, facility location, selection).\n- **QP**: Quadratic objective (e.g., x², x·y terms — portfolio variance, least squares), linear constraints. **QP support in cuOpt is currently in beta.**\n\n## Identifying problem type\n\n| Property | LP | MILP | QP |\n|---|---|---|---|\n| Objective | Linear | Linear | Quadratic (xᵀQx + cᵀx) |\n| Constraints | Linear | Linear | Linear + convex quadratic (inequality only) via second-order cones |\n| Variables | Continuous | Mixed: continuous + integer\u002Fbinary | Continuous |\n| Sense | min or max | min or max | **minimize only** (negate to max) |\n| Duals \u002F sensitivity | Dual values + reduced costs | **None** (integer optima) | Dual values + reduced costs |\n\nIf the objective is purely linear, prefer LP\u002FMILP — do not artificially introduce quadratic terms. If any variable is integer or binary, the problem is MILP regardless of the rest.\n\n**Post-solve sensitivity (LP \u002F QP only).** Continuous LP and QP solutions expose **dual values** (the marginal objective change per unit a binding constraint is relaxed: *where to invest to improve the outcome*) and **reduced costs** (for a variable the optimizer left at zero, how far it must improve to enter the solution: a *near-miss*). **MILP solutions have no duals** — integer optima are not continuous, so there are none to return. Duals are also unavailable when the model includes quadratic constraints — the second-order cone path returns primal values only. See the language-specific API skills for how to retrieve them after a solve.\n\n## Required formulation questions\n\nAsk these if not already clear:\n\n1. **Decision variables** — What are they? Bounds?\n2. **Objective** — Minimize or maximize? Linear or quadratic? For QP: any squared or cross terms (x², x·y)? If maximize a quadratic, the user must negate and minimize.\n3. **Constraints** — Linear inequalities\u002Fequalities? Convex quadratic constraints (inequality only) are also supported, handled as second-order cones; non-convex or equality quadratic constraints are not.\n4. **Variable types** — All continuous (LP \u002F QP) or some integer\u002Fbinary (MILP)?\n5. **Convexity (QP only)** — For minimization, the quadratic form (matrix Q) should be positive semi-definite for well-posed problems.\n\n## Typical modeling elements\n\n- **Continuous variables** — production amounts, flow, allocations, portfolio weights.\n- **Binary variables** — open\u002Fclose, yes\u002Fno (e.g., facility open, item selected).\n- **Linking constraints** — e.g., production only if facility open (Big-M or indicator).\n- **Resource constraints** — linear cap on usage (materials, time, capacity).\n- **Quadratic objective terms** — variance (xᵀQx), squared error (‖Ax − b‖²), interaction terms.\n\n## Typical QP use cases\n\n- Portfolio optimization — minimize variance subject to return and budget.\n- Least squares — minimize ‖Ax − b‖² subject to linear constraints.\n- Other quadratic objectives with linear constraints.\n\n---\n\n## Problem statement parsing\n\nWhen the user gives **problem text**, classify every sentence and then summarize before formulating. The parsing framework below applies regardless of LP \u002F MILP \u002F QP.\n\n**Classify every sentence** as **parameter\u002Fgiven**, **constraint**, **decision**, or **objective**. Watch for **implicit constraints** (e.g., committed vs optional phrasing) and **implicit objectives** (e.g., \"determine the plan\" + costs → minimize total cost).\n\n**Ambiguity:** If anything is still ambiguous, ask the user or solve all plausible interpretations and report all outcomes; do not assume a single interpretation.\n\n### 🔒 MANDATORY: When in Doubt — Ask\n\n- If there is **any doubt** about whether a constraint or value should be included, **ask the user** and state the possible interpretations.\n\n### 🔒 MANDATORY: Complete-Path Runs — Try All Variants\n\n- When the user asks to **run the complete path** (e.g., end-to-end, full pipeline), run all plausible variants and **report all outcomes** so the user can choose; do not assume a single interpretation.\n\n### Three labels\n\n| Label | Meaning | Examples (sentence type) |\n|-------|--------|---------------------------|\n| **Parameter \u002F given** | Fixed data, inputs, facts. Not chosen by the model. | \"Demand is 100 units.\" \"There are 3 factories.\" \"Costs are $5 per unit.\" |\n| **Constraint** | Something that must hold. May be explicit or **implicit** from phrasing. | \"Capacity is 200.\" \"All demand must be met.\" \"At least 2 shifts must be staffed.\" |\n| **Decision** | Something we choose or optimize. | \"How much to produce.\" \"Which facilities to open.\" \"How many workers to hire.\" |\n| **Objective** | What to minimize or maximize. May be **explicit** (\"minimize cost\") or **implicit** (\"determine the plan\" with costs given). | \"Minimize total cost.\" \"Determine the production plan\" (with costs) → minimize total cost. |\n\n### Implicit constraints: committed vs optional phrasing\n\n**Committed\u002Ffixed phrasing** → treat as **parameter** or **implicit constraint** (everything mentioned is given or must happen). Not a decision.\n\n| Phrasing | Interpretation | Why |\n|----------|-----------------|-----|\n| \"Plans to produce X products\" | **Constraint**: all X must be produced. | Commitment; production level is fixed. |\n| \"Operates 3 factories\" | **Parameter**: all 3 are open. Not a location-selection problem. | Current state is fixed. |\n| \"Employs N workers\" | **Parameter**: all N are employed. Not a hiring decision. | Workforce size is given. |\n| \"Has a capacity of C\" | **Parameter** (C) + **constraint**: usage ≤ C. | Capacity is fixed. |\n| \"Must meet all demand\" | **Constraint**: demand satisfaction. | Explicit requirement. |\n\n**Optional\u002Fdecision phrasing** → treat as **decision**.\n\n| Phrasing | Interpretation | Why |\n|----------|-----------------|-----|\n| \"May produce up to …\" | **Decision**: how much to produce. | Optional level. |\n| \"Can choose to open\" (factories, sites) | **Decision**: which to open. | Selection is decided. |\n| \"Considers hiring\" | **Decision**: how many to hire. | Hiring is under consideration. |\n| \"Decides how much to order\" | **Decision**: order quantities. | Explicit decision. |\n| \"Wants to minimize\u002Fmaximize …\" | **Objective** (drives decisions). | Goal; decisions are the levers. |\n\n### Implicit objectives — do not miss\n\n**If the problem asks to \"determine the plan\" (or similar) but does not state \"minimize\" or \"maximize\" explicitly, the objective is often implicit.** You **MUST** identify it and state it before formulating; do not build a model with no objective.\n\n| Phrasing \u002F context | Likely implicit objective | Why |\n|-------------------|---------------------------|-----|\n| \"Determine the production plan\" + costs given (per unit, per hour, etc.) | **Minimize total cost** (production + inspection\u002Fsales + overtime, etc.) | Plan is chosen; costs are specified → natural goal is to minimize total cost. |\n| \"Determine the plan\" + costs and revenues given | **Maximize profit** (revenue − cost) | Both sides of the ledger → optimize profit. |\n| \"Try to determine the monthly production plan\" + workshop hour costs, inspection\u002Fsales costs | **Minimize total cost** | All cost components are given; no revenue to maximize → minimize total cost. |\n\n**Rule:** When the problem gives cost (or cost and revenue) data and asks to \"determine\", \"find\", or \"establish\" the plan, **always state the objective explicitly** (e.g., \"I'm treating the objective as minimize total cost, since only costs are given.\"). If both cost and revenue are present, state whether you use \"minimize cost\" or \"maximize profit\". Ask the user if unclear.\n\n### Parsing workflow\n\n1. **Split** the problem text into sentences or logical clauses.\n2. **Label** each: parameter\u002Fgiven | constraint | decision | **objective** (if stated).\n3. **Identify the objective (explicit or implicit):** If the problem says \"minimize\u002Fmaximize X\", that's the objective. If it only says \"determine the plan\" (or \"find\", \"establish\") but gives costs (and possibly revenues), the objective is **implicit** — state it (e.g., minimize total cost, or maximize profit) and confirm with the user if ambiguous.\n4. **Flag implicit constraints**: For each sentence, ask — \"Does this state a fixed fact or a requirement (→ parameter\u002Fconstraint), or something we choose (→ decision)?\"\n5. **Resolve ambiguity** by checking verbs and modals:\n   - \"is\", \"has\", \"operates\", \"employs\", \"plans to\" (fixed\u002Fcommitted) → parameter or implicit constraint.\n   - \"may\", \"can choose\", \"considers\", \"decides\", \"wants to\" (optional) → decision or objective.\n6. **🔒 MANDATORY — If anything is still ambiguous** (e.g., a value or constraint could be read two ways): ask the user which interpretation is correct, or solve all plausible interpretations and report all outcomes. Do not assume a single interpretation.\n7. **Summarize** for the user: list parameters, constraints (explicit + flagged implicit), decisions, and **objective (explicit or inferred)** before writing the math formulation.\n\n### Parsing checklist\n\n- [ ] Every sentence has a label (parameter | constraint | decision | objective if stated).\n- [ ] **Objective is identified:** Explicit (\"minimize\u002Fmaximize X\") or implicit (\"determine the plan\" + costs → minimize total cost; + revenues → maximize profit). Never formulate without stating the objective.\n- [ ] Committed phrasing (\"plans to\", \"operates\", \"employs\") → not decisions.\n- [ ] Optional phrasing (\"may\", \"can choose\", \"considers\") → decisions.\n- [ ] Implicit constraints from committed phrasing are written out (e.g., \"all X must be produced\").\n- [ ] **🔒 MANDATORY — Ambiguity:** Any phrase that could be read two ways → I asked the user or I will solve all interpretations and report all outcomes (no silent single interpretation).\n- [ ] Summary is produced before formulating (parameters, constraints, decisions, **objective**).\n\n### Example\n\n**Text:** \"The company operates 3 factories and plans to produce 500 units. It may use overtime at extra cost. Minimize total cost.\"\n\n| Sentence \u002F phrase | Label | Note |\n|-------------------|-------|------|\n| \"Operates 3 factories\" | Parameter | All 3 open; not facility selection. |\n| \"Plans to produce 500 units\" | Constraint (implicit) | All 500 must be produced. |\n| \"May use overtime at extra cost\" | Decision | How much overtime is a decision. |\n| \"Minimize total cost\" | Objective | Drives decisions. |\n\nResult: Parameters = 3 factories, 500 units target. Constraints = produce exactly 500 (implicit from \"plans to produce\"). Decisions = production allocation across factories, overtime amounts. Objective = minimize cost.\n\n**Implicit-objective example:** A problem that asks to \"determine the production plan\" (or similar) and gives cost components (e.g., workshop, inspection, sales) but does not state \"minimize\" or \"maximize\" → **Objective is implicit: minimize total cost**. Always state it explicitly: \"The objective is to minimize total cost.\"\n\n---\n\n## QP rule: minimize only\n\nQP objectives must be **minimization**. To maximize a quadratic expression, negate it and minimize; then negate the optimal value.\n\nFor minimization to be well-posed, the quadratic form `Q` should be positive semi-definite. If `Q` is indefinite, the problem is non-convex and may not have a finite optimum.\n\n---\n\n## Common patterns\n\nThe remaining sections cover specific LP\u002FMILP modeling patterns. Each is independent — read the one that matches your problem.\n\n### Piecewise-linear objectives with integer production\n\nWhen modeling **concave piecewise-linear** profit\u002Fcost functions (e.g., decreasing marginal profit for bulk sales), the standard approach uses continuous segment variables with upper bounds equal to each segment's width. For a maximization with concave profit, the solver fills higher-profit segments first naturally.\n\n**Gotcha:** If the quantity being produced is discrete (pieces, units, items), the **total production** variable must be **INTEGER**, even though segment variables can remain **CONTINUOUS**. Without this, the LP relaxation may yield a fractional total that produces a different (higher or lower) objective than the true integer optimum.\n\n#### Pattern\n\n```\nx_total  — INTEGER (total production of a product)\ns1, s2, … — CONTINUOUS (amount sold in each price segment, bounded by segment width)\n\nLink: x_total = s1 + s2 + …\nResource constraints use x_total.\nObjective uses segment variables × segment profit rates.\n```\n\n### Cutting stock \u002F trim loss problems\n\nIn cutting stock problems, **waste area** includes both **trim loss** (unused width within each cutting pattern) and **over-production** (excess strips produced beyond demand). Minimizing only trim loss (waste width × length per pattern) ignores over-production and yields an incorrect objective.\n\n#### Correct objective\n\nSince the total useful area demanded is a constant, minimizing waste is equivalent to minimizing total material area consumed:\n\n```\nminimize  sum_j (roll_width_j × x_j)\n```\n\nwhere `x_j` is the length cut using pattern `j`. The waste area is then:\n\n```\nwaste = total_material_area − required_useful_area\n```\n\nwhere `required_useful_area = sum_i (order_width_i × order_length_i)`.\n\n#### Gotcha\n\nUsing `sum_j (waste_width_j × x_j)` as the objective only captures trim loss — the unused strip within each pattern. It does **not** penalize over-production of an order. The solver will over-produce narrow orders to fill patterns efficiently, but that excess material is still waste. Always use total material area as the objective.\n\n### Goal programming (preemptive \u002F lexicographic)\n\nGoal programming optimizes multiple objectives in priority order. Implement it as **sequential solves** — one per priority level.\n\n#### Formulation pattern\n\n1. **Hard constraints** — capacity limits, non-negativity, etc. These hold in every phase.\n2. **Goal constraints** — for each goal, introduce deviation variables (d⁻ for underachievement, d⁺ for overachievement) and write an equality: `expression + d⁻ − d⁺ = target`.\n3. **Solve sequentially by priority:**\n   - Phase 1: minimize (or maximize) the relevant deviation for the highest-priority goal.\n   - Phase k: fix all higher-priority deviations at their optimal values, then optimize priority k's deviation.\n\n#### Variable types in goal programming\n\nDeviation variables (d⁻, d⁺) and slack\u002Fidle-time variables are always **continuous**. However, **decision variables must still be INTEGER when they represent discrete\u002Fcountable quantities** (units produced, vehicles, workers, etc.). Do not let the presence of continuous deviation variables cause you to make all variables continuous — the integrality of decision variables directly affects feasibility and objective values.\n\n### Multi-period inventory \u002F purchasing models\n\nIn problems with buying, selling, and warehouse capacity over multiple periods, decide which capacity constraints to include based on the problem's timing assumptions.\n\n#### Pattern\n\nFor each period *t* with inventory balance `stock[t] = stock[t-1] + buy[t] - sell[t]`:\n\n- **End-of-period capacity** (variable bound): `stock[t] \u003C= capacity` — always needed.\n- **After-purchase capacity** (explicit constraint): `stock[t-1] + buy[t] \u003C= capacity` — prevents buying more than the warehouse can hold before any sales occur within the period.\n\n#### When to include the after-purchase constraint\n\n- **Include it** when the problem states or implies that purchases are received before sales happen within a period (sequential operations), or when the warehouse physically cannot exceed capacity at any instant.\n- **Omit it** when buying and selling are concurrent within a period (common in textbook trading\u002Finventory problems) and the capacity applies only to end-of-period stock. Many classic problems only constrain end-of-period inventory.\n\n**Key interaction with the sell constraint:** If the model already has `sell[t] \u003C= stock[t-1]` (grain bought this period cannot be sold this period), the model is bounded even without the after-purchase constraint. The sell constraint prevents unbounded buy-sell cycling. The after-purchase constraint is then an additional physical restriction, not a mathematical necessity.\n\n**Default:** If the problem does not specify timing within a period, use **only** end-of-period capacity (`stock[t] \u003C= capacity`). Add the after-purchase constraint only if the problem explicitly requires it.\n\n### Blending with shared mixing \u002F intermediate processing\n\nIn some blending problems, a subset of raw materials must be **mixed together first** (e.g., in a mixing tank) before being allocated to different products. The resulting intermediate has a **uniform composition** — you cannot independently assign different raw materials to different products.\n\n#### Why the standard blending LP is wrong here\n\nThe standard blending LP uses variables `x[i][j]` (amount of raw material `i` in product `j`) and freely allocates each raw material to each product. When raw materials share a mixing step, the proportions of those raw materials must be **identical** in every product that receives the intermediate. This proportionality constraint is **bilinear** (`x[A,1]*x[B,2] = x[B,1]*x[A,2]`) and cannot be directly expressed in an LP.\n\n#### Linearization strategies\n\n1. **Single-product allocation:** If analysis shows the intermediate is profitable in only one product, allocate all intermediate to that product (set intermediate allocation to other products to zero). The proportionality constraint becomes trivially satisfied. This is the most common case — check profitability of intermediate in each product before attempting a general split.\n\n2. **Parametric over intermediate concentration:** Fix the sulfur\u002Fquality concentration of the intermediate as a parameter `σ`. For each fixed `σ`, the problem is a standard LP (intermediate becomes a virtual raw material with known properties). Solve for a grid of `σ` values or use the structure to find the optimum analytically.\n\n3. **Scenario enumeration:** When only 2–3 products exist, enumerate which products receive the intermediate (all-to-A, all-to-B, split). For each scenario with a single recipient, the LP is standard. For split scenarios, use strategy 2.\n\n#### Profitability check\n\nBefore formulating, check whether using the intermediate in each product is profitable:\n- Compare the **minimum cost per ton** of the intermediate (using cheapest feasible raw material mix) against each product's **selling price**.\n- If `cost_intermediate > sell_price[j]` for some product `j`, the intermediate should not be allocated to product `j`. Raw material C (or other direct inputs) alone may also be unprofitable if `cost_C > sell_price[j]`.\n- This analysis often eliminates the need for a bilinear split entirely.\n",{"data":32,"body":42},{"name":4,"version":33,"description":6,"license":23,"metadata":34},"26.08.00",{"author":35,"tags":36},"NVIDIA cuOpt Team",[37,38,39,40,41],"linear-programming","milp","qp","formulation","concepts",{"type":43,"children":44},"root",[45,54,60,67,108,114,268,273,319,325,330,382,388,441,447,465,469,475,487,538,548,555,577,583,605,611,741,747,771,915,930,1064,1070,1087,1179,1196,1202,1306,1312,1403,1409,1419,1513,1518,1535,1538,1544,1556,1577,1580,1586,1591,1597,1609,1640,1647,1659,1665,1691,1697,1702,1711,1732,1741,1752,1758,1778,1784,1796,1802,1853,1859,1878,1884,1889,1894,1914,1953,1959,1982,2000,2024,2030,2049,2055,2105,2111,2166,2172,2177],{"type":46,"tag":47,"props":48,"children":50},"element","h1",{"id":49},"numerical-optimization-formulation",[51],{"type":52,"value":53},"text","Numerical Optimization Formulation",{"type":46,"tag":55,"props":56,"children":57},"p",{},[58],{"type":52,"value":59},"Concepts and workflow for going from a problem description to a clear formulation across LP, MILP, and QP. No API code here.",{"type":46,"tag":61,"props":62,"children":64},"h2",{"id":63},"what-is-lp-milp-qp",[65],{"type":52,"value":66},"What is LP \u002F MILP \u002F QP",{"type":46,"tag":68,"props":69,"children":70},"ul",{},[71,83,93],{"type":46,"tag":72,"props":73,"children":74},"li",{},[75,81],{"type":46,"tag":76,"props":77,"children":78},"strong",{},[79],{"type":52,"value":80},"LP",{"type":52,"value":82},": Linear objective, linear constraints, continuous variables.",{"type":46,"tag":72,"props":84,"children":85},{},[86,91],{"type":46,"tag":76,"props":87,"children":88},{},[89],{"type":52,"value":90},"MILP",{"type":52,"value":92},": Same as LP plus some integer or binary variables (e.g., scheduling, facility location, selection).",{"type":46,"tag":72,"props":94,"children":95},{},[96,101,103],{"type":46,"tag":76,"props":97,"children":98},{},[99],{"type":52,"value":100},"QP",{"type":52,"value":102},": Quadratic objective (e.g., x², x·y terms — portfolio variance, least squares), linear constraints. ",{"type":46,"tag":76,"props":104,"children":105},{},[106],{"type":52,"value":107},"QP support in cuOpt is currently in beta.",{"type":46,"tag":61,"props":109,"children":111},{"id":110},"identifying-problem-type",[112],{"type":52,"value":113},"Identifying problem type",{"type":46,"tag":115,"props":116,"children":117},"table",{},[118,144],{"type":46,"tag":119,"props":120,"children":121},"thead",{},[122],{"type":46,"tag":123,"props":124,"children":125},"tr",{},[126,132,136,140],{"type":46,"tag":127,"props":128,"children":129},"th",{},[130],{"type":52,"value":131},"Property",{"type":46,"tag":127,"props":133,"children":134},{},[135],{"type":52,"value":80},{"type":46,"tag":127,"props":137,"children":138},{},[139],{"type":52,"value":90},{"type":46,"tag":127,"props":141,"children":142},{},[143],{"type":52,"value":100},{"type":46,"tag":145,"props":146,"children":147},"tbody",{},[148,171,192,214,241],{"type":46,"tag":123,"props":149,"children":150},{},[151,157,162,166],{"type":46,"tag":152,"props":153,"children":154},"td",{},[155],{"type":52,"value":156},"Objective",{"type":46,"tag":152,"props":158,"children":159},{},[160],{"type":52,"value":161},"Linear",{"type":46,"tag":152,"props":163,"children":164},{},[165],{"type":52,"value":161},{"type":46,"tag":152,"props":167,"children":168},{},[169],{"type":52,"value":170},"Quadratic (xᵀQx + cᵀx)",{"type":46,"tag":123,"props":172,"children":173},{},[174,179,183,187],{"type":46,"tag":152,"props":175,"children":176},{},[177],{"type":52,"value":178},"Constraints",{"type":46,"tag":152,"props":180,"children":181},{},[182],{"type":52,"value":161},{"type":46,"tag":152,"props":184,"children":185},{},[186],{"type":52,"value":161},{"type":46,"tag":152,"props":188,"children":189},{},[190],{"type":52,"value":191},"Linear + convex quadratic (inequality only) via second-order cones",{"type":46,"tag":123,"props":193,"children":194},{},[195,200,205,210],{"type":46,"tag":152,"props":196,"children":197},{},[198],{"type":52,"value":199},"Variables",{"type":46,"tag":152,"props":201,"children":202},{},[203],{"type":52,"value":204},"Continuous",{"type":46,"tag":152,"props":206,"children":207},{},[208],{"type":52,"value":209},"Mixed: continuous + integer\u002Fbinary",{"type":46,"tag":152,"props":211,"children":212},{},[213],{"type":52,"value":204},{"type":46,"tag":123,"props":215,"children":216},{},[217,222,227,231],{"type":46,"tag":152,"props":218,"children":219},{},[220],{"type":52,"value":221},"Sense",{"type":46,"tag":152,"props":223,"children":224},{},[225],{"type":52,"value":226},"min or max",{"type":46,"tag":152,"props":228,"children":229},{},[230],{"type":52,"value":226},{"type":46,"tag":152,"props":232,"children":233},{},[234,239],{"type":46,"tag":76,"props":235,"children":236},{},[237],{"type":52,"value":238},"minimize only",{"type":52,"value":240}," (negate to max)",{"type":46,"tag":123,"props":242,"children":243},{},[244,249,254,264],{"type":46,"tag":152,"props":245,"children":246},{},[247],{"type":52,"value":248},"Duals \u002F sensitivity",{"type":46,"tag":152,"props":250,"children":251},{},[252],{"type":52,"value":253},"Dual values + reduced costs",{"type":46,"tag":152,"props":255,"children":256},{},[257,262],{"type":46,"tag":76,"props":258,"children":259},{},[260],{"type":52,"value":261},"None",{"type":52,"value":263}," (integer optima)",{"type":46,"tag":152,"props":265,"children":266},{},[267],{"type":52,"value":253},{"type":46,"tag":55,"props":269,"children":270},{},[271],{"type":52,"value":272},"If the objective is purely linear, prefer LP\u002FMILP — do not artificially introduce quadratic terms. If any variable is integer or binary, the problem is MILP regardless of the rest.",{"type":46,"tag":55,"props":274,"children":275},{},[276,281,283,288,290,296,298,303,305,310,312,317],{"type":46,"tag":76,"props":277,"children":278},{},[279],{"type":52,"value":280},"Post-solve sensitivity (LP \u002F QP only).",{"type":52,"value":282}," Continuous LP and QP solutions expose ",{"type":46,"tag":76,"props":284,"children":285},{},[286],{"type":52,"value":287},"dual values",{"type":52,"value":289}," (the marginal objective change per unit a binding constraint is relaxed: ",{"type":46,"tag":291,"props":292,"children":293},"em",{},[294],{"type":52,"value":295},"where to invest to improve the outcome",{"type":52,"value":297},") and ",{"type":46,"tag":76,"props":299,"children":300},{},[301],{"type":52,"value":302},"reduced costs",{"type":52,"value":304}," (for a variable the optimizer left at zero, how far it must improve to enter the solution: a ",{"type":46,"tag":291,"props":306,"children":307},{},[308],{"type":52,"value":309},"near-miss",{"type":52,"value":311},"). ",{"type":46,"tag":76,"props":313,"children":314},{},[315],{"type":52,"value":316},"MILP solutions have no duals",{"type":52,"value":318}," — integer optima are not continuous, so there are none to return. Duals are also unavailable when the model includes quadratic constraints — the second-order cone path returns primal values only. See the language-specific API skills for how to retrieve them after a solve.",{"type":46,"tag":61,"props":320,"children":322},{"id":321},"required-formulation-questions",[323],{"type":52,"value":324},"Required formulation questions",{"type":46,"tag":55,"props":326,"children":327},{},[328],{"type":52,"value":329},"Ask these if not already clear:",{"type":46,"tag":331,"props":332,"children":333},"ol",{},[334,344,353,362,372],{"type":46,"tag":72,"props":335,"children":336},{},[337,342],{"type":46,"tag":76,"props":338,"children":339},{},[340],{"type":52,"value":341},"Decision variables",{"type":52,"value":343}," — What are they? Bounds?",{"type":46,"tag":72,"props":345,"children":346},{},[347,351],{"type":46,"tag":76,"props":348,"children":349},{},[350],{"type":52,"value":156},{"type":52,"value":352}," — Minimize or maximize? Linear or quadratic? For QP: any squared or cross terms (x², x·y)? If maximize a quadratic, the user must negate and minimize.",{"type":46,"tag":72,"props":354,"children":355},{},[356,360],{"type":46,"tag":76,"props":357,"children":358},{},[359],{"type":52,"value":178},{"type":52,"value":361}," — Linear inequalities\u002Fequalities? Convex quadratic constraints (inequality only) are also supported, handled as second-order cones; non-convex or equality quadratic constraints are not.",{"type":46,"tag":72,"props":363,"children":364},{},[365,370],{"type":46,"tag":76,"props":366,"children":367},{},[368],{"type":52,"value":369},"Variable types",{"type":52,"value":371}," — All continuous (LP \u002F QP) or some integer\u002Fbinary (MILP)?",{"type":46,"tag":72,"props":373,"children":374},{},[375,380],{"type":46,"tag":76,"props":376,"children":377},{},[378],{"type":52,"value":379},"Convexity (QP only)",{"type":52,"value":381}," — For minimization, the quadratic form (matrix Q) should be positive semi-definite for well-posed problems.",{"type":46,"tag":61,"props":383,"children":385},{"id":384},"typical-modeling-elements",[386],{"type":52,"value":387},"Typical modeling elements",{"type":46,"tag":68,"props":389,"children":390},{},[391,401,411,421,431],{"type":46,"tag":72,"props":392,"children":393},{},[394,399],{"type":46,"tag":76,"props":395,"children":396},{},[397],{"type":52,"value":398},"Continuous variables",{"type":52,"value":400}," — production amounts, flow, allocations, portfolio weights.",{"type":46,"tag":72,"props":402,"children":403},{},[404,409],{"type":46,"tag":76,"props":405,"children":406},{},[407],{"type":52,"value":408},"Binary variables",{"type":52,"value":410}," — open\u002Fclose, yes\u002Fno (e.g., facility open, item selected).",{"type":46,"tag":72,"props":412,"children":413},{},[414,419],{"type":46,"tag":76,"props":415,"children":416},{},[417],{"type":52,"value":418},"Linking constraints",{"type":52,"value":420}," — e.g., production only if facility open (Big-M or indicator).",{"type":46,"tag":72,"props":422,"children":423},{},[424,429],{"type":46,"tag":76,"props":425,"children":426},{},[427],{"type":52,"value":428},"Resource constraints",{"type":52,"value":430}," — linear cap on usage (materials, time, capacity).",{"type":46,"tag":72,"props":432,"children":433},{},[434,439],{"type":46,"tag":76,"props":435,"children":436},{},[437],{"type":52,"value":438},"Quadratic objective terms",{"type":52,"value":440}," — variance (xᵀQx), squared error (‖Ax − b‖²), interaction terms.",{"type":46,"tag":61,"props":442,"children":444},{"id":443},"typical-qp-use-cases",[445],{"type":52,"value":446},"Typical QP use cases",{"type":46,"tag":68,"props":448,"children":449},{},[450,455,460],{"type":46,"tag":72,"props":451,"children":452},{},[453],{"type":52,"value":454},"Portfolio optimization — minimize variance subject to return and budget.",{"type":46,"tag":72,"props":456,"children":457},{},[458],{"type":52,"value":459},"Least squares — minimize ‖Ax − b‖² subject to linear constraints.",{"type":46,"tag":72,"props":461,"children":462},{},[463],{"type":52,"value":464},"Other quadratic objectives with linear constraints.",{"type":46,"tag":466,"props":467,"children":468},"hr",{},[],{"type":46,"tag":61,"props":470,"children":472},{"id":471},"problem-statement-parsing",[473],{"type":52,"value":474},"Problem statement parsing",{"type":46,"tag":55,"props":476,"children":477},{},[478,480,485],{"type":52,"value":479},"When the user gives ",{"type":46,"tag":76,"props":481,"children":482},{},[483],{"type":52,"value":484},"problem text",{"type":52,"value":486},", classify every sentence and then summarize before formulating. The parsing framework below applies regardless of LP \u002F MILP \u002F QP.",{"type":46,"tag":55,"props":488,"children":489},{},[490,495,497,502,504,509,510,515,517,522,524,529,531,536],{"type":46,"tag":76,"props":491,"children":492},{},[493],{"type":52,"value":494},"Classify every sentence",{"type":52,"value":496}," as ",{"type":46,"tag":76,"props":498,"children":499},{},[500],{"type":52,"value":501},"parameter\u002Fgiven",{"type":52,"value":503},", ",{"type":46,"tag":76,"props":505,"children":506},{},[507],{"type":52,"value":508},"constraint",{"type":52,"value":503},{"type":46,"tag":76,"props":511,"children":512},{},[513],{"type":52,"value":514},"decision",{"type":52,"value":516},", or ",{"type":46,"tag":76,"props":518,"children":519},{},[520],{"type":52,"value":521},"objective",{"type":52,"value":523},". Watch for ",{"type":46,"tag":76,"props":525,"children":526},{},[527],{"type":52,"value":528},"implicit constraints",{"type":52,"value":530}," (e.g., committed vs optional phrasing) and ",{"type":46,"tag":76,"props":532,"children":533},{},[534],{"type":52,"value":535},"implicit objectives",{"type":52,"value":537}," (e.g., \"determine the plan\" + costs → minimize total cost).",{"type":46,"tag":55,"props":539,"children":540},{},[541,546],{"type":46,"tag":76,"props":542,"children":543},{},[544],{"type":52,"value":545},"Ambiguity:",{"type":52,"value":547}," If anything is still ambiguous, ask the user or solve all plausible interpretations and report all outcomes; do not assume a single interpretation.",{"type":46,"tag":549,"props":550,"children":552},"h3",{"id":551},"mandatory-when-in-doubt-ask",[553],{"type":52,"value":554},"🔒 MANDATORY: When in Doubt — Ask",{"type":46,"tag":68,"props":556,"children":557},{},[558],{"type":46,"tag":72,"props":559,"children":560},{},[561,563,568,570,575],{"type":52,"value":562},"If there is ",{"type":46,"tag":76,"props":564,"children":565},{},[566],{"type":52,"value":567},"any doubt",{"type":52,"value":569}," about whether a constraint or value should be included, ",{"type":46,"tag":76,"props":571,"children":572},{},[573],{"type":52,"value":574},"ask the user",{"type":52,"value":576}," and state the possible interpretations.",{"type":46,"tag":549,"props":578,"children":580},{"id":579},"mandatory-complete-path-runs-try-all-variants",[581],{"type":52,"value":582},"🔒 MANDATORY: Complete-Path Runs — Try All Variants",{"type":46,"tag":68,"props":584,"children":585},{},[586],{"type":46,"tag":72,"props":587,"children":588},{},[589,591,596,598,603],{"type":52,"value":590},"When the user asks to ",{"type":46,"tag":76,"props":592,"children":593},{},[594],{"type":52,"value":595},"run the complete path",{"type":52,"value":597}," (e.g., end-to-end, full pipeline), run all plausible variants and ",{"type":46,"tag":76,"props":599,"children":600},{},[601],{"type":52,"value":602},"report all outcomes",{"type":52,"value":604}," so the user can choose; do not assume a single interpretation.",{"type":46,"tag":549,"props":606,"children":608},{"id":607},"three-labels",[609],{"type":52,"value":610},"Three labels",{"type":46,"tag":115,"props":612,"children":613},{},[614,635],{"type":46,"tag":119,"props":615,"children":616},{},[617],{"type":46,"tag":123,"props":618,"children":619},{},[620,625,630],{"type":46,"tag":127,"props":621,"children":622},{},[623],{"type":52,"value":624},"Label",{"type":46,"tag":127,"props":626,"children":627},{},[628],{"type":52,"value":629},"Meaning",{"type":46,"tag":127,"props":631,"children":632},{},[633],{"type":52,"value":634},"Examples (sentence type)",{"type":46,"tag":145,"props":636,"children":637},{},[638,659,687,708],{"type":46,"tag":123,"props":639,"children":640},{},[641,649,654],{"type":46,"tag":152,"props":642,"children":643},{},[644],{"type":46,"tag":76,"props":645,"children":646},{},[647],{"type":52,"value":648},"Parameter \u002F given",{"type":46,"tag":152,"props":650,"children":651},{},[652],{"type":52,"value":653},"Fixed data, inputs, facts. Not chosen by the model.",{"type":46,"tag":152,"props":655,"children":656},{},[657],{"type":52,"value":658},"\"Demand is 100 units.\" \"There are 3 factories.\" \"Costs are $5 per unit.\"",{"type":46,"tag":123,"props":660,"children":661},{},[662,670,682],{"type":46,"tag":152,"props":663,"children":664},{},[665],{"type":46,"tag":76,"props":666,"children":667},{},[668],{"type":52,"value":669},"Constraint",{"type":46,"tag":152,"props":671,"children":672},{},[673,675,680],{"type":52,"value":674},"Something that must hold. May be explicit or ",{"type":46,"tag":76,"props":676,"children":677},{},[678],{"type":52,"value":679},"implicit",{"type":52,"value":681}," from phrasing.",{"type":46,"tag":152,"props":683,"children":684},{},[685],{"type":52,"value":686},"\"Capacity is 200.\" \"All demand must be met.\" \"At least 2 shifts must be staffed.\"",{"type":46,"tag":123,"props":688,"children":689},{},[690,698,703],{"type":46,"tag":152,"props":691,"children":692},{},[693],{"type":46,"tag":76,"props":694,"children":695},{},[696],{"type":52,"value":697},"Decision",{"type":46,"tag":152,"props":699,"children":700},{},[701],{"type":52,"value":702},"Something we choose or optimize.",{"type":46,"tag":152,"props":704,"children":705},{},[706],{"type":52,"value":707},"\"How much to produce.\" \"Which facilities to open.\" \"How many workers to hire.\"",{"type":46,"tag":123,"props":709,"children":710},{},[711,718,736],{"type":46,"tag":152,"props":712,"children":713},{},[714],{"type":46,"tag":76,"props":715,"children":716},{},[717],{"type":52,"value":156},{"type":46,"tag":152,"props":719,"children":720},{},[721,723,728,730,734],{"type":52,"value":722},"What to minimize or maximize. May be ",{"type":46,"tag":76,"props":724,"children":725},{},[726],{"type":52,"value":727},"explicit",{"type":52,"value":729}," (\"minimize cost\") or ",{"type":46,"tag":76,"props":731,"children":732},{},[733],{"type":52,"value":679},{"type":52,"value":735}," (\"determine the plan\" with costs given).",{"type":46,"tag":152,"props":737,"children":738},{},[739],{"type":52,"value":740},"\"Minimize total cost.\" \"Determine the production plan\" (with costs) → minimize total cost.",{"type":46,"tag":549,"props":742,"children":744},{"id":743},"implicit-constraints-committed-vs-optional-phrasing",[745],{"type":52,"value":746},"Implicit constraints: committed vs optional phrasing",{"type":46,"tag":55,"props":748,"children":749},{},[750,755,757,762,764,769],{"type":46,"tag":76,"props":751,"children":752},{},[753],{"type":52,"value":754},"Committed\u002Ffixed phrasing",{"type":52,"value":756}," → treat as ",{"type":46,"tag":76,"props":758,"children":759},{},[760],{"type":52,"value":761},"parameter",{"type":52,"value":763}," or ",{"type":46,"tag":76,"props":765,"children":766},{},[767],{"type":52,"value":768},"implicit constraint",{"type":52,"value":770}," (everything mentioned is given or must happen). Not a decision.",{"type":46,"tag":115,"props":772,"children":773},{},[774,795],{"type":46,"tag":119,"props":775,"children":776},{},[777],{"type":46,"tag":123,"props":778,"children":779},{},[780,785,790],{"type":46,"tag":127,"props":781,"children":782},{},[783],{"type":52,"value":784},"Phrasing",{"type":46,"tag":127,"props":786,"children":787},{},[788],{"type":52,"value":789},"Interpretation",{"type":46,"tag":127,"props":791,"children":792},{},[793],{"type":52,"value":794},"Why",{"type":46,"tag":145,"props":796,"children":797},{},[798,820,843,865,893],{"type":46,"tag":123,"props":799,"children":800},{},[801,806,815],{"type":46,"tag":152,"props":802,"children":803},{},[804],{"type":52,"value":805},"\"Plans to produce X products\"",{"type":46,"tag":152,"props":807,"children":808},{},[809,813],{"type":46,"tag":76,"props":810,"children":811},{},[812],{"type":52,"value":669},{"type":52,"value":814},": all X must be produced.",{"type":46,"tag":152,"props":816,"children":817},{},[818],{"type":52,"value":819},"Commitment; production level is fixed.",{"type":46,"tag":123,"props":821,"children":822},{},[823,828,838],{"type":46,"tag":152,"props":824,"children":825},{},[826],{"type":52,"value":827},"\"Operates 3 factories\"",{"type":46,"tag":152,"props":829,"children":830},{},[831,836],{"type":46,"tag":76,"props":832,"children":833},{},[834],{"type":52,"value":835},"Parameter",{"type":52,"value":837},": all 3 are open. Not a location-selection problem.",{"type":46,"tag":152,"props":839,"children":840},{},[841],{"type":52,"value":842},"Current state is fixed.",{"type":46,"tag":123,"props":844,"children":845},{},[846,851,860],{"type":46,"tag":152,"props":847,"children":848},{},[849],{"type":52,"value":850},"\"Employs N workers\"",{"type":46,"tag":152,"props":852,"children":853},{},[854,858],{"type":46,"tag":76,"props":855,"children":856},{},[857],{"type":52,"value":835},{"type":52,"value":859},": all N are employed. Not a hiring decision.",{"type":46,"tag":152,"props":861,"children":862},{},[863],{"type":52,"value":864},"Workforce size is given.",{"type":46,"tag":123,"props":866,"children":867},{},[868,873,888],{"type":46,"tag":152,"props":869,"children":870},{},[871],{"type":52,"value":872},"\"Has a capacity of C\"",{"type":46,"tag":152,"props":874,"children":875},{},[876,880,882,886],{"type":46,"tag":76,"props":877,"children":878},{},[879],{"type":52,"value":835},{"type":52,"value":881}," (C) + ",{"type":46,"tag":76,"props":883,"children":884},{},[885],{"type":52,"value":508},{"type":52,"value":887},": usage ≤ C.",{"type":46,"tag":152,"props":889,"children":890},{},[891],{"type":52,"value":892},"Capacity is fixed.",{"type":46,"tag":123,"props":894,"children":895},{},[896,901,910],{"type":46,"tag":152,"props":897,"children":898},{},[899],{"type":52,"value":900},"\"Must meet all demand\"",{"type":46,"tag":152,"props":902,"children":903},{},[904,908],{"type":46,"tag":76,"props":905,"children":906},{},[907],{"type":52,"value":669},{"type":52,"value":909},": demand satisfaction.",{"type":46,"tag":152,"props":911,"children":912},{},[913],{"type":52,"value":914},"Explicit requirement.",{"type":46,"tag":55,"props":916,"children":917},{},[918,923,924,928],{"type":46,"tag":76,"props":919,"children":920},{},[921],{"type":52,"value":922},"Optional\u002Fdecision phrasing",{"type":52,"value":756},{"type":46,"tag":76,"props":925,"children":926},{},[927],{"type":52,"value":514},{"type":52,"value":929},".",{"type":46,"tag":115,"props":931,"children":932},{},[933,951],{"type":46,"tag":119,"props":934,"children":935},{},[936],{"type":46,"tag":123,"props":937,"children":938},{},[939,943,947],{"type":46,"tag":127,"props":940,"children":941},{},[942],{"type":52,"value":784},{"type":46,"tag":127,"props":944,"children":945},{},[946],{"type":52,"value":789},{"type":46,"tag":127,"props":948,"children":949},{},[950],{"type":52,"value":794},{"type":46,"tag":145,"props":952,"children":953},{},[954,976,998,1020,1042],{"type":46,"tag":123,"props":955,"children":956},{},[957,962,971],{"type":46,"tag":152,"props":958,"children":959},{},[960],{"type":52,"value":961},"\"May produce up to …\"",{"type":46,"tag":152,"props":963,"children":964},{},[965,969],{"type":46,"tag":76,"props":966,"children":967},{},[968],{"type":52,"value":697},{"type":52,"value":970},": how much to produce.",{"type":46,"tag":152,"props":972,"children":973},{},[974],{"type":52,"value":975},"Optional level.",{"type":46,"tag":123,"props":977,"children":978},{},[979,984,993],{"type":46,"tag":152,"props":980,"children":981},{},[982],{"type":52,"value":983},"\"Can choose to open\" (factories, sites)",{"type":46,"tag":152,"props":985,"children":986},{},[987,991],{"type":46,"tag":76,"props":988,"children":989},{},[990],{"type":52,"value":697},{"type":52,"value":992},": which to open.",{"type":46,"tag":152,"props":994,"children":995},{},[996],{"type":52,"value":997},"Selection is decided.",{"type":46,"tag":123,"props":999,"children":1000},{},[1001,1006,1015],{"type":46,"tag":152,"props":1002,"children":1003},{},[1004],{"type":52,"value":1005},"\"Considers hiring\"",{"type":46,"tag":152,"props":1007,"children":1008},{},[1009,1013],{"type":46,"tag":76,"props":1010,"children":1011},{},[1012],{"type":52,"value":697},{"type":52,"value":1014},": how many to hire.",{"type":46,"tag":152,"props":1016,"children":1017},{},[1018],{"type":52,"value":1019},"Hiring is under consideration.",{"type":46,"tag":123,"props":1021,"children":1022},{},[1023,1028,1037],{"type":46,"tag":152,"props":1024,"children":1025},{},[1026],{"type":52,"value":1027},"\"Decides how much to order\"",{"type":46,"tag":152,"props":1029,"children":1030},{},[1031,1035],{"type":46,"tag":76,"props":1032,"children":1033},{},[1034],{"type":52,"value":697},{"type":52,"value":1036},": order quantities.",{"type":46,"tag":152,"props":1038,"children":1039},{},[1040],{"type":52,"value":1041},"Explicit decision.",{"type":46,"tag":123,"props":1043,"children":1044},{},[1045,1050,1059],{"type":46,"tag":152,"props":1046,"children":1047},{},[1048],{"type":52,"value":1049},"\"Wants to minimize\u002Fmaximize …\"",{"type":46,"tag":152,"props":1051,"children":1052},{},[1053,1057],{"type":46,"tag":76,"props":1054,"children":1055},{},[1056],{"type":52,"value":156},{"type":52,"value":1058}," (drives decisions).",{"type":46,"tag":152,"props":1060,"children":1061},{},[1062],{"type":52,"value":1063},"Goal; decisions are the levers.",{"type":46,"tag":549,"props":1065,"children":1067},{"id":1066},"implicit-objectives-do-not-miss",[1068],{"type":52,"value":1069},"Implicit objectives — do not miss",{"type":46,"tag":55,"props":1071,"children":1072},{},[1073,1078,1080,1085],{"type":46,"tag":76,"props":1074,"children":1075},{},[1076],{"type":52,"value":1077},"If the problem asks to \"determine the plan\" (or similar) but does not state \"minimize\" or \"maximize\" explicitly, the objective is often implicit.",{"type":52,"value":1079}," You ",{"type":46,"tag":76,"props":1081,"children":1082},{},[1083],{"type":52,"value":1084},"MUST",{"type":52,"value":1086}," identify it and state it before formulating; do not build a model with no objective.",{"type":46,"tag":115,"props":1088,"children":1089},{},[1090,1110],{"type":46,"tag":119,"props":1091,"children":1092},{},[1093],{"type":46,"tag":123,"props":1094,"children":1095},{},[1096,1101,1106],{"type":46,"tag":127,"props":1097,"children":1098},{},[1099],{"type":52,"value":1100},"Phrasing \u002F context",{"type":46,"tag":127,"props":1102,"children":1103},{},[1104],{"type":52,"value":1105},"Likely implicit objective",{"type":46,"tag":127,"props":1107,"children":1108},{},[1109],{"type":52,"value":794},{"type":46,"tag":145,"props":1111,"children":1112},{},[1113,1136,1159],{"type":46,"tag":123,"props":1114,"children":1115},{},[1116,1121,1131],{"type":46,"tag":152,"props":1117,"children":1118},{},[1119],{"type":52,"value":1120},"\"Determine the production plan\" + costs given (per unit, per hour, etc.)",{"type":46,"tag":152,"props":1122,"children":1123},{},[1124,1129],{"type":46,"tag":76,"props":1125,"children":1126},{},[1127],{"type":52,"value":1128},"Minimize total cost",{"type":52,"value":1130}," (production + inspection\u002Fsales + overtime, etc.)",{"type":46,"tag":152,"props":1132,"children":1133},{},[1134],{"type":52,"value":1135},"Plan is chosen; costs are specified → natural goal is to minimize total cost.",{"type":46,"tag":123,"props":1137,"children":1138},{},[1139,1144,1154],{"type":46,"tag":152,"props":1140,"children":1141},{},[1142],{"type":52,"value":1143},"\"Determine the plan\" + costs and revenues given",{"type":46,"tag":152,"props":1145,"children":1146},{},[1147,1152],{"type":46,"tag":76,"props":1148,"children":1149},{},[1150],{"type":52,"value":1151},"Maximize profit",{"type":52,"value":1153}," (revenue − cost)",{"type":46,"tag":152,"props":1155,"children":1156},{},[1157],{"type":52,"value":1158},"Both sides of the ledger → optimize profit.",{"type":46,"tag":123,"props":1160,"children":1161},{},[1162,1167,1174],{"type":46,"tag":152,"props":1163,"children":1164},{},[1165],{"type":52,"value":1166},"\"Try to determine the monthly production plan\" + workshop hour costs, inspection\u002Fsales costs",{"type":46,"tag":152,"props":1168,"children":1169},{},[1170],{"type":46,"tag":76,"props":1171,"children":1172},{},[1173],{"type":52,"value":1128},{"type":46,"tag":152,"props":1175,"children":1176},{},[1177],{"type":52,"value":1178},"All cost components are given; no revenue to maximize → minimize total cost.",{"type":46,"tag":55,"props":1180,"children":1181},{},[1182,1187,1189,1194],{"type":46,"tag":76,"props":1183,"children":1184},{},[1185],{"type":52,"value":1186},"Rule:",{"type":52,"value":1188}," When the problem gives cost (or cost and revenue) data and asks to \"determine\", \"find\", or \"establish\" the plan, ",{"type":46,"tag":76,"props":1190,"children":1191},{},[1192],{"type":52,"value":1193},"always state the objective explicitly",{"type":52,"value":1195}," (e.g., \"I'm treating the objective as minimize total cost, since only costs are given.\"). If both cost and revenue are present, state whether you use \"minimize cost\" or \"maximize profit\". Ask the user if unclear.",{"type":46,"tag":549,"props":1197,"children":1199},{"id":1198},"parsing-workflow",[1200],{"type":52,"value":1201},"Parsing workflow",{"type":46,"tag":331,"props":1203,"children":1204},{},[1205,1215,1230,1246,1256,1279,1289],{"type":46,"tag":72,"props":1206,"children":1207},{},[1208,1213],{"type":46,"tag":76,"props":1209,"children":1210},{},[1211],{"type":52,"value":1212},"Split",{"type":52,"value":1214}," the problem text into sentences or logical clauses.",{"type":46,"tag":72,"props":1216,"children":1217},{},[1218,1222,1224,1228],{"type":46,"tag":76,"props":1219,"children":1220},{},[1221],{"type":52,"value":624},{"type":52,"value":1223}," each: parameter\u002Fgiven | constraint | decision | ",{"type":46,"tag":76,"props":1225,"children":1226},{},[1227],{"type":52,"value":521},{"type":52,"value":1229}," (if stated).",{"type":46,"tag":72,"props":1231,"children":1232},{},[1233,1238,1240,1244],{"type":46,"tag":76,"props":1234,"children":1235},{},[1236],{"type":52,"value":1237},"Identify the objective (explicit or implicit):",{"type":52,"value":1239}," If the problem says \"minimize\u002Fmaximize X\", that's the objective. If it only says \"determine the plan\" (or \"find\", \"establish\") but gives costs (and possibly revenues), the objective is ",{"type":46,"tag":76,"props":1241,"children":1242},{},[1243],{"type":52,"value":679},{"type":52,"value":1245}," — state it (e.g., minimize total cost, or maximize profit) and confirm with the user if ambiguous.",{"type":46,"tag":72,"props":1247,"children":1248},{},[1249,1254],{"type":46,"tag":76,"props":1250,"children":1251},{},[1252],{"type":52,"value":1253},"Flag implicit constraints",{"type":52,"value":1255},": For each sentence, ask — \"Does this state a fixed fact or a requirement (→ parameter\u002Fconstraint), or something we choose (→ decision)?\"",{"type":46,"tag":72,"props":1257,"children":1258},{},[1259,1264,1266],{"type":46,"tag":76,"props":1260,"children":1261},{},[1262],{"type":52,"value":1263},"Resolve ambiguity",{"type":52,"value":1265}," by checking verbs and modals:\n",{"type":46,"tag":68,"props":1267,"children":1268},{},[1269,1274],{"type":46,"tag":72,"props":1270,"children":1271},{},[1272],{"type":52,"value":1273},"\"is\", \"has\", \"operates\", \"employs\", \"plans to\" (fixed\u002Fcommitted) → parameter or implicit constraint.",{"type":46,"tag":72,"props":1275,"children":1276},{},[1277],{"type":52,"value":1278},"\"may\", \"can choose\", \"considers\", \"decides\", \"wants to\" (optional) → decision or objective.",{"type":46,"tag":72,"props":1280,"children":1281},{},[1282,1287],{"type":46,"tag":76,"props":1283,"children":1284},{},[1285],{"type":52,"value":1286},"🔒 MANDATORY — If anything is still ambiguous",{"type":52,"value":1288}," (e.g., a value or constraint could be read two ways): ask the user which interpretation is correct, or solve all plausible interpretations and report all outcomes. Do not assume a single interpretation.",{"type":46,"tag":72,"props":1290,"children":1291},{},[1292,1297,1299,1304],{"type":46,"tag":76,"props":1293,"children":1294},{},[1295],{"type":52,"value":1296},"Summarize",{"type":52,"value":1298}," for the user: list parameters, constraints (explicit + flagged implicit), decisions, and ",{"type":46,"tag":76,"props":1300,"children":1301},{},[1302],{"type":52,"value":1303},"objective (explicit or inferred)",{"type":52,"value":1305}," before writing the math formulation.",{"type":46,"tag":549,"props":1307,"children":1309},{"id":1308},"parsing-checklist",[1310],{"type":52,"value":1311},"Parsing checklist",{"type":46,"tag":68,"props":1313,"children":1316},{"className":1314},[1315],"contains-task-list",[1317,1330,1346,1355,1364,1373,1388],{"type":46,"tag":72,"props":1318,"children":1321},{"className":1319},[1320],"task-list-item",[1322,1328],{"type":46,"tag":1323,"props":1324,"children":1327},"input",{"disabled":1325,"type":1326},true,"checkbox",[],{"type":52,"value":1329}," Every sentence has a label (parameter | constraint | decision | objective if stated).",{"type":46,"tag":72,"props":1331,"children":1333},{"className":1332},[1320],[1334,1337,1339,1344],{"type":46,"tag":1323,"props":1335,"children":1336},{"disabled":1325,"type":1326},[],{"type":52,"value":1338}," ",{"type":46,"tag":76,"props":1340,"children":1341},{},[1342],{"type":52,"value":1343},"Objective is identified:",{"type":52,"value":1345}," Explicit (\"minimize\u002Fmaximize X\") or implicit (\"determine the plan\" + costs → minimize total cost; + revenues → maximize profit). Never formulate without stating the objective.",{"type":46,"tag":72,"props":1347,"children":1349},{"className":1348},[1320],[1350,1353],{"type":46,"tag":1323,"props":1351,"children":1352},{"disabled":1325,"type":1326},[],{"type":52,"value":1354}," Committed phrasing (\"plans to\", \"operates\", \"employs\") → not decisions.",{"type":46,"tag":72,"props":1356,"children":1358},{"className":1357},[1320],[1359,1362],{"type":46,"tag":1323,"props":1360,"children":1361},{"disabled":1325,"type":1326},[],{"type":52,"value":1363}," Optional phrasing (\"may\", \"can choose\", \"considers\") → decisions.",{"type":46,"tag":72,"props":1365,"children":1367},{"className":1366},[1320],[1368,1371],{"type":46,"tag":1323,"props":1369,"children":1370},{"disabled":1325,"type":1326},[],{"type":52,"value":1372}," Implicit constraints from committed phrasing are written out (e.g., \"all X must be produced\").",{"type":46,"tag":72,"props":1374,"children":1376},{"className":1375},[1320],[1377,1380,1381,1386],{"type":46,"tag":1323,"props":1378,"children":1379},{"disabled":1325,"type":1326},[],{"type":52,"value":1338},{"type":46,"tag":76,"props":1382,"children":1383},{},[1384],{"type":52,"value":1385},"🔒 MANDATORY — Ambiguity:",{"type":52,"value":1387}," Any phrase that could be read two ways → I asked the user or I will solve all interpretations and report all outcomes (no silent single interpretation).",{"type":46,"tag":72,"props":1389,"children":1391},{"className":1390},[1320],[1392,1395,1397,1401],{"type":46,"tag":1323,"props":1393,"children":1394},{"disabled":1325,"type":1326},[],{"type":52,"value":1396}," Summary is produced before formulating (parameters, constraints, decisions, ",{"type":46,"tag":76,"props":1398,"children":1399},{},[1400],{"type":52,"value":521},{"type":52,"value":1402},").",{"type":46,"tag":549,"props":1404,"children":1406},{"id":1405},"example",[1407],{"type":52,"value":1408},"Example",{"type":46,"tag":55,"props":1410,"children":1411},{},[1412,1417],{"type":46,"tag":76,"props":1413,"children":1414},{},[1415],{"type":52,"value":1416},"Text:",{"type":52,"value":1418}," \"The company operates 3 factories and plans to produce 500 units. It may use overtime at extra cost. Minimize total cost.\"",{"type":46,"tag":115,"props":1420,"children":1421},{},[1422,1442],{"type":46,"tag":119,"props":1423,"children":1424},{},[1425],{"type":46,"tag":123,"props":1426,"children":1427},{},[1428,1433,1437],{"type":46,"tag":127,"props":1429,"children":1430},{},[1431],{"type":52,"value":1432},"Sentence \u002F phrase",{"type":46,"tag":127,"props":1434,"children":1435},{},[1436],{"type":52,"value":624},{"type":46,"tag":127,"props":1438,"children":1439},{},[1440],{"type":52,"value":1441},"Note",{"type":46,"tag":145,"props":1443,"children":1444},{},[1445,1461,1479,1496],{"type":46,"tag":123,"props":1446,"children":1447},{},[1448,1452,1456],{"type":46,"tag":152,"props":1449,"children":1450},{},[1451],{"type":52,"value":827},{"type":46,"tag":152,"props":1453,"children":1454},{},[1455],{"type":52,"value":835},{"type":46,"tag":152,"props":1457,"children":1458},{},[1459],{"type":52,"value":1460},"All 3 open; not facility selection.",{"type":46,"tag":123,"props":1462,"children":1463},{},[1464,1469,1474],{"type":46,"tag":152,"props":1465,"children":1466},{},[1467],{"type":52,"value":1468},"\"Plans to produce 500 units\"",{"type":46,"tag":152,"props":1470,"children":1471},{},[1472],{"type":52,"value":1473},"Constraint (implicit)",{"type":46,"tag":152,"props":1475,"children":1476},{},[1477],{"type":52,"value":1478},"All 500 must be produced.",{"type":46,"tag":123,"props":1480,"children":1481},{},[1482,1487,1491],{"type":46,"tag":152,"props":1483,"children":1484},{},[1485],{"type":52,"value":1486},"\"May use overtime at extra cost\"",{"type":46,"tag":152,"props":1488,"children":1489},{},[1490],{"type":52,"value":697},{"type":46,"tag":152,"props":1492,"children":1493},{},[1494],{"type":52,"value":1495},"How much overtime is a decision.",{"type":46,"tag":123,"props":1497,"children":1498},{},[1499,1504,1508],{"type":46,"tag":152,"props":1500,"children":1501},{},[1502],{"type":52,"value":1503},"\"Minimize total cost\"",{"type":46,"tag":152,"props":1505,"children":1506},{},[1507],{"type":52,"value":156},{"type":46,"tag":152,"props":1509,"children":1510},{},[1511],{"type":52,"value":1512},"Drives decisions.",{"type":46,"tag":55,"props":1514,"children":1515},{},[1516],{"type":52,"value":1517},"Result: Parameters = 3 factories, 500 units target. Constraints = produce exactly 500 (implicit from \"plans to produce\"). Decisions = production allocation across factories, overtime amounts. Objective = minimize cost.",{"type":46,"tag":55,"props":1519,"children":1520},{},[1521,1526,1528,1533],{"type":46,"tag":76,"props":1522,"children":1523},{},[1524],{"type":52,"value":1525},"Implicit-objective example:",{"type":52,"value":1527}," A problem that asks to \"determine the production plan\" (or similar) and gives cost components (e.g., workshop, inspection, sales) but does not state \"minimize\" or \"maximize\" → ",{"type":46,"tag":76,"props":1529,"children":1530},{},[1531],{"type":52,"value":1532},"Objective is implicit: minimize total cost",{"type":52,"value":1534},". Always state it explicitly: \"The objective is to minimize total cost.\"",{"type":46,"tag":466,"props":1536,"children":1537},{},[],{"type":46,"tag":61,"props":1539,"children":1541},{"id":1540},"qp-rule-minimize-only",[1542],{"type":52,"value":1543},"QP rule: minimize only",{"type":46,"tag":55,"props":1545,"children":1546},{},[1547,1549,1554],{"type":52,"value":1548},"QP objectives must be ",{"type":46,"tag":76,"props":1550,"children":1551},{},[1552],{"type":52,"value":1553},"minimization",{"type":52,"value":1555},". To maximize a quadratic expression, negate it and minimize; then negate the optimal value.",{"type":46,"tag":55,"props":1557,"children":1558},{},[1559,1561,1568,1570,1575],{"type":52,"value":1560},"For minimization to be well-posed, the quadratic form ",{"type":46,"tag":1562,"props":1563,"children":1565},"code",{"className":1564},[],[1566],{"type":52,"value":1567},"Q",{"type":52,"value":1569}," should be positive semi-definite. If ",{"type":46,"tag":1562,"props":1571,"children":1573},{"className":1572},[],[1574],{"type":52,"value":1567},{"type":52,"value":1576}," is indefinite, the problem is non-convex and may not have a finite optimum.",{"type":46,"tag":466,"props":1578,"children":1579},{},[],{"type":46,"tag":61,"props":1581,"children":1583},{"id":1582},"common-patterns",[1584],{"type":52,"value":1585},"Common patterns",{"type":46,"tag":55,"props":1587,"children":1588},{},[1589],{"type":52,"value":1590},"The remaining sections cover specific LP\u002FMILP modeling patterns. Each is independent — read the one that matches your problem.",{"type":46,"tag":549,"props":1592,"children":1594},{"id":1593},"piecewise-linear-objectives-with-integer-production",[1595],{"type":52,"value":1596},"Piecewise-linear objectives with integer production",{"type":46,"tag":55,"props":1598,"children":1599},{},[1600,1602,1607],{"type":52,"value":1601},"When modeling ",{"type":46,"tag":76,"props":1603,"children":1604},{},[1605],{"type":52,"value":1606},"concave piecewise-linear",{"type":52,"value":1608}," profit\u002Fcost functions (e.g., decreasing marginal profit for bulk sales), the standard approach uses continuous segment variables with upper bounds equal to each segment's width. For a maximization with concave profit, the solver fills higher-profit segments first naturally.",{"type":46,"tag":55,"props":1610,"children":1611},{},[1612,1617,1619,1624,1626,1631,1633,1638],{"type":46,"tag":76,"props":1613,"children":1614},{},[1615],{"type":52,"value":1616},"Gotcha:",{"type":52,"value":1618}," If the quantity being produced is discrete (pieces, units, items), the ",{"type":46,"tag":76,"props":1620,"children":1621},{},[1622],{"type":52,"value":1623},"total production",{"type":52,"value":1625}," variable must be ",{"type":46,"tag":76,"props":1627,"children":1628},{},[1629],{"type":52,"value":1630},"INTEGER",{"type":52,"value":1632},", even though segment variables can remain ",{"type":46,"tag":76,"props":1634,"children":1635},{},[1636],{"type":52,"value":1637},"CONTINUOUS",{"type":52,"value":1639},". Without this, the LP relaxation may yield a fractional total that produces a different (higher or lower) objective than the true integer optimum.",{"type":46,"tag":1641,"props":1642,"children":1644},"h4",{"id":1643},"pattern",[1645],{"type":52,"value":1646},"Pattern",{"type":46,"tag":1648,"props":1649,"children":1653},"pre",{"className":1650,"code":1652,"language":52},[1651],"language-text","x_total  — INTEGER (total production of a product)\ns1, s2, … — CONTINUOUS (amount sold in each price segment, bounded by segment width)\n\nLink: x_total = s1 + s2 + …\nResource constraints use x_total.\nObjective uses segment variables × segment profit rates.\n",[1654],{"type":46,"tag":1562,"props":1655,"children":1657},{"__ignoreMap":1656},"",[1658],{"type":52,"value":1652},{"type":46,"tag":549,"props":1660,"children":1662},{"id":1661},"cutting-stock-trim-loss-problems",[1663],{"type":52,"value":1664},"Cutting stock \u002F trim loss problems",{"type":46,"tag":55,"props":1666,"children":1667},{},[1668,1670,1675,1677,1682,1684,1689],{"type":52,"value":1669},"In cutting stock problems, ",{"type":46,"tag":76,"props":1671,"children":1672},{},[1673],{"type":52,"value":1674},"waste area",{"type":52,"value":1676}," includes both ",{"type":46,"tag":76,"props":1678,"children":1679},{},[1680],{"type":52,"value":1681},"trim loss",{"type":52,"value":1683}," (unused width within each cutting pattern) and ",{"type":46,"tag":76,"props":1685,"children":1686},{},[1687],{"type":52,"value":1688},"over-production",{"type":52,"value":1690}," (excess strips produced beyond demand). Minimizing only trim loss (waste width × length per pattern) ignores over-production and yields an incorrect objective.",{"type":46,"tag":1641,"props":1692,"children":1694},{"id":1693},"correct-objective",[1695],{"type":52,"value":1696},"Correct objective",{"type":46,"tag":55,"props":1698,"children":1699},{},[1700],{"type":52,"value":1701},"Since the total useful area demanded is a constant, minimizing waste is equivalent to minimizing total material area consumed:",{"type":46,"tag":1648,"props":1703,"children":1706},{"className":1704,"code":1705,"language":52},[1651],"minimize  sum_j (roll_width_j × x_j)\n",[1707],{"type":46,"tag":1562,"props":1708,"children":1709},{"__ignoreMap":1656},[1710],{"type":52,"value":1705},{"type":46,"tag":55,"props":1712,"children":1713},{},[1714,1716,1722,1724,1730],{"type":52,"value":1715},"where ",{"type":46,"tag":1562,"props":1717,"children":1719},{"className":1718},[],[1720],{"type":52,"value":1721},"x_j",{"type":52,"value":1723}," is the length cut using pattern ",{"type":46,"tag":1562,"props":1725,"children":1727},{"className":1726},[],[1728],{"type":52,"value":1729},"j",{"type":52,"value":1731},". The waste area is then:",{"type":46,"tag":1648,"props":1733,"children":1736},{"className":1734,"code":1735,"language":52},[1651],"waste = total_material_area − required_useful_area\n",[1737],{"type":46,"tag":1562,"props":1738,"children":1739},{"__ignoreMap":1656},[1740],{"type":52,"value":1735},{"type":46,"tag":55,"props":1742,"children":1743},{},[1744,1745,1751],{"type":52,"value":1715},{"type":46,"tag":1562,"props":1746,"children":1748},{"className":1747},[],[1749],{"type":52,"value":1750},"required_useful_area = sum_i (order_width_i × order_length_i)",{"type":52,"value":929},{"type":46,"tag":1641,"props":1753,"children":1755},{"id":1754},"gotcha",[1756],{"type":52,"value":1757},"Gotcha",{"type":46,"tag":55,"props":1759,"children":1760},{},[1761,1763,1769,1771,1776],{"type":52,"value":1762},"Using ",{"type":46,"tag":1562,"props":1764,"children":1766},{"className":1765},[],[1767],{"type":52,"value":1768},"sum_j (waste_width_j × x_j)",{"type":52,"value":1770}," as the objective only captures trim loss — the unused strip within each pattern. It does ",{"type":46,"tag":76,"props":1772,"children":1773},{},[1774],{"type":52,"value":1775},"not",{"type":52,"value":1777}," penalize over-production of an order. The solver will over-produce narrow orders to fill patterns efficiently, but that excess material is still waste. Always use total material area as the objective.",{"type":46,"tag":549,"props":1779,"children":1781},{"id":1780},"goal-programming-preemptive-lexicographic",[1782],{"type":52,"value":1783},"Goal programming (preemptive \u002F lexicographic)",{"type":46,"tag":55,"props":1785,"children":1786},{},[1787,1789,1794],{"type":52,"value":1788},"Goal programming optimizes multiple objectives in priority order. Implement it as ",{"type":46,"tag":76,"props":1790,"children":1791},{},[1792],{"type":52,"value":1793},"sequential solves",{"type":52,"value":1795}," — one per priority level.",{"type":46,"tag":1641,"props":1797,"children":1799},{"id":1798},"formulation-pattern",[1800],{"type":52,"value":1801},"Formulation pattern",{"type":46,"tag":331,"props":1803,"children":1804},{},[1805,1815,1832],{"type":46,"tag":72,"props":1806,"children":1807},{},[1808,1813],{"type":46,"tag":76,"props":1809,"children":1810},{},[1811],{"type":52,"value":1812},"Hard constraints",{"type":52,"value":1814}," — capacity limits, non-negativity, etc. These hold in every phase.",{"type":46,"tag":72,"props":1816,"children":1817},{},[1818,1823,1825,1831],{"type":46,"tag":76,"props":1819,"children":1820},{},[1821],{"type":52,"value":1822},"Goal constraints",{"type":52,"value":1824}," — for each goal, introduce deviation variables (d⁻ for underachievement, d⁺ for overachievement) and write an equality: ",{"type":46,"tag":1562,"props":1826,"children":1828},{"className":1827},[],[1829],{"type":52,"value":1830},"expression + d⁻ − d⁺ = target",{"type":52,"value":929},{"type":46,"tag":72,"props":1833,"children":1834},{},[1835,1840],{"type":46,"tag":76,"props":1836,"children":1837},{},[1838],{"type":52,"value":1839},"Solve sequentially by priority:",{"type":46,"tag":68,"props":1841,"children":1842},{},[1843,1848],{"type":46,"tag":72,"props":1844,"children":1845},{},[1846],{"type":52,"value":1847},"Phase 1: minimize (or maximize) the relevant deviation for the highest-priority goal.",{"type":46,"tag":72,"props":1849,"children":1850},{},[1851],{"type":52,"value":1852},"Phase k: fix all higher-priority deviations at their optimal values, then optimize priority k's deviation.",{"type":46,"tag":1641,"props":1854,"children":1856},{"id":1855},"variable-types-in-goal-programming",[1857],{"type":52,"value":1858},"Variable types in goal programming",{"type":46,"tag":55,"props":1860,"children":1861},{},[1862,1864,1869,1871,1876],{"type":52,"value":1863},"Deviation variables (d⁻, d⁺) and slack\u002Fidle-time variables are always ",{"type":46,"tag":76,"props":1865,"children":1866},{},[1867],{"type":52,"value":1868},"continuous",{"type":52,"value":1870},". However, ",{"type":46,"tag":76,"props":1872,"children":1873},{},[1874],{"type":52,"value":1875},"decision variables must still be INTEGER when they represent discrete\u002Fcountable quantities",{"type":52,"value":1877}," (units produced, vehicles, workers, etc.). Do not let the presence of continuous deviation variables cause you to make all variables continuous — the integrality of decision variables directly affects feasibility and objective values.",{"type":46,"tag":549,"props":1879,"children":1881},{"id":1880},"multi-period-inventory-purchasing-models",[1882],{"type":52,"value":1883},"Multi-period inventory \u002F purchasing models",{"type":46,"tag":55,"props":1885,"children":1886},{},[1887],{"type":52,"value":1888},"In problems with buying, selling, and warehouse capacity over multiple periods, decide which capacity constraints to include based on the problem's timing assumptions.",{"type":46,"tag":1641,"props":1890,"children":1892},{"id":1891},"pattern-1",[1893],{"type":52,"value":1646},{"type":46,"tag":55,"props":1895,"children":1896},{},[1897,1899,1904,1906,1912],{"type":52,"value":1898},"For each period ",{"type":46,"tag":291,"props":1900,"children":1901},{},[1902],{"type":52,"value":1903},"t",{"type":52,"value":1905}," with inventory balance ",{"type":46,"tag":1562,"props":1907,"children":1909},{"className":1908},[],[1910],{"type":52,"value":1911},"stock[t] = stock[t-1] + buy[t] - sell[t]",{"type":52,"value":1913},":",{"type":46,"tag":68,"props":1915,"children":1916},{},[1917,1935],{"type":46,"tag":72,"props":1918,"children":1919},{},[1920,1925,1927,1933],{"type":46,"tag":76,"props":1921,"children":1922},{},[1923],{"type":52,"value":1924},"End-of-period capacity",{"type":52,"value":1926}," (variable bound): ",{"type":46,"tag":1562,"props":1928,"children":1930},{"className":1929},[],[1931],{"type":52,"value":1932},"stock[t] \u003C= capacity",{"type":52,"value":1934}," — always needed.",{"type":46,"tag":72,"props":1936,"children":1937},{},[1938,1943,1945,1951],{"type":46,"tag":76,"props":1939,"children":1940},{},[1941],{"type":52,"value":1942},"After-purchase capacity",{"type":52,"value":1944}," (explicit constraint): ",{"type":46,"tag":1562,"props":1946,"children":1948},{"className":1947},[],[1949],{"type":52,"value":1950},"stock[t-1] + buy[t] \u003C= capacity",{"type":52,"value":1952}," — prevents buying more than the warehouse can hold before any sales occur within the period.",{"type":46,"tag":1641,"props":1954,"children":1956},{"id":1955},"when-to-include-the-after-purchase-constraint",[1957],{"type":52,"value":1958},"When to include the after-purchase constraint",{"type":46,"tag":68,"props":1960,"children":1961},{},[1962,1972],{"type":46,"tag":72,"props":1963,"children":1964},{},[1965,1970],{"type":46,"tag":76,"props":1966,"children":1967},{},[1968],{"type":52,"value":1969},"Include it",{"type":52,"value":1971}," when the problem states or implies that purchases are received before sales happen within a period (sequential operations), or when the warehouse physically cannot exceed capacity at any instant.",{"type":46,"tag":72,"props":1973,"children":1974},{},[1975,1980],{"type":46,"tag":76,"props":1976,"children":1977},{},[1978],{"type":52,"value":1979},"Omit it",{"type":52,"value":1981}," when buying and selling are concurrent within a period (common in textbook trading\u002Finventory problems) and the capacity applies only to end-of-period stock. Many classic problems only constrain end-of-period inventory.",{"type":46,"tag":55,"props":1983,"children":1984},{},[1985,1990,1992,1998],{"type":46,"tag":76,"props":1986,"children":1987},{},[1988],{"type":52,"value":1989},"Key interaction with the sell constraint:",{"type":52,"value":1991}," If the model already has ",{"type":46,"tag":1562,"props":1993,"children":1995},{"className":1994},[],[1996],{"type":52,"value":1997},"sell[t] \u003C= stock[t-1]",{"type":52,"value":1999}," (grain bought this period cannot be sold this period), the model is bounded even without the after-purchase constraint. The sell constraint prevents unbounded buy-sell cycling. The after-purchase constraint is then an additional physical restriction, not a mathematical necessity.",{"type":46,"tag":55,"props":2001,"children":2002},{},[2003,2008,2010,2015,2017,2022],{"type":46,"tag":76,"props":2004,"children":2005},{},[2006],{"type":52,"value":2007},"Default:",{"type":52,"value":2009}," If the problem does not specify timing within a period, use ",{"type":46,"tag":76,"props":2011,"children":2012},{},[2013],{"type":52,"value":2014},"only",{"type":52,"value":2016}," end-of-period capacity (",{"type":46,"tag":1562,"props":2018,"children":2020},{"className":2019},[],[2021],{"type":52,"value":1932},{"type":52,"value":2023},"). Add the after-purchase constraint only if the problem explicitly requires it.",{"type":46,"tag":549,"props":2025,"children":2027},{"id":2026},"blending-with-shared-mixing-intermediate-processing",[2028],{"type":52,"value":2029},"Blending with shared mixing \u002F intermediate processing",{"type":46,"tag":55,"props":2031,"children":2032},{},[2033,2035,2040,2042,2047],{"type":52,"value":2034},"In some blending problems, a subset of raw materials must be ",{"type":46,"tag":76,"props":2036,"children":2037},{},[2038],{"type":52,"value":2039},"mixed together first",{"type":52,"value":2041}," (e.g., in a mixing tank) before being allocated to different products. The resulting intermediate has a ",{"type":46,"tag":76,"props":2043,"children":2044},{},[2045],{"type":52,"value":2046},"uniform composition",{"type":52,"value":2048}," — you cannot independently assign different raw materials to different products.",{"type":46,"tag":1641,"props":2050,"children":2052},{"id":2051},"why-the-standard-blending-lp-is-wrong-here",[2053],{"type":52,"value":2054},"Why the standard blending LP is wrong here",{"type":46,"tag":55,"props":2056,"children":2057},{},[2058,2060,2066,2068,2074,2076,2081,2083,2088,2090,2095,2097,2103],{"type":52,"value":2059},"The standard blending LP uses variables ",{"type":46,"tag":1562,"props":2061,"children":2063},{"className":2062},[],[2064],{"type":52,"value":2065},"x[i][j]",{"type":52,"value":2067}," (amount of raw material ",{"type":46,"tag":1562,"props":2069,"children":2071},{"className":2070},[],[2072],{"type":52,"value":2073},"i",{"type":52,"value":2075}," in product ",{"type":46,"tag":1562,"props":2077,"children":2079},{"className":2078},[],[2080],{"type":52,"value":1729},{"type":52,"value":2082},") and freely allocates each raw material to each product. When raw materials share a mixing step, the proportions of those raw materials must be ",{"type":46,"tag":76,"props":2084,"children":2085},{},[2086],{"type":52,"value":2087},"identical",{"type":52,"value":2089}," in every product that receives the intermediate. This proportionality constraint is ",{"type":46,"tag":76,"props":2091,"children":2092},{},[2093],{"type":52,"value":2094},"bilinear",{"type":52,"value":2096}," (",{"type":46,"tag":1562,"props":2098,"children":2100},{"className":2099},[],[2101],{"type":52,"value":2102},"x[A,1]*x[B,2] = x[B,1]*x[A,2]",{"type":52,"value":2104},") and cannot be directly expressed in an LP.",{"type":46,"tag":1641,"props":2106,"children":2108},{"id":2107},"linearization-strategies",[2109],{"type":52,"value":2110},"Linearization strategies",{"type":46,"tag":331,"props":2112,"children":2113},{},[2114,2124,2156],{"type":46,"tag":72,"props":2115,"children":2116},{},[2117,2122],{"type":46,"tag":76,"props":2118,"children":2119},{},[2120],{"type":52,"value":2121},"Single-product allocation:",{"type":52,"value":2123}," If analysis shows the intermediate is profitable in only one product, allocate all intermediate to that product (set intermediate allocation to other products to zero). The proportionality constraint becomes trivially satisfied. This is the most common case — check profitability of intermediate in each product before attempting a general split.",{"type":46,"tag":72,"props":2125,"children":2126},{},[2127,2132,2134,2140,2142,2147,2149,2154],{"type":46,"tag":76,"props":2128,"children":2129},{},[2130],{"type":52,"value":2131},"Parametric over intermediate concentration:",{"type":52,"value":2133}," Fix the sulfur\u002Fquality concentration of the intermediate as a parameter ",{"type":46,"tag":1562,"props":2135,"children":2137},{"className":2136},[],[2138],{"type":52,"value":2139},"σ",{"type":52,"value":2141},". For each fixed ",{"type":46,"tag":1562,"props":2143,"children":2145},{"className":2144},[],[2146],{"type":52,"value":2139},{"type":52,"value":2148},", the problem is a standard LP (intermediate becomes a virtual raw material with known properties). Solve for a grid of ",{"type":46,"tag":1562,"props":2150,"children":2152},{"className":2151},[],[2153],{"type":52,"value":2139},{"type":52,"value":2155}," values or use the structure to find the optimum analytically.",{"type":46,"tag":72,"props":2157,"children":2158},{},[2159,2164],{"type":46,"tag":76,"props":2160,"children":2161},{},[2162],{"type":52,"value":2163},"Scenario enumeration:",{"type":52,"value":2165}," When only 2–3 products exist, enumerate which products receive the intermediate (all-to-A, all-to-B, split). For each scenario with a single recipient, the LP is standard. For split scenarios, use strategy 2.",{"type":46,"tag":1641,"props":2167,"children":2169},{"id":2168},"profitability-check",[2170],{"type":52,"value":2171},"Profitability check",{"type":46,"tag":55,"props":2173,"children":2174},{},[2175],{"type":52,"value":2176},"Before formulating, check whether using the intermediate in each product is profitable:",{"type":46,"tag":68,"props":2178,"children":2179},{},[2180,2198,2232],{"type":46,"tag":72,"props":2181,"children":2182},{},[2183,2185,2190,2192,2197],{"type":52,"value":2184},"Compare the ",{"type":46,"tag":76,"props":2186,"children":2187},{},[2188],{"type":52,"value":2189},"minimum cost per ton",{"type":52,"value":2191}," of the intermediate (using cheapest feasible raw material mix) against each product's ",{"type":46,"tag":76,"props":2193,"children":2194},{},[2195],{"type":52,"value":2196},"selling price",{"type":52,"value":929},{"type":46,"tag":72,"props":2199,"children":2200},{},[2201,2203,2209,2211,2216,2218,2223,2225,2231],{"type":52,"value":2202},"If ",{"type":46,"tag":1562,"props":2204,"children":2206},{"className":2205},[],[2207],{"type":52,"value":2208},"cost_intermediate > sell_price[j]",{"type":52,"value":2210}," for some product ",{"type":46,"tag":1562,"props":2212,"children":2214},{"className":2213},[],[2215],{"type":52,"value":1729},{"type":52,"value":2217},", the intermediate should not be allocated to product ",{"type":46,"tag":1562,"props":2219,"children":2221},{"className":2220},[],[2222],{"type":52,"value":1729},{"type":52,"value":2224},". Raw material C (or other direct inputs) alone may also be unprofitable if ",{"type":46,"tag":1562,"props":2226,"children":2228},{"className":2227},[],[2229],{"type":52,"value":2230},"cost_C > sell_price[j]",{"type":52,"value":929},{"type":46,"tag":72,"props":2233,"children":2234},{},[2235],{"type":52,"value":2236},"This analysis often eliminates the need for a bilinear split entirely.",{"items":2238,"total":2397},[2239,2257,2275,2286,2298,2312,2325,2339,2352,2363,2377,2386],{"slug":2240,"name":2240,"fn":2241,"description":2242,"org":2243,"tags":2244,"stars":2254,"repoUrl":2255,"updatedAt":2256},"nemoclaw-user-guide","retrieve NemoClaw documentation and configuration","Guides human users' AI agents to the NemoClaw docs MCP server and canonical Fern documentation in Markdown form. Use when users ask how to install, configure, operate, troubleshoot, secure, or learn NemoClaw with an AI coding assistant. Trigger keywords - nemoclaw docs, use nemoclaw with ai agent, nemoclaw mcp docs, nemoclaw install help, nemoclaw quickstart, nemoclaw markdown docs, llms.txt, agent skills.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2245,2248,2251],{"name":2246,"slug":2247,"type":15},"Documentation","documentation",{"name":2249,"slug":2250,"type":15},"MCP","mcp",{"name":2252,"slug":2253,"type":15},"Search","search",21777,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNemoClaw","2026-07-20T06:00:01.461044",{"slug":2258,"name":2258,"fn":2259,"description":2260,"org":2261,"tags":2262,"stars":2272,"repoUrl":2273,"updatedAt":2274},"mcore-build-and-dependency","manage Megatron-LM development environments","Container-based dev environment setup and dependency management for Megatron-LM. Covers acquiring and launching the CI container, uv package management, and updating uv.lock.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2263,2266,2269],{"name":2264,"slug":2265,"type":15},"Containers","containers",{"name":2267,"slug":2268,"type":15},"Deployment","deployment",{"name":2270,"slug":2271,"type":15},"Python","python",17049,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FMegatron-LM","2026-07-27T06:06:11.249662",{"slug":2276,"name":2276,"fn":2277,"description":2278,"org":2279,"tags":2280,"stars":2272,"repoUrl":2273,"updatedAt":2285},"mcore-bump-base-image","update NVIDIA PyTorch base images","Bump the NVIDIA PyTorch base image (`nvcr.io\u002Fnvidia\u002Fpytorch:YY.MM-py3`) used by Megatron-LM CI. Covers the two pin sites (GitHub CI in `docker\u002F.ngc_version.dev` and GitLab CI in `.gitlab\u002Fstages\u002F01.build.yml`), the post-bump CI loop (re-run functional tests, refresh golden values, mark broken tests), and the gotchas that bit PRs",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2281,2284],{"name":2282,"slug":2283,"type":15},"CI\u002FCD","ci-cd",{"name":2267,"slug":2268,"type":15},"2026-07-14T05:25:59.97109",{"slug":2287,"name":2287,"fn":2288,"description":2289,"org":2290,"tags":2291,"stars":2272,"repoUrl":2273,"updatedAt":2297},"mcore-cicd","manage CI\u002FCD pipelines for Megatron-LM","CI\u002FCD reference for Megatron-LM. Covers CI pipeline structure, PR scope labels, triggering internal GitLab CI (which force-pushes the current branch to a pull-request\u002FBRANCH ref — always dry-run and verify the destination first; never run against shared or protected branches), and CI failure investigation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2292,2293,2294],{"name":2282,"slug":2283,"type":15},{"name":2267,"slug":2268,"type":15},{"name":2295,"slug":2296,"type":15},"GitHub","github","2026-07-27T06:06:12.278222",{"slug":2299,"name":2299,"fn":2300,"description":2301,"org":2302,"tags":2303,"stars":2272,"repoUrl":2273,"updatedAt":2311},"mcore-create-issue","investigate CI failures and create issues","Investigate a failing GitHub Actions run or job and create a GitHub issue for the failure.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2304,2307,2308],{"name":2305,"slug":2306,"type":15},"Debugging","debugging",{"name":2295,"slug":2296,"type":15},{"name":2309,"slug":2310,"type":15},"Triage","triage","2026-07-14T05:25:57.442089",{"slug":2313,"name":2313,"fn":2314,"description":2315,"org":2316,"tags":2317,"stars":2272,"repoUrl":2273,"updatedAt":2324},"mcore-linting-and-formatting","lint and format Megatron-LM code","Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2318,2321],{"name":2319,"slug":2320,"type":15},"Best Practices","best-practices",{"name":2322,"slug":2323,"type":15},"Code Analysis","code-analysis","2026-07-14T05:25:56.18433",{"slug":2326,"name":2326,"fn":2327,"description":2328,"org":2329,"tags":2330,"stars":2272,"repoUrl":2273,"updatedAt":2338},"mcore-migrate-gpt-to-hybrid","migrate Megatron-LM models to HybridModel","Migration guide for moving Megatron Core GPTModel checkpoints, model providers, training commands, and layer mappings to HybridModel.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2331,2334,2337],{"name":2332,"slug":2333,"type":15},"Machine Learning","machine-learning",{"name":2335,"slug":2336,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:11.777011",{"slug":2340,"name":2340,"fn":2341,"description":2342,"org":2343,"tags":2344,"stars":2272,"repoUrl":2273,"updatedAt":2351},"mcore-onboard-gb200-1node-tests","onboard functional tests for GB200","Onboard 1-node GitHub MR functional tests for GB200 from existing mr-scoped 2-node tests.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2345,2348],{"name":2346,"slug":2347,"type":15},"QA","qa",{"name":2349,"slug":2350,"type":15},"Testing","testing","2026-07-14T05:25:53.673039",{"slug":2353,"name":2353,"fn":2354,"description":2355,"org":2356,"tags":2357,"stars":2272,"repoUrl":2273,"updatedAt":2362},"mcore-run-on-slurm","launch distributed training jobs on SLURM","How to launch distributed Megatron-LM training jobs on a SLURM cluster. Covers a minimal sbatch skeleton, environment-variable setup for torch.distributed.run, CUDA_DEVICE_MAX_CONNECTIONS rules across hardware and parallelism modes, container conventions, monitoring, and per-rank failure diagnosis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2358,2359],{"name":2267,"slug":2268,"type":15},{"name":2360,"slug":2361,"type":15},"Infrastructure","infrastructure","2026-07-14T05:25:49.362534",{"slug":2364,"name":2364,"fn":2365,"description":2366,"org":2367,"tags":2368,"stars":2272,"repoUrl":2273,"updatedAt":2376},"mcore-split-pr","split pull requests to reduce review load","Split a PR into multiple PRs to reduce the number of required CODEOWNERS reviewer groups.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2369,2372,2373],{"name":2370,"slug":2371,"type":15},"Code Review","code-review",{"name":2295,"slug":2296,"type":15},{"name":2374,"slug":2375,"type":15},"Pull Requests","pull-requests","2026-07-14T05:26:01.226578",{"slug":2378,"name":2378,"fn":2379,"description":2380,"org":2381,"tags":2382,"stars":2272,"repoUrl":2273,"updatedAt":2385},"mcore-testing","run and manage Megatron-LM tests","Test system for Megatron-LM. Covers test layout, recipe YAML structure, adding and running unit and functional tests, golden values, marker filters, and CI parity.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2383,2384],{"name":2346,"slug":2347,"type":15},{"name":2349,"slug":2350,"type":15},"2026-07-14T05:25:54.928983",{"slug":2387,"name":2387,"fn":2388,"description":2389,"org":2390,"tags":2391,"stars":2272,"repoUrl":2273,"updatedAt":2396},"nightly-sync","manage nightly main-to-dev sync workflows","Domain knowledge for the nightly main-to-dev sync workflow. Covers merge strategy, CI architecture, failure investigation, and known issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2392,2395],{"name":2393,"slug":2394,"type":15},"Automation","automation",{"name":2282,"slug":2283,"type":15},"2026-07-30T05:29:03.275638",496,{"items":2399,"total":2495},[2400,2417,2427,2441,2451,2466,2481],{"slug":2401,"name":2401,"fn":2402,"description":2403,"org":2404,"tags":2405,"stars":20,"repoUrl":21,"updatedAt":2416},"accelerated-computing-cudf","accelerate data processing with cuDF","Official NVIDIA-authored guidance for NVIDIA cuDF GPU DataFrames, pandas acceleration, dask-cuDF, ETL, joins, groupby, CSV\u002FParquet I\u002FO, nullable semantics, and multi-GPU DataFrame workloads.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2406,2409,2412,2413],{"name":2407,"slug":2408,"type":15},"Data Analysis","data-analysis",{"name":2410,"slug":2411,"type":15},"Data Engineering","data-engineering",{"name":9,"slug":8,"type":15},{"name":2414,"slug":2415,"type":15},"Performance","performance","2026-07-14T05:28:43.176466",{"slug":2418,"name":2418,"fn":2419,"description":2420,"org":2421,"tags":2422,"stars":20,"repoUrl":21,"updatedAt":2426},"aiq-deploy","deploy and manage NVIDIA AI-Q infrastructure","Use when asked to install, deploy, run, validate, troubleshoot, or stop NVIDIA AI-Q Blueprint infrastructure.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2423,2424,2425],{"name":2267,"slug":2268,"type":15},{"name":2360,"slug":2361,"type":15},{"name":9,"slug":8,"type":15},"2026-07-14T05:29:06.667109",{"slug":2428,"name":2428,"fn":2429,"description":2430,"org":2431,"tags":2432,"stars":20,"repoUrl":21,"updatedAt":2440},"aiq-research","conduct deep research with AI-Q","Use when asked to run deep research or AI-Q research through a reachable NVIDIA AI-Q Blueprint backend.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2433,2436,2437],{"name":2434,"slug":2435,"type":15},"Agents","agents",{"name":9,"slug":8,"type":15},{"name":2438,"slug":2439,"type":15},"Research","research","2026-07-14T05:28:06.816956",{"slug":2442,"name":2442,"fn":2443,"description":2444,"org":2445,"tags":2446,"stars":20,"repoUrl":21,"updatedAt":2450},"amc-run-sample-calibration","run AMC sample dataset calibration","Run end-to-end calibration on the shipped sample dataset (sdg_08_2_sample_data_010926.zip) against a running AMC microservice. Use when user says 'test sample dataset', 'run sample calibration', 'verify AMC install', or 'launch and test'.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2447,2448,2449],{"name":2407,"slug":2408,"type":15},{"name":9,"slug":8,"type":15},{"name":2349,"slug":2350,"type":15},"2026-07-17T05:29:03.913266",{"slug":2452,"name":2452,"fn":2453,"description":2454,"org":2455,"tags":2456,"stars":20,"repoUrl":21,"updatedAt":2465},"amc-run-video-calibration","calibrate video datasets with AutoMagicCalib","Calibrate a new dataset from pre-recorded video files via the AutoMagicCalib REST API. Use when user has local MP4s and says 'calibrate my videos', 'run AMC on these videos', or similar. For RTSP\u002Flive streams, use amc-run-rtsp-calibration instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2457,2458,2461,2462],{"name":2393,"slug":2394,"type":15},{"name":2459,"slug":2460,"type":15},"Imaging","imaging",{"name":9,"slug":8,"type":15},{"name":2463,"slug":2464,"type":15},"Video","video","2026-07-17T05:28:53.905004",{"slug":2467,"name":2467,"fn":2468,"description":2469,"org":2470,"tags":2471,"stars":20,"repoUrl":21,"updatedAt":2480},"amc-setup-calibration-stack","deploy AutoMagicCalib microservice with Docker","Launch AutoMagicCalib microservice and web UI from NGC release images via Docker Compose. Use when user says 'deploy auto calibration', 'launch auto calibration', 'launch AMC', 'start MS+UI', or 'set up auto-magic-calib'. Requires NGC API key.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2472,2473,2476,2477],{"name":2267,"slug":2268,"type":15},{"name":2474,"slug":2475,"type":15},"Docker","docker",{"name":9,"slug":8,"type":15},{"name":2478,"slug":2479,"type":15},"Operations","operations","2026-07-17T05:28:56.913999",{"slug":2482,"name":2482,"fn":2483,"description":2484,"org":2485,"tags":2486,"stars":20,"repoUrl":21,"updatedAt":2494},"cudaq-guide","develop quantum applications with CUDA-Q","CUDA-Q onboarding guide for installation, test programs, GPU simulation, QPU hardware, and quantum applications.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[2487,2488,2491],{"name":9,"slug":8,"type":15},{"name":2489,"slug":2490,"type":15},"Quantum Computing","quantum-computing",{"name":2492,"slug":2493,"type":15},"Simulation","simulation","2026-07-14T05:26:58.898253",305]