The Decomposition Algorithm

Example 17.7 Resource Allocation Problem

This example describes a model for selecting tasks to be run on a shared resource (Gamrath 2010). Consider a set I of tasks and a resource capacity C. Each item i element-of upper I has a profit p Subscript i, a resource utilization level w Subscript i, a starting period s Subscript i, and an ending period e Subscript i. The time horizon that is considered is from the earliest starting time to the latest ending time of all tasks. With each task, associate a binary variable x Subscript i, which, if set to 1, indicates that the task is running from its start time until just before its end time. A task consumes capacity if it is running. The goal is to select which tasks to run in order to maximize profit while not exceeding the shared resource capacity. Let upper S equals StartSet s Subscript i Baseline vertical-bar i element-of upper I EndSet define the set of start times for all tasks, and let upper L Subscript s Baseline equals StartSet i element-of upper I vertical-bar s Subscript i Baseline less-than-or-equal-to s less-than e Subscript i Baseline EndSet define the set of tasks that are running at each start time s element-of upper S. You can model the problem as a mixed integer linear programming problem as follows:

In this formulation, the CapacityCon constraints ensure that the running tasks do not exceed the resource capacity. To illustrate, consider the following five-task example with data: p Subscript i Baseline equals left-parenthesis 6 comma 8 comma 5 comma 9 comma 8 right-parenthesis, w Subscript i Baseline equals left-parenthesis 8 comma 5 comma 3 comma 4 comma 3 right-parenthesis, s Subscript i Baseline equals left-parenthesis 1 comma 3 comma 5 comma 7 comma 8 right-parenthesis, e Subscript i Baseline equals left-parenthesis 5 comma 8 comma 9 comma 17 comma 10 right-parenthesis, and upper C equals 10. The formulation leads to a constraint matrix that has a staircase structure that is determined by tasks coming online and offline:

StartLayout 1st Row 1st Column maximize 2nd Column 6 x 1 3rd Column plus 4th Column 8 x 2 5th Column plus 6th Column 5 x 3 7th Column plus 8th Column 9 x 4 9th Column plus 10th Column 8 x 5 2nd Row 1st Column subject to 2nd Column 8 x 1 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column Blank 7th Column Blank 8th Column Blank 9th Column Blank 10th Column Blank 11th Column less-than-or-equal-to 12th Column 10 3rd Row 1st Column Blank 2nd Column 8 x 1 3rd Column plus 4th Column 5 x 2 5th Column Blank 6th Column Blank 7th Column Blank 8th Column Blank 9th Column Blank 10th Column Blank 11th Column less-than-or-equal-to 12th Column 10 4th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column 5 x 2 5th Column plus 6th Column 3 x 3 7th Column Blank 8th Column Blank 9th Column Blank 10th Column Blank 11th Column less-than-or-equal-to 12th Column 10 5th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column 5 x 2 5th Column plus 6th Column 3 x 3 7th Column plus 8th Column 4 x 4 9th Column Blank 10th Column Blank 11th Column less-than-or-equal-to 12th Column 10 6th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column 3 x 3 7th Column plus 8th Column 4 x 4 9th Column plus 10th Column 3 x 5 11th Column less-than-or-equal-to 12th Column 10 7th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column Blank 7th Column Blank 8th Column Blank 9th Column Blank 10th Column x Subscript i 11th Column element-of 12th Column StartSet 0 comma 1 EndSet i element-of upper I EndLayout

Lagrangian Decomposition

This formulation clearly has no decomposable structure. However, you can use a common modeling technique known as Lagrangian decomposition to bring the model into block-angular form. Lagrangian decomposition works by first partitioning the constraints into blocks. Then, each original variable is split into multiple copies of itself, one copy for each block in which the variable has a nonzero coefficient in the constraint matrix. Constraints are added to enforce the equality of each copy of the original variable. Then, you can write the original constraints in block-angular form by using the duplicate variables.

