biprogram.m
来自「清华大学运筹学课件」· M 代码 · 共 28 行
M
28 行
% the program is with the binary integer linear programming
% please input the parameter matrices and the standard form of the matlab optimization:
input('the program is with the binary linear programming')
m=input('Please input the constraints number of the programming m=')
n=input('Please input the variant number of the programming n=')
c=input('Please input cost array of the objective function c(n)_T=')
A=input('Please input the coefficient matrix of the constraints A(m,n)=')
b=input('Please input the resource array of the program b(m)_T=')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%x=input('The optimization toolbox function x=lp(c,A,b):')
x=bintprog(c,A,b);
input('The optimization solution of the programming is:')
x
input('The optimization value of the programming is:')
c_T=c';
opt_value=c_T*x
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?