function output = bmibnb(p)
%BMIBNB Branch-and-bound scheme for bilinear programs
%
% BMIBNB is never called by the user directly, but is called by
% YALMIP from SOLVESDP, by choosing the solver tag 'bmibnb' in sdpsettings
%
% The behaviour of BMIBNB can be altered using the fields
% in the field 'bmibnb' in SDPSETTINGS
%s
% WARNING: THIS IS EXPERIMENTAL CODE
%
% bmibnb.lowersolver - Solver for lower bound [standard solver tag ('')]
% bmibnb.uppersolver - Solver for upper bound [standard solver tag ('')]
% bmibnb.lpsolver - Solver for LP bound tightening [standard solver tag ('')]
% bmibnb.branchmethod - Branch strategy ['maxvol' | 'best' ('best')]
% bmibnb.branchrule - Branch position ['omega' | 'bisect' ('omega')]
% bmibnb.lpreduce - Improve variable bounds using LP [ real [0,1] (0 means no reduction, 1 means all variables)
% bmibnb.lowrank - partition variables into two disjoint sets and branch on smallest [ 0|1 (0)]
% bmibnb.target - Exit if upper found<target [double (-inf)]
% bmibnb.roottight - Improve variable bounds in root using full problem [ 0|1 (1)]
% bmibnb.vartol - Cut tree when x_U-x_L < vartol on all branching variables
% bmibnb.relgaptol - Tolerance on relative objective error (UPPER-LOWER)/(1+|UPPER|) [real (0.01)]
% bmibnb.absgaptol - Tolerance on objective error (UPPER-LOWER) [real (0.01)]
% bmibnb.pdtol - A number is declared non-negative if larger than...[ double (-1e-6)]
% bmibnb.eqtol - A number is declared zero if abs(x) smaller than...[ double (1e-6)]
% bmibnb.maxiter - Maximum number of solved nodes [int (100)]
% bmibnb.maxtime - Maximum CPU time (sec.) [int (3600)]
% Author Johan L�fberg
% $Id: bmibnb.m,v 1.64 2006/03/28 21:47:09 joloef Exp $
% *************************************************************************
% INITIALIZE DIAGNOSTICS ETC
% *************************************************************************
bnbsolvertime = clock;
showprogress('Branch and bound started',p.options.showprogress);
switch max(min(p.options.verbose,3),0)
case 0
p.options.bmibnb.verbose = 0;
case 1
p.options.bmibnb.verbose = 1;
p.options.verbose = 0;
case 2
p.options.bmibnb.verbose = 2;
p.options.verbose = 0;
case 3
p.options.bmibnb.verbose = 2;
p.options.verbose = 1;
otherwise
p.options.bmibnb.verbose = 0;
p.options.verbose = 0;
end
% *******************************
% Assume feasible
% *******************************
p.feasible = 1;
% *******************************
% Pre-calc linear/bilinear/nonlinear variables
% (assumes polynomial program)
% *******************************
[p.linears,p.bilinears,p.nonlinears] = compile_nonlinear_table(p);
% *******************************
% Select branch variables
% *******************************
p.branch_variables = decide_branch_variables(p);
% *******************************
% Now reduce the branch variables by checking which quadratic
% which only are used in the convex cost
% This is experimental code....
% *******************************
if p.solver.lowersolver.objective.quadratic.convex
% Setup quadratic
Q_ = p.Q;
for i = 1:size(p.bilinears,1)
if p.c(p.bilinears(i,1))
Q_(p.bilinears(i,2),p.bilinears(i,3)) = p.c(p.bilinears(i,1))/2;
Q_(p.bilinears(i,2),p.bilinears(i,3)) = Q_(p.bilinears(i,3),p.bilinears(i,2))+p.c(p.bilinears(i,1))/2;
end
end
if nnz(Q_)>0 & all(eig(full(Q_))>-1e-12)
Used_in_F = find(any(p.F_struc(:,2:end),1));
Used_in_F = intersect(Used_in_F,p.bilinears(:,1));
p.branch_variables = [];
for i = 1:size(p.bilinears,1)
j = p.bilinears(i,1);
if ismember(j,Used_in_F)
p.branch_variables = [p.branch_variables p.bilinears(i,2:3)];
end
end
p.branch_variables = unique( p.branch_variables);
end
end
% ********************************
% Extract bounds from model
% ********************************
p = preprocess_bounds(p);
%p.branch_variables = setdiff(p.branch_variables ,find(p.lb == -10));
% ********************************
% Is the initial value feasible
% ********************************
[p,x_min,upper] = initializesolution(p);
% ********************************
% Simple pre-solve (empty rows etc)
% Bound strenghtening
% The loop is needed for variables
% defined as w = x*y, x = t*u,y=..
% ********************************
start = [p.lb;p.ub]+1;i = 0;;goon = 1;
while goon
start = [p.lb;p.ub];
i = i+1;
p = simple_presolve(p);
p = updatenonlinearbounds(p);
p = propagateequalities(p);
p = updatenonlinearbounds(p);
p = updatenonlinearbounds(p);
i = i+1;
goon = (norm(start-[p.lb;p.ub],'inf') > 1e-1) & i < 25;
start = [p.lb;p.ub];
end
% ********************************
% Default root bound improvement
% ********************************
p = root_node_tighten(p,upper);
p = updatenonlinearbounds(p);
p = propagateequalities(p);
p = updatenonlinearbounds(p);
if p.feasible
% *******************************
% Bounded domain?
% *******************************
if ~isempty(p.bilinears)
involved = unique(p.bilinears(:,2:3));
if any(isinf(p.lb(involved))) | any(isinf(p.ub(involved)))
output.Primal = x_min;
output.Dual = [];
output.Slack = [];
output.problem = -6;
output.infostr = yalmiperror(-6);
output.solved_nodes = 0;
output.solverinput = 0;
output.solveroutput = [];
output.solvertime = 0;
return
end
end
% *******************************
% Save time & memory
% *******************************
p.options.savesolverinput = 0;
p.options.savesolveroutput = 0;
p.options.saveduals = 0;
p.options.dimacs = 0;
p.options.dimacs = 0;
% *******************************
% RUN BRANCH & BOUND
% *******************************
[x_min,solved_nodes,lower,upper] = branch_and_bound(p,x_min,upper);
% **********************************
% CREATE SOLUTION
% **********************************
output.problem = 0;
if isinf(upper)
output.problem = 1;
end
if isinf(lower) & (lower<0)
output.problem = 2;
end
if isinf(lower) & (lower>0)
output.problem = 1;
end
if solved_nodes == p.options.bnb.maxiter
output.problem = 3;
end
else
output.problem = 1;
x_min = repmat(nan,length(p.c),1);
solved_nodes = 0;
end
output.solved_nodes = solved_nodes;
output.Primal = x_min;
output.Dual = [];
output.Slack = [];
output.infostr = yalmiperror(output.problem,'BNB');
output.solverinput = 0;
output.solveroutput = [];
output.solvertime = etime(clock,bnbsolvertime);
function [x_min,solved_nodes,lower,upper] = branch_and_bound(p,x_min,upper)
% ***************************************
% Create function handles to solvers
% ***************************************
try
lowersolver = eval(['@' p.solver.lowersolver.call]); % Solver for relaxed problem
uppersolver = eval(['@' p.solver.uppersolver.call]); % Local nonlinear solver
lpsolver = eval(['@' p.solver.lpsolver.call]); % LP solver
catch
disp(' ');
disp('The internal branch & bound solver requires MATLAB 6')
disp('I am too lazy too do the changes to make it compatible')
disp('with MATLAB 5. If you really need it, contact me...');
disp(' ');
error(lasterr);
end
% ************************************************
% GLOBAL PROBLEM DATA
% ************************************************
c = p.c;
Q
没有合适的资源?快使用搜索试试~ 我知道了~
yalmip.rar_1223.246domain com_by.1239 com_sdpvar\eig_yalmip lmi_
共572个文件
m:509个
htm:42个
gif:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 79 浏览量
2022-09-24
23:21:29
上传
评论
收藏 652KB RAR 举报
温馨提示
solve LMI by yalmip library.
资源推荐
资源详情
资源评论
收起资源包目录
yalmip.rar_1223.246domain com_by.1239 com_sdpvar\eig_yalmip lmi_ (572个子文件)
findhash.c 1KB
yalmip.css 4KB
dualform.gif 5KB
gemoetric.gif 4KB
primalform.gif 4KB
ellips5.gif 2KB
dual.h1.gif 2KB
gevp.h4.gif 1KB
dual.h2.gif 1KB
iimg_1.gif 922B
iimg_8.gif 911B
icon_del.GIF 903B
warning.gif 903B
lyapun6.gif 817B
icon_fix.gif 348B
icon_ifix.gif 340B
icon_add.gif 240B
demoicon.gif 214B
reference.htm 231KB
oldnews.htm 75KB
solvers.htm 68KB
faq.htm 57KB
extoperators.htm 34KB
mp.htm 30KB
sos.htm 26KB
intro.htm 24KB
globalbmi.htm 23KB
dual.htm 20KB
logic.htm 18KB
news.htm 16KB
moment.htm 14KB
geometric.htm 10KB
mnl_cnt_reference.htm 10KB
readmore.htm 8KB
ranksdp.htm 8KB
integer.htm 7KB
impexp.htm 6KB
linearregression.htm 6KB
basics.htm 6KB
advanced.htm 6KB
bmi.htm 6KB
form.htm 6KB
ellipsoidal.htm 5KB
mnl_cnt_solvers.htm 5KB
lyapunov.htm 5KB
mnl_cnt_examples.htm 4KB
complex.htm 4KB
gevp.htm 4KB
polynomials.htm 4KB
backwards.htm 3KB
kyp.htm 3KB
licens.htm 3KB
installation.htm 2KB
mnl_cnt.htm 2KB
acknow.htm 2KB
top_frm.htm 2KB
mnl_cnt_clear.htm 2KB
yalmip.htm 1013B
tochead.htm 712B
btm_frm.htm 667B
polytopes.jpg 45KB
exclamationmark.jpg 766B
bmibnb.m 65KB
solvesos.m 51KB
callmpcvx.m 40KB
compileinterfacedata.m 38KB
bnb.m 34KB
sdpsettings.m 30KB
yalmip.m 29KB
globalex.m 26KB
definesolvers.m 24KB
expandmodel.m 23KB
sdpvar.m 21KB
mtimes.m 19KB
dualize.m 19KB
yalmiptest.m 17KB
selectsolver.m 15KB
categorizeproblem.m 13KB
findapplicablesolvers.m 13KB
solvesdp.m 13KB
lmi2sedumistruct.m 13KB
norm.m 11KB
cutsdp.m 11KB
pwa_yalmip.m 10KB
double.m 10KB
sosex.m 10KB
sdisplay.m 9KB
export.m 9KB
callmosek.m 8KB
coefficients.m 8KB
subsasgn.m 7KB
solvemoment.m 7KB
callpenbmim.m 7KB
mpt_appendmodel.m 7KB
pwq_yalmip.m 7KB
mpcvx.m 7KB
monolist.m 7KB
momentex.m 7KB
minus.m 7KB
model.m 7KB
共 572 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
weixin_42653672
- 粉丝: 93
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 算法数据结构-动态规划算法(Dynamic Programming)超详细总结加应用案例讲解.txt
- 2024最强秋招八股文(精简、纯手打)2024最强秋招八股文(精简、纯手打).txt
- 基于tensorflow多特征融合的微表情识别python源码.zip
- 基于yolov8实现人脸检测的python源码+运行说明.zip
- Micron Memory DDR3 SDRAM 全系列AD集成库(原理图库+PCB封装库).IntLib
- 基于tensorflow多特征融合的微表情识别python源码+详细使用说明.zip
- TensorRT部署DETR项目工程C++源码.zip
- Word文字处理软件练习题及答案.doc
- Word普通信纸信纸格式可打印.doc
- TensorRT部署DETR项目工程python源码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功