To apply Lagrangian decomposition to the resource allocation problem, define a set B of blocks and let upper S Subscript b define the set of start times for a given block b, such that upper S equals union upper S Subscript b. Given this partition of start times, let upper B Subscript i define the set of blocks in which task i element-of upper I is scheduled to be running. Now, for each task i element-of upper I, define duplicate variables x Subscript i Superscript b for each b element-of upper B Subscript i. Let m Subscript i define the minimum block index for each class of variable that represents task i. You can now model the problem in block-angular form as follows:

In this formulation, the LinkDupVarsCon constraints ensure that the duplicate variables are equal to the original variables. Now, the five-task example has been transformed from a staircase structure to a block-angular structure:

StartLayout 1st Row 1st Column maximize 2nd Column 6 x 1 Superscript 1 3rd Column plus 4th Column 8 x 2 Superscript 1 5th Column Blank 6th Column Blank 7th Column plus 8th Column 5 x 3 squared 9th Column plus 10th Column 9 x 4 squared 11th Column Blank 12th Column Blank 13th Column Blank 14th Column Blank 15th Column plus 16th Column 8 x 5 cubed 2nd Row 1st Column subject to 2nd Column Blank 3rd Column Blank 4th Column x 2 Superscript 1 5th Column minus 6th Column x 2 squared 7th Column Blank 8th Column Blank 9th Column Blank 10th Column Blank 11th Column Blank 12th Column Blank 13th Column Blank 14th Column Blank 15th Column Blank 16th Column Blank 17th Column equals 0 3rd Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column Blank 7th Column Blank 8th Column x 3 squared 9th Column Blank 10th Column Blank 11th Column minus 12th Column x 3 cubed 13th Column Blank 14th Column Blank 15th Column Blank 16th Column Blank 17th Column equals 0 4th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column Blank 7th Column Blank 8th Column Blank 9th Column Blank 10th Column x 4 squared 11th Column Blank 12th Column Blank 13th Column minus 14th Column x 4 cubed 15th Column Blank 16th Column Blank 17th Column equals 0 5th Row 1st Column Blank 2nd Column 8 x 1 Superscript 1 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column Blank 7th Column Blank 8th Column Blank 9th Column Blank 10th Column Blank 11th Column Blank 12th Column Blank 13th Column Blank 14th Column Blank 15th Column Blank 16th Column Blank 17th Column less-than-or-equal-to 10 6th Row 1st Column Blank 2nd Column 8 x 1 Superscript 1 3rd Column plus 4th Column 5 x 2 Superscript 1 5th Column Blank 6th Column Blank 7th Column Blank 8th Column Blank 9th Column Blank 10th Column Blank 11th Column Blank 12th Column Blank 13th Column Blank 14th Column Blank 15th Column Blank 16th Column Blank 17th Column less-than-or-equal-to 10 7th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column 5 x 2 squared 7th Column plus 8th Column 3 x 3 squared 9th Column Blank 10th Column Blank 11th Column Blank 12th Column Blank 13th Column Blank 14th Column Blank 15th Column Blank 16th Column Blank 17th Column less-than-or-equal-to 10 8th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column 5 x 2 squared 7th Column plus 8th Column 3 x 3 squared 9th Column plus 10th Column 4 x 4 squared 11th Column Blank 12th Column Blank 13th Column Blank 14th Column Blank 15th Column Blank 16th Column Blank 17th Column less-than-or-equal-to 10 9th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column Blank 7th Column Blank 8th Column Blank 9th Column Blank 10th Column Blank 11th Column Blank 12th Column 3 x 3 cubed 13th Column plus 14th Column 4 x 4 cubed 15th Column plus 16th Column 3 x 5 cubed 17th Column less-than-or-equal-to 10 10th Row 1st Column Blank 2nd Column Blank 3rd Column Blank 4th Column Blank 5th Column Blank 6th Column Blank 7th Column Blank 8th Column Blank 9th Column Blank 10th Column Blank 11th Column Blank 12th Column Blank 13th Column Blank 14th Column Blank 15th Column Blank 16th Column x Subscript i Superscript b 17th Column element-of StartSet 0 comma 1 EndSet i element-of upper I comma b element-of upper B Subscript i Baseline EndLayout

