optimization-or

Formulate and solve LP, QP, and MILP models with cvxpy and OR-Tools.

33|6|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill optimization-or
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimization-or
Source: https://github.com/xjtulyc/awesome-rosetta-skills/tree/main/skills/03-mathematics/optimization-or
Command: npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill optimization-or

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you model and solve optimization problems (LP, QP, and MILP) and interpret results through dual variables, sensitivity analysis, and solver selection.

Core Features & Use Cases

  • LP/QP/MILP Modeling: Formulate resource allocation, portfolio optimization, and integer decision problems using cvxpy with practical examples.
  • Solver Options & Interfaces: Use open-source solvers (e.g., GLPK, ECOS, SCS) and integrate commercial Gurobi when available; also solve constraint satisfaction via OR-Tools CP-SAT and large-scale LP/MILP via OR-Tools pywraplp.
  • Sensitivity & Decision Intelligence: Extract shadow prices (dual variables), reduced-cost style insights, and run practical sensitivity reasoning to understand how solutions change when constraints or targets shift.

Use Case: Optimize a production plan with limited labor/material/machine capacity, then read the shadow prices to quantify the marginal value of additional resources.

Quick Start

Ask your AI to formulate a production planning LP from your profit vector, resource-consumption matrix, and capacity limits, solve it with cvxpy, and return the optimal allocation plus the shadow prices for each resource.

Frequently Asked Questions about optimization-or

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I formulate and solve a linear programming problem with cvxpy?

Formulate linear programming problems by defining an objective function and constraints in cvxpy, then solve using configured open-source solvers like GLPK or ECOS to return the optimal resource allocation.

How do I extract dual variables for sensitivity analysis in optimization models?

Extract dual variables, also known as shadow prices, directly from solved cvxpy models to quantify the marginal value of additional resources and run sensitivity analysis for constraint shifts.

Can I solve mixed-integer linear programming models using OR-Tools?

Yes, you can solve large-scale MILP problems using OR-Tools pywraplp and handle constraint satisfaction scenarios via the OR-Tools CP-SAT solver.

Does this approach support quadratic programming for portfolio variance minimization?

Yes, quadratic programming is fully supported to formulate and solve models like portfolio variance minimization using cvxpy with applicable open-source solvers.

What is the best way to integrate commercial solvers like Gurobi with cvxpy?

Configure cvxpy to interface with commercial solvers like Gurobi when available, allowing you to solve complex LP, QP, and MILP models directly within your operations research workflow.