当前位置:网站首页>【整数规划】
【整数规划】
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,应用
边栏推荐
- [ostep] 02 virtualized CPU - process
- UDP multithreaded online chat
- What is the problem of the time series database that has been developed for 5 years?
- 使用cpolar建立一个商业网站(申请网站安全证书)
- ISCC2021 LOCKK题解
- JS timer realizes the countdown and jumps to the login page
- Low power multi-channel wfas1431 wireless data acquisition and transmission instrument operation process description
- Integer internal cache
- Arithmetic operation and logic operation of image in opencv
- Basic knowledge about memory chips
猜你喜欢
随机推荐
嵌入式开发:调试嵌入式软件的技巧
Basic knowledge about memory chips
网络图片转本地导致内核退出
PHP uses sqlserver
Use cpolar to build a commercial website (apply for website security certificate)
C语言_结构体和数组的结合
低功耗多通道WFAS1431无线数据采集采发仪使用流程说明
OA项目之会议排座和送审
GOM登录器配置免费版生成图文教程
IDEA(warning)No artifacts configured
敏捷开发与DevOps的对比
如何做 APP 升级测试 ?
Mysql5.7 is installed through file zip - Ninth Five Year Plan xiaopang
Large and small end mode
1对1直播源码——1对1语音聊天源码
JS timer realizes the countdown and jumps to the login page
C language Snake linked list and pointer practice
The difference between V-model and.Sync modifier
请问下大家,flink sql有没有办法不输出update_before?
[untitled]