To see how to apply Lagrangian decomposition in PROC OPTMODEL, consider the data set TaskData from Caprara, Furini, and Malaguti (2010), which consists of StartAbsoluteValue upper I EndAbsoluteValue equals 2,916 tasks:

data TaskData;
   input profit weight start end;
   datalines;
99 92 1 9
56 30 1 3
39 73 1 20
86 76 1 9
...
24 94 768 769
95 40 768 769
66 17 768 769
18 48 768 769
97 23 768 769
;

Using the MILP Solver Directly in PROC OPTMODEL

The following PROC OPTMODEL statements read in the data and solve the original staircase formulation by calling the MILP solver directly:

%macro SetupData(task_data=, capacity=);
   set TASKS;
   num capacity=&capacity;
   num profit{TASKS}, weight{TASKS}, start{TASKS}, end{TASKS};

   read data &task_data into TASKS=[_n_] profit weight start end;
   /* the set of start times */

   set STARTS = setof{i in TASKS} start[i];
   /* the set of tasks i that are active at a given start time s */
   set TASKS_START{s in STARTS}
      = {i in TASKS: start[i] <= s < end[i]};
%mend SetupData;

%macro ResourceAllocation_Direct(task_data=, capacity=);
   proc optmodel sessref="mysess";
      %SetupData(task_data=&task_data,capacity=&capacity);

      /* select task i to come online from period [start to end) */
      var x{TASKS} binary;

      /* maximize the total profit of running tasks */
      max TotalProfit = sum{i in TASKS} profit[i] * x[i];

      /* enforce that the shared resource capacity is not exceeded */
      con CapacityCon{s in STARTS}:
         sum{i in TASKS_START[s]} weight[i] * x[i] <= capacity;

      solve with milp / maxtime=200 logfreq=10000;
   quit;
%mend ResourceAllocation_Direct;

%ResourceAllocation_Direct(task_data=TaskData, capacity=100);

The problem summary and solution summary are displayed in Output 17.7.1.

Output 17.7.1: Problem Summary and Solution Summary

The OPTMODEL Procedure

Problem Summary
Objective SenseMaximization
Objective FunctionTotalProfit
Objective TypeLinear
  
Number of Variables2916
Bounded Above0
Bounded Below0
Bounded Below and Above2916
Free0
Fixed0
Binary2916
Integer0
  
Number of Constraints768
Linear LE (<=)768
Linear EQ (=)0
Linear GE (>=)0
Linear Range0
  
Constraint Coefficients23236

Solution Summary
SolverMILP
AlgorithmBranch and Cut
Objective FunctionTotalProfit
Solution StatusOptimal within Relative Gap
Objective Value40982
  
Relative Gap0.000071659
Absolute Gap2.936941176
Primal Infeasibility0
Bound Infeasibility0
Integer Infeasibility0
  
Best Bound40984.936941
Nodes3995
Solutions Found21
Iterations138500
Presolve Time0.12
Solution Time17.54


The iteration log, which contains the problem statistics, the progress of the solution, and the best integer feasible solution found, is shown in Output 17.7.2.

Output 17.7.2: Log

NOTE: There were 2916 observations read from the data set WORK.TASKDATA.                        
NOTE: Problem generation will use 4 threads.                                                    
NOTE: The problem has 2916 variables (0 free, 0 fixed).                                         
NOTE: The problem has 2916 binary and 0 integer variables.                                      
NOTE: The problem has 768 linear constraints (768 LE, 0 EQ, 0 GE, 0 range).                     
NOTE: The problem has 23236 linear constraint coefficients.                                     
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).                      
NOTE: The SOLVE statement is executing in the distributed computing environment in              
      single-machine mode.                                                                      
NOTE: The remaining solution time after problem generation and solver initialization is 199.56  
      seconds.                                                                                  
