Rev | Line | |
---|
[37] | 1 | function model = mpt_enumeration_mpmilp(Matrices,options) |
---|
| 2 | % Variable bounds when all binary variables are relaxed |
---|
| 3 | [global_lower,global_upper] = mpt_detect_and_improve_bounds(Matrices,Matrices.lb,Matrices.ub,Matrices.binary_var_index,options); |
---|
| 4 | |
---|
| 5 | Matrices.lb = global_lower; |
---|
| 6 | Matrices.ub = global_upper; |
---|
| 7 | if any(Matrices.lb(end-Matrices.nx+1:end) == Matrices.ub(end-Matrices.nx+1:end)) |
---|
| 8 | model = []; |
---|
| 9 | return |
---|
| 10 | end |
---|
| 11 | |
---|
| 12 | % Enumerate a sufficent set of binary cases |
---|
| 13 | % (exploit SOS and pure binary constraints) |
---|
| 14 | [enums,Matrices] = mpt_enumerate_binary(Matrices); |
---|
| 15 | |
---|
| 16 | model = []; |
---|
| 17 | for i = 1:size(enums,2); |
---|
| 18 | if options.verbose & rem(i,20)==0 |
---|
| 19 | disp(['Binary node ' num2str(i) '/' num2str(size(enums,2))]); |
---|
| 20 | end |
---|
| 21 | % Create node problem |
---|
| 22 | lower = global_lower; |
---|
| 23 | upper = global_upper; |
---|
| 24 | lower(Matrices.binary_var_index) = enums(:,i); |
---|
| 25 | upper(Matrices.binary_var_index) = enums(:,i); |
---|
| 26 | % Pre-solve, solve and merge |
---|
| 27 | model = mpt_solvenode(Matrices,lower,upper,Matrices,model,options); |
---|
| 28 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.