当前位置:网站首页>【整数规划】
【整数规划】
2022-07-26 14:25:00 【是数学系的小孩儿】
文章目录
整数规划的定义
数学规划中的变量(部分或全部)限制为整数时,称为整数规划。若在线性规划模型中,变量限制为整数,则称为整数线性规划。
求解整数线性规划的方法
分枝定界法——可求纯或混合整数线性规划。
割平面法——可求纯或混合整数线性规划。
隐枚举法——求解“0-1”整数规划
- 过滤隐枚举法。
- 分支隐枚举法。
匈牙利法——解决指派问题(0-1规划特殊情形)
蒙特卡罗法——求解各种类型规划。
使用matlab
clc,clear
x=unifrnd(0,12,[1,10000000]);
y=unifrnd(0,9,[1,10000000]);
pinshu=sum(y<x.^2&x<=3)+sum(y<12-x&x>=3);
area_appr=12*9*pinshu/10^7
function[f,g]=mengte(x);
f=x(1)^2+x(2)^2+3*x(3)^2+4*x(4)^2+2*x(5)^2-8*x(1)-2*x(2)-3*x(3)-x(4)-2*x(5);
g=[sum(x)-400
x(1)+2*x(2)+2*x(3)+x(4)+6*x(5)-800
2*x(1)+x(2)+6*x(3)-200
x(3)+x(4)+5*x(5)-200];
rand('state',sum(clock))%初始化随机数发生器
p0=0;
tic%计时开始
for i=1:10^6
x=randi([0,99],1,5);
[f,g]=mengte(x);
if all(g<=0)
if p0<f
x0=x;p0=f;%记录当前较好的解
end
end
end
x0,p0
toc


使用lingo
局部最优解
书上说可以直接求出精确的全局最优解,但是当我敲入代码运行出来的结果是局部最优解,还对其行和列进行改变,发现还是局部最优解,而不是全局最优解。


全局最优解
lingo->options->Global Solver
勾上Use Global Options,应用
边栏推荐
- Leetcode215 the kth largest element (derivation of quick sort partition function)
- C语言_结构体指针来访问结构体数组
- Tdengine helps Siemens' lightweight digital solution simicas simplify data processing process
- Learning basic knowledge of Android security
- What is restful style and its four specific implementation forms
- Multi task text classification model based on tag embedded attention mechanism
- 什么是Restful风格以及它的四种具体实现形式
- Detailed explanation of alter field of MySQL Foundation
- 网络图片转本地导致内核退出
- UDP multithreaded online chat
猜你喜欢

Jzoffer51- reverse pairs in the array (merge sort solution)

我的创作纪念日-从心出发

android安全基础知识学习

Prediction and value evaluation of technology fusion relationship based on multiple features

Plato farm is expected to further expand its ecosystem through elephant swap

Leetcode1170- compare the occurrence frequency of the minimum letter of the string (the corresponding occurrence frequency of each string minimum element in the map set storage array)

【深度学习】全连接网络

IDEA(warning)No artifacts configured

Low power multi-channel wfas1431 wireless data acquisition and transmission instrument operation process description

关于存储芯片的入门基础知识
随机推荐
图神经网络Core数据集介绍
TDengine 助力西门子轻量级数字化解决方案 SIMICAS 简化数据处理流程
什么是Restful风格以及它的四种具体实现形式
聚力打造四个“高地”,携手合作伙伴共铸国云!
Jzoffer (array; string; linked list)
Difference between base addressing and index addressing
Multithreading - thread pool
【愚公系列】2022年7月 Go教学课程 017-分支结构之IF
Tdengine helps Siemens' lightweight digital solution simicas simplify data processing process
Win11运行虚拟机死机了?Win11运行VMware虚拟机崩溃的解决方法
Install dexdump on win10 and remove the shell
Share 44 JS problems, and half of them are masters
What is the problem of the time series database that has been developed for 5 years?
Leetcode215 the kth largest element (derivation of quick sort partition function)
Basic knowledge about memory chips
Iscc2021 lock problem solution
『SignalR』.NET使用 SignalR 进行实时通信初体验
基于标签嵌入注意力机制的多任务文本分类模型
请问数据库规范的文档吗 参考一下?
Construction practice of pipeline engine of engineering efficiency ci/cd