NOTE: The initial MILP heuristics are applied.                                                  
NOTE: The MILP presolver value AUTOMATIC is applied.                                            
NOTE: The MILP presolver removed 1021 variables and 126 constraints.                            
NOTE: The MILP presolver removed 12544 constraint coefficients.                                 
NOTE: The MILP presolver modified 987 constraint coefficients.                                  
NOTE: The presolved problem has 1895 variables, 642 constraints, and 10692 constraint           
      coefficients.                                                                             
NOTE: The MILP solver is called.                                                                
NOTE: The parallel Branch and Cut algorithm is used.                                            
NOTE: The Branch and Cut algorithm is using up to 8 threads.                                    
          Node   Active   Sols    BestInteger      BestBound      Gap    Time                   
             0        1      4  33939.0000000         109181   68.91%       0                   
             0        1      4  33939.0000000  45862.9249030   26.00%       0                   
             0        1      8  39381.0000000  45862.9249030   14.13%       0                   
             0        1      8  39381.0000000  43436.9793919    9.34%       0                   
             0        1      9  39384.0000000  43436.9793919    9.33%       0                   
             0        1      9  39384.0000000  42694.3234326    7.75%       0                   
             0        1      9  39384.0000000  42223.9871989    6.73%       0                   
             0        1      9  39384.0000000  41924.1960727    6.06%       1                   
             0        1      9  39384.0000000  41712.4716488    5.58%       1                   
             0        1      9  39384.0000000  41562.7841774    5.24%       1                   
             0        1      9  39384.0000000  41466.9548734    5.02%       1                   
             0        1     12  40402.0000000  41466.9548734    2.57%       1                   
             0        1     12  40402.0000000  41398.7613863    2.41%       1                   
             0        1     12  40402.0000000  41353.0197703    2.30%       2                   
             0        1     12  40402.0000000  41295.4350040    2.16%       2                   
             0        1     12  40402.0000000  41255.8930483    2.07%       2                   
             0        1     12  40402.0000000  41228.7790679    2.01%       2                   
             0        1     12  40402.0000000  41207.2702974    1.95%       2                   
             0        1     12  40402.0000000  41187.9270201    1.91%       3                   
             0        1     12  40402.0000000  41171.1531124    1.87%       3                   
             0        1     12  40402.0000000  41162.4612728    1.85%       3                   
             0        1     12  40402.0000000  41150.1304221    1.82%       3                   
             0        1     12  40402.0000000  41141.5525665    1.80%       3                   
             0        1     12  40402.0000000  41129.1467086    1.77%       3                   
             0        1     12  40402.0000000  41121.6595280    1.75%       4                   
             0        1     12  40402.0000000  41112.9605374    1.73%       4                   
             0        1     12  40402.0000000  41104.4934133    1.71%       4                   
             0        1     12  40402.0000000  41095.2605978    1.69%       4                   
             0        1     15  40879.0000000  41095.2605978    0.53%       4                   
NOTE: The MILP solver added 824 cuts with 10535 cut coefficients at the root.                   
           855      367     17  40923.0000000  41044.0601811    0.29%       6                   
          1178      576     19  40940.0000000  41041.2028522    0.25%       6                   
          1358      671     20  40964.0000000  41037.8969768    0.18%       7                   
          3138      508     23  40978.0000000  41000.8235208    0.06%      16                   
          3171      493     24  40982.0000000  41000.4836406    0.05%      16                   
          3994       12     24  40982.0000000  40984.9369412    0.01%      17                   
NOTE: Optimal within relative gap.                                                              
NOTE: Objective = 40982.                                                                        


Using the Decomposition Algorithm in PROC OPTMODEL

To transform this data into block-angular form, first sort the task data to help reduce the number of duplicate variables that are needed in the reformulation as follows:

proc sort data=TaskData;
   by start end;
run;

Then, create the partition of constraints into blocks of size block_size as follows:

