Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

线性规划和混合整数线性规划

求解具有连续变量和整数变量的线性规划问题

在开始求解优化问题之前,您必须选择合适的方法:基于问题或基于求解器。有关详细信息,请参阅首先选择基于问题或基于求解器的方法

对于基于问题的方法,请创建问题变量,然后用这些符号变量表示目标函数和约束。有关基于问题的求解步骤,请参阅Problem-Based Optimization Workflow。要求解生成的问题,请使用 solve

有关基于求解器的求解步骤,包括定义目标函数和约束,以及选择合适的求解器,请参阅基于求解器的优化问题设置。要求解生成的问题,请在有整数约束时使用 intlinprog,或在没有整数约束时使用 linprog

函数

全部展开

evaluate计算优化表达式
findindex查找命名索引变量的等效数值索引
infeasibility一个点处的约束违反度
optimproblem创建优化问题
optimvar创建优化变量
prob2struct将优化问题或方程问题转换为求解器形式
solve求解优化问题或方程问题
intlinprog混合整数线性规划 (MILP)
linprog求解线性规划问题
mpsread读取 MPS 文件中的 LP 和 MILP 优化数据

实时编辑器任务

优化在实时编辑器中优化或求解方程

主题

基于问题的混合整数线性规划

混合整数线性规划基础:基于问题

混合整数线性规划的简单示例。

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.

发电机的最佳调度:基于问题

此示例说明如何以最佳方式调度两台燃气发电机,即收益减去成本的值最大。

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.

混合整数二次规划投资组合优化:基于问题

此示例说明如何使用基于问题的方法来求解混合整数二次规划 (MIQP) 投资组合优化问题。

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.

通过整数规划求解数独谜题:基于问题

此示例说明如何使用二元整数规划来求解数独谜题。

基于求解器的混合整数线性规划

混合整数线性规划基础:基于求解器

混合整数线性规划的简单示例。

Factory, Warehouse, Sales Allocation Model: Solver-Based

Example of optimizing logistics in a small supply chain.

推销员行程问题:基于求解器

经典的推销员差旅问题,提供设置和解。

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.

基于问题的线性规划

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.

Create Multiperiod Inventory Model in Problem-Based Framework

Create an inventory model, where stock is carried between time periods, in the problem-based approach.

基于求解器的线性规划

基于求解器设置线性规划

使用基于求解器的方法表示问题。

Typical Linear Programming Problem

This example shows the solution of a typical linear programming problem.

Investigate Linear Infeasibilities

Find out which linear constraints cause a problem to be infeasible.

Maximize Long-Term Investments Using Linear Programming: Solver-Based

Optimize a deterministic multiperiod investment problem using linear programming.

基于问题的算法

基于问题的优化算法

优化函数和对象如何求解优化问题。

Supported Operations for Optimization Variables and Expressions

Explore the supported mathematical and indexing operations for optimization variables and expressions.

基于求解器的算法和选项

线性规划算法

在仅有线性边界约束的情况下,在 n 个维度中最小化线性目标函数。

混合整数线性规划算法

用于求解混合整数线性规划的算法。

优化选项参考

了解优化选项。

Tuning Integer Linear Programming

Steps for improving solutions or solution time.

intlinprog Output Function and Plot Function Syntax

How to monitor the progress of the intlinprog solution process.