Programmazione lineare e programmazione lineare mista intera
Prima di iniziare a risolvere un problema di ottimizzazione, è necessario scegliere l'approccio appropriato: basato sui problemi o basato sul risolutore. Per i dettagli, vedere Scelta iniziale sull'adozione dell'approccio basato sui problemi o sul risolutore.
Per l'approccio basato sui problemi, creare delle variabili del problema, quindi esprimere la funzione obiettivo e i vincoli in termini di tali variabili simboliche. Per i passaggi da seguire per l'approccio basato sui problemi, vedere Problem-Based Optimization Workflow. Per risolvere il problema risultante, utilizzare solve.
Per i passaggi da seguire per l'approccio basato sul risolutore, inclusa la definizione della funzione obiettivo e dei vincoli e la scelta del risolutore appropriato, vedere Impostazione di un problema di ottimizzazione basato sul risolutore. Per risolvere il problema risultante, utilizzare intlinprog in presenza di vincoli interi estesi oppure utilizzare linprog in assenza di vincoli interi.
Funzioni
Oggetti
integerConstraint | Indices of extended integer variables (Da R2025a) |
SensitivityAnalysis | Sensitivities of linear program coefficients (Da R2026a) |
Attività di Live Editor
| Optimize | Ottimizzare o risolvere equazioni in Live Editor |
Argomenti
Programmazione lineare mista intera basata sui problemi
- Mixed-Integer Linear Programming Basics: Problem-Based
Simple example of mixed-integer linear programming. - Factory, Warehouse, Sales Allocation Model: Problem-Based
This example shows how to set up and solve a mixed-integer linear programming problem. - Traveling Salesman Problem: Problem-Based
This example shows how to use binary integer programming to solve the classic traveling salesman problem. - Optimal Dispatch of Power Generators: Problem-Based
This example shows how to schedule two gas-fired electric generators optimally, meaning to get the most revenue minus cost. - Office Assignments by Binary Integer Programming: Problem-Based
This example shows how to solve an assignment problem by binary integer programming using the optimization problem approach. - Mixed-Integer Quadratic Programming Portfolio Optimization: Problem-Based
This example shows how to solve a Mixed-Integer Quadratic Programming (MIQP) portfolio optimization problem using the problem-based approach. - Cutting Stock Problem: Problem-Based
This example shows how to solve a cutting stock problem using linear programming with an integer linear programming subroutine. - Minimize Makespan in Parallel Processing
Minimize the maximum time for a set of processors to complete a group of tasks. - Solve Sudoku Puzzles via Integer Programming: Problem-Based
This example shows how to solve a Sudoku puzzle using binary integer programming.
Programmazione lineare mista intera basata sul risolutore
- Mixed-Integer Linear Programming Basics: Solver-Based
Simple example of mixed-integer linear programming. - Factory, Warehouse, Sales Allocation Model: Solver-Based
Example of optimizing logistics in a small supply chain. - Traveling Salesman Problem: Solver-Based
The classic traveling salesman problem, with setup and solution. - Optimal Dispatch of Power Generators: Solver-Based
Example showing how to schedule power generation when there is a cost for activation. - Office Assignments by Binary Integer Programming: Solver-Based
Solve an assignment problem using binary integer programming. - Mixed-Integer Quadratic Programming Portfolio Optimization: Solver-Based
Example showing how to optimize a portfolio, a quadratic programming problem, with integer and other constraints. - Cutting Stock Problem: Solver-Based
Solve a cutting stock problem using linear programming with an integer programming subroutine. - Solve Sudoku Puzzles via Integer Programming: Solver-Based
Sudoku is a type of puzzle that you can solve using integer linear programming.
Programmazione lineare basata sui problemi
- Set Up a Linear Program, Problem-Based
Linear problem formulation using the problem-based approach. - Maximize Long-Term Investments Using Linear Programming: Problem-Based
Optimize a deterministic multiperiod investment problem using linear programming and the problem-based approach. - Optimize Green Hydrogen Production System
Optimize a green hydrogen production system. - Optimal Dispatch of Electric Power
Optimize the power generated or dispatched among renewable and nonrenewable generators in a deterministic system using optimization variables. - Create Multiperiod Inventory Model in Problem-Based Framework
Create an inventory model, where stock is carried between time periods, in the problem-based approach.
Programmazione lineare basata sul risolutore
- Set Up a Linear Program, Solver-Based
Problem formulation using the solver-based approach. - Typical Linear Programming Problem
This example shows the solution of a typical linear programming problem. - Sensitivity Analysis in Linear Programming
Examine sensitivities in a linear program solution. - Maximize Long-Term Investments Using Linear Programming: Solver-Based
Optimize a deterministic multiperiod investment problem using linear programming.
Generazione di codice
- Code Generation for linprog Background
Prerequisites to generate C code for quadratic optimization. - Generate Code for linprog
Learn the basics of code generation for thelinprogoptimization solver.
Modellazione e analisi di problemi lineari e interi
- Integer and Logical Modeling
Techniques for modeling with integer constraints using "Big-M" and other techniques. - Investigate Linear Infeasibilities
Find out which linear constraints cause a problem to be infeasible.
Algoritmi basati sui problemi
- Problem-Based Optimization Algorithms
Learn how the optimization functions and objects solve optimization problems. - Supported Operations for Optimization Variables and Expressions
Explore the supported mathematical and indexing operations for optimization variables and expressions.
Algoritmi basati sul risolutore e opzioni
- Linear Programming Algorithms
Minimizing a linear objective function in n dimensions with only linear and bound constraints. - Mixed-Integer Linear Programming (MILP) Algorithms
The algorithms used for solution of mixed-integer linear programs. - Optimization Options Reference
Explore optimization options. - Tuning Integer Linear Programming
Steps for improving solutions or solution time. - intlinprog Output Function and Plot Function Syntax
How to monitor the progress of theintlinprogsolution process.