%macro ResourceAllocation_Decomp(task_data=, capacity=, block_size=);
   proc optmodel sessref="mysess";
      %SetupData(task_data=&task_data,capacity=&capacity);
      /* partition into blocks of size blocks_size */
      num block_size = &block_size;
      num num_blocks = ceil( card(TASKS) / block_size );
      set BLOCKS     = 1..num_blocks;

      /* the set of starts s for which task i is active */
      set STARTS_TASK{i in TASKS} = {s in STARTS: start[i] <= s < end[i]};

      /* partition the start times into blocks of size block_size */
      set STARTS_BLOCK{BLOCKS} init {};
      num block_id    init 1;
      num block_count init 0;
      for{s in STARTS} do;
         STARTS_BLOCK[block_id] = STARTS_BLOCK[block_id] union {s};
         block_count = block_count + 1;
         if(mod(block_count, block_size) = 0) then
             block_id = block_id + 1;
      end;

Then, use the following PROC OPTMODEL statements to define the block-angular formulation and solve the problem by using the decomposition algorithm, the PRESOLVER=BASIC option, and block_size=20. Because this reformulation is equivalent to the original staircase formulation, disabling some of the advanced presolver techniques ensures that the model maintains block-angularity.

      /* blocks in which task i is online */
      set BLOCKS_TASK{i in TASKS} =
         {b in BLOCKS: card(STARTS_BLOCK[b] inter STARTS_TASK[i]) > 0};

      /* minimum block id in which task i is online */
      num min_block{i in TASKS} = min{b in BLOCKS_TASK[i]} b;

      /* select task i to come online from period [start to end)
         in each block */
      var x{i in TASKS, b in BLOCKS_TASK[i]} binary;

      /* maximize the total profit of running tasks */
      max TotalProfit = sum{i in TASKS} profit[i] * x[i,min_block[i]];

      /* enforce that task selection is consistent across blocks */
      con LinkDupVarsCon{i in TASKS, b in BLOCKS_TASK[i] diff {min_block[i]}}:
         x[i,b] = x[i,min_block[i]];

      /* enforce that the shared resource capacity is not exceeded */
      con CapacityCon{b in BLOCKS, s in STARTS_BLOCK[b]}:
         sum{i in TASKS_START[s]} weight[i] * x[i,b] <= capacity;

      /* define blocks for decomposition algorithm */
      for{b in BLOCKS, s in STARTS_BLOCK[b]} CapacityCon[b,s].block = b;

      solve with milp / presolver=basic decomp;
   quit;
%mend ResourceAllocation_Decomp;

%ResourceAllocation_Decomp(task_data=TaskData, capacity=100, block_size=20);

The problem summary and solution summary are displayed in Output 17.7.3. Compared to the original formulation, the numbers of variables and constraints are increased by the number of duplicate variables.

Output 17.7.3: Problem Summary and Solution Summary

The OPTMODEL Procedure

Problem Summary
Objective SenseMaximization
Objective FunctionTotalProfit
Objective TypeLinear
  
Number of Variables3924
Bounded Above0
Bounded Below0
Bounded Below and Above3924
Free0
Fixed0
Binary3924
Integer0
  
Number of Constraints1776
Linear LE (<=)768
Linear EQ (=)1008
Linear GE (>=)0
Linear Range0
  
Constraint Coefficients25252

Solution Summary
SolverMILP
AlgorithmDecomposition
Objective FunctionTotalProfit
Solution StatusOptimal within Relative Gap
Objective Value40982
  
Relative Gap0.0000731975
Absolute Gap3
Primal Infeasibility3.774758E-15
Bound Infeasibility4.218847E-15
Integer Infeasibility4.218847E-15
  
Best Bound40985
Nodes13
Solutions Found106
Iterations314
Presolve Time0.06
Solution Time187.66


The iteration log, which contains the problem statistics, the progress of the solution, and the optimal objective value, is shown in Output 17.7.4.

Output 17.7.4: Log

NOTE: There were 2916 observations read from the data set WORK.TASKDATA.                        
NOTE: Problem generation will use 4 threads.                                                    
NOTE: The problem has 3924 variables (0 free, 0 fixed).                                         
NOTE: The problem has 3924 binary and 0 integer variables.                                      
NOTE: The problem has 1776 linear constraints (768 LE, 1008 EQ, 0 GE, 0 range).                 
NOTE: The problem has 25252 linear constraint coefficients.                                     
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).                      
NOTE: The SOLVE statement is executing in the distributed computing environment in              
      single-machine mode.                                                                      
NOTE: The initial MILP heuristics are applied.                                                  
NOTE: The MILP presolver value BASIC is applied.                                                
NOTE: The MILP presolver removed 4 variables and 0 constraints.                                 
NOTE: The MILP presolver removed 23 constraint coefficients.                                    
NOTE: The MILP presolver modified 7297 constraint coefficients.                                 
NOTE: The presolved problem has 3920 variables, 1776 constraints, and 25229 constraint          
      coefficients.                                                                             
NOTE: The MILP solver is called.                                                                
NOTE: The Decomposition algorithm is used.                                                      
NOTE: The Decomposition algorithm is executing in single-machine mode.                          
NOTE: The DECOMP method value USER is applied.                                                  
NOTE: The problem has a decomposable structure with 39 blocks. The largest block covers 1.126%  
      of the constraints in the problem.                                                        
NOTE: The decomposition subproblems cover 3920 (100%) variables and 768 (43.24%) constraints.   
NOTE: The deterministic parallel mode is enabled.                                               
NOTE: The Decomposition algorithm is using up to 8 threads.                                     
      Iter         Best       Master         Best       LP       IP  CPU Real                   
                  Bound    Objective      Integer      Gap      Gap Time Time                   
         .   44109.0069   37625.0000   37625.0000   14.70%   14.70%    2    1                   
         9   44109.0069   37679.0000   37679.0000   14.58%   14.58%    6    2                   
         .   44109.0069   37679.0000   37679.0000   14.58%   14.58%    6    2                   
        10   44109.0069   37679.0000   37679.0000   14.58%   14.58%    8    3                   
        12   44109.0069   37789.0000   37789.0000   14.33%   14.33%   11    4                   
        14   44109.0069   38215.0000   38215.0000   13.36%   13.36%   13    5                   
        17   44109.0069   38320.0000   38320.0000   13.12%   13.12%   15    6                   
        19   44109.0069   38629.0000   38629.0000   12.42%   12.42%   16    6                   
        20   44109.0069   38629.0000   39036.0000   12.42%   11.50%   16    6                   
        23   44109.0069   39115.0000   39115.0000   11.32%   11.32%   20    8                   
        27   44109.0069   39351.0000   39351.0000   10.79%   10.79%   24    9                   
        30   44109.0069   39649.0000   39649.0000   10.11%   10.11%   28   11                   
        32   44109.0069   39947.0000   39947.0000    9.44%    9.44%   32   11                   
        35   44109.0069   40276.0000   40276.0000    8.69%    8.69%   38   14                   
         .   44109.0069   40294.3996   40276.0000    8.65%    8.69%   53   18                   
        40   44109.0069   40294.3996   40276.0000    8.65%    8.69%   55   19                   
        42   44109.0069   40519.0000   40519.0000    8.14%    8.14%   58   20                   
        49   44109.0069   40731.0000   40731.0000    7.66%    7.66%   81   25                   
        50   44109.0069   40735.0000   40731.0000    7.65%    7.66%   86   27                   
        54   44109.0069   40760.0000   40756.0000    7.59%    7.60%   96   29                   
        56   44109.0069   40794.0000   40790.0000    7.52%    7.52%  100   31                   
        60   44109.0069   40794.0000   40797.0000    7.52%    7.51%  113   34                   
        61   44109.0069   40813.0000   40809.0000    7.47%    7.48%  116   35                   
        70   44109.0069   40842.1073   40901.0000    7.41%    7.27%  147   44                   
        80   44109.0069   40939.3333   40927.0000    7.19%    7.21%  170   51                   
        85   44109.0069   40944.5833   40935.0000    7.17%    7.20%  177   53                   
        90   44109.0069   40949.8333   40942.0000    7.16%    7.18%  182   56                   
        91   44109.0069   40971.8333   40953.0000    7.11%    7.16%  183   56                   
        93   44109.0069   40992.8333   40974.0000    7.06%    7.11%  184   56                   
       100   44109.0069   40992.8333   40974.0000    7.06%    7.11%  191   60                   
       101   41070.2000   40992.8333   40974.0000    0.19%    0.23%  196   61                   
       102   41034.3333   40995.5000   40974.0000    0.09%    0.15%  199   62                   
       103   41023.9167   40995.5000   40974.0000    0.07%    0.12%  202   62                   
       110   40997.5833   40997.5833   40974.0000    0.00%    0.06%  208   66                   
         .   40997.5833   40997.5833   40982.0000    0.00%    0.04%  209   66                   
NOTE: Starting branch and bound.                                                                
         Node  Active   Sols         Best         Best      Gap    CPU   Real                   
                                  Integer        Bound            Time   Time                   
            0       1    106   40982.0000   40997.5833    0.04%    209     66                   
            1       1    106   40982.0000   40997.5833    0.04%    265     83                   
            2       2    106   40982.0000   40991.5833    0.02%    325    102                   
            3       3    106   40982.0000   40991.5833    0.02%    353    114                   
            4       4    106   40982.0000   40991.3333    0.02%    387    125                   
            6       4    106   40982.0000   40991.0000    0.02%    430    138                   
            8       2    106   40982.0000   40987.3333    0.01%    478    157                   
            9       1    106   40982.0000   40987.3333    0.01%    504    167                   
           11       1    106   40982.0000   40987.0000    0.01%    555    182                   
           12       0    106   40982.0000   40985.0000    0.01%    565    187                   
NOTE: The Decomposition algorithm used 8 threads.                                               
NOTE: The Decomposition algorithm time is 187.66 seconds.                                       
NOTE: Optimal within relative gap.                                                              
NOTE: Objective = 40982.                                                                        


The Trade-Off between Coverage and Subproblem Difficulty

The reformulation of this resource allocation problem provides a nice example of the potential trade-offs in modeling a problem for use with the decomposition algorithm. As seen in Example 17.2, the strength of the bound is an important factor in the overall performance of the algorithm, but it is not always correlated to the magnitude of the subproblem coverage. In the current example, the block size determines the number of blocks. Moreover, it determines the number of linking variables that are needed in the reformulation. At one extreme, if the block size is set to be StartAbsoluteValue upper S EndAbsoluteValue, then the number of blocks is 1, and the number of copies of original variables is 0. Using one block would be equivalent to the original staircase formulation and would not yield a model conducive to decomposition. As the number of blocks is increased, the number of linking variables increases (the size of the master problem), the strength of the decomposition bound decreases, and the difficulty of solving the subproblems decreases. In addition, as the number of blocks and their relative difficulty change, the efficient utilization of your machine’s parallel architecture can be affected.

The previous section used a block size of 20. The following statement calls the decomposition algorithm and uses a block size of 80:

%ResourceAllocation_Decomp(task_data=TaskData, capacity=100, block_size=80);

The solution summary is displayed in Output 17.7.5.

Output 17.7.5: Solution Summary

The OPTMODEL Procedure

Solution Summary
SolverMILP
AlgorithmDecomposition
Objective FunctionTotalProfit
Solution StatusOptimal
Objective Value40982
  
Relative Gap0
Absolute Gap0
Primal Infeasibility0
Bound Infeasibility0
Integer Infeasibility0
  
Best Bound40982
Nodes1
Solutions Found40
Iterations44
Presolve Time0.03
Solution Time46.22


The iteration log, which contains the problem statistics, the progress of the solution, and the optimal objective value, is shown in Output 17.7.6.

This version of the model provides a stronger initial bound and solves to optimality in the root node.

Output 17.7.6: Log

NOTE: There were 2916 observations read from the data set WORK.TASKDATA.                        
NOTE: Problem generation will use 4 threads.                                                    
NOTE: The problem has 3151 variables (0 free, 0 fixed).                                         
NOTE: The problem has 3151 binary and 0 integer variables.                                      
NOTE: The problem has 1003 linear constraints (768 LE, 235 EQ, 0 GE, 0 range).                  
NOTE: The problem has 23706 linear constraint coefficients.                                     
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).                      
NOTE: The SOLVE statement is executing in the distributed computing environment in              
      single-machine mode.                                                                      
NOTE: The initial MILP heuristics are applied.                                                  
NOTE: The MILP presolver value BASIC is applied.                                                
NOTE: The MILP presolver removed 5 variables and 0 constraints.                                 
NOTE: The MILP presolver removed 29 constraint coefficients.                                    
NOTE: The MILP presolver modified 7295 constraint coefficients.                                 
NOTE: The presolved problem has 3146 variables, 1003 constraints, and 23677 constraint          
      coefficients.                                                                             
NOTE: The MILP solver is called.                                                                
NOTE: The Decomposition algorithm is used.                                                      
NOTE: The Decomposition algorithm is executing in single-machine mode.                          
NOTE: The DECOMP method value USER is applied.                                                  
NOTE: The problem has a decomposable structure with 10 blocks. The largest block covers 7.976%  
      of the constraints in the problem.                                                        
NOTE: The decomposition subproblems cover 3146 (100%) variables and 768 (76.57%) constraints.   
NOTE: The deterministic parallel mode is enabled.                                               
NOTE: The Decomposition algorithm is using up to 8 threads.                                     
      Iter         Best       Master         Best       LP       IP  CPU Real                   
                  Bound    Objective      Integer      Gap      Gap Time Time                   
         .   41762.0006   37786.0000   37786.0000    9.52%    9.52%    4    2                   
         .   41762.0006   38999.0000   38999.0000    6.62%    6.62%   20    8                   
        10   41762.0006   38999.0000   38999.0000    6.62%    6.62%   24    9                   
        15   41762.0006   40446.0000   40446.0000    3.15%    3.15%   34   13                   
        18   41762.0006   40705.0000   40705.0000    2.53%    2.53%   40   14                   
         .   41762.0006   40705.0000   40705.0000    2.53%    2.53%   43   15                   
        20   41762.0006   40705.0000   40705.0000    2.53%    2.53%   47   16                   
        22   41762.0006   40854.0000   40854.0000    2.17%    2.17%   58   20                   
        24   41762.0006   40870.0000   40870.0000    2.14%    2.14%   69   23                   
        30   41762.0006   40870.0000   40870.0000    2.14%    2.14%   96   31                   
        34   41762.0006   40971.0000   40971.0000    1.89%    1.89%  107   35                   
        36   41762.0006   40982.0000   40982.0000    1.87%    1.87%  111   37                   
         .   41762.0006   40982.0000   40982.0000    1.87%    1.87%  119   41                   
        40   41762.0006   40982.0000   40982.0000    1.87%    1.87%  120   41                   
        41   41048.0000   40982.0000   40982.0000    0.16%    0.16%  124   43                   
        43   41028.0000   40982.0000   40982.0000    0.11%    0.11%  128   45                   
        44   40982.0000   40982.0000   40982.0000    0.00%    0.00%  130   46                   
         Node  Active   Sols         Best         Best      Gap    CPU   Real                   
                                  Integer        Bound            Time   Time                   
            0       1     40   40982.0000   40982.0000    0.00%    130     46                   
NOTE: The Decomposition algorithm used 8 threads.                                               
NOTE: The Decomposition algorithm time is 46.22 seconds.                                        
NOTE: Optimal.                                                                                  
NOTE: Objective = 40982.                                                                        


Last updated: November 04, 2020