The Dantzig-Wolfe Decomposition Algorithm

Example 18.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:

StartLayout 1st Row 1st Column Blank 2nd Column maximize 3rd Column sigma-summation Underscript i element-of upper I Endscripts p Subscript i Baseline x Subscript i 2nd Row 1st Column Blank 2nd Column subject to 3rd Column sigma-summation Underscript i element-of upper L Subscript s Endscripts w Subscript i Baseline x Subscript i 4th Column less-than-or-equal-to upper C 5th Column Blank 6th Column s element-of upper S 7th Column Blank 8th Column left-parenthesis CapacityCon right-parenthesis 3rd Row 1st Column Blank 2nd Column Blank 3rd Column x Subscript i 4th Column element-of StartSet 0 comma 1 EndSet 5th Column Blank 6th Column i element-of upper I EndLayout

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:

StartLayout 1st Row 1st Column Blank 2nd Column maximize 3rd Column sigma-summation Underscript i element-of upper I Endscripts p Subscript i Baseline x Subscript i Superscript m Super Subscript i 2nd Row 1st Column Blank 2nd Column subject to 3rd Column x Subscript i Superscript b 4th Column equals x Subscript i Superscript m Super Subscript i Baseline 5th Column Blank 6th Column i element-of upper I comma b element-of upper B Subscript i Baseline minus StartSet m Subscript i Baseline EndSet 7th Column Blank 8th Column left-parenthesis LinkDupVarsCon right-parenthesis 3rd Row 1st Column Blank 2nd Column Blank 3rd Column sigma-summation Underscript i element-of upper L Subscript s Endscripts w Subscript i Baseline x Subscript i Superscript b 4th Column less-than-or-equal-to upper C 5th Column Blank 6th Column b element-of upper B comma s element-of upper S Subscript b Baseline 7th Column Blank 8th Column left-parenthesis CapacityCon right-parenthesis 4th Row 1st Column Blank 2nd Column Blank 3rd Column x Subscript i Superscript b 4th Column element-of StartSet 0 comma 1 EndSet 5th Column Blank 6th Column i element-of upper I comma b element-of upper B Subscript i Baseline EndLayout

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;
      %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 18.7.1.

Output 18.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.000067678
Absolute Gap2.7737670484
Primal Infeasibility0
Bound Infeasibility0
Integer Infeasibility0
  
Best Bound40984.773767
Nodes4233
Solutions Found19
Iterations192934
Presolve Time0.17
Solution Time11.19


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

Output 18.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 remaining solution time after problem generation and solver initialization is 199.79  
      seconds.                                                                                  
NOTE: The initial MILP heuristics are applied.                                                  
NOTE: The MILP presolver value AUTOMATIC is applied.                                            
NOTE: The MILP presolver removed 1020 variables and 125 constraints.                            
NOTE: The MILP presolver removed 12536 constraint coefficients.                                 
NOTE: The MILP presolver modified 986 constraint coefficients.                                  
NOTE: The presolved problem has 1896 variables, 643 constraints, and 10700 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 4 threads.                                    
          Node   Active   Sols    BestInteger      BestBound      Gap    Time                   
             0        1      4  33729.0000000         109193   69.11%       0                   
             0        1      4  33729.0000000  45862.9249030   26.46%       0                   
             0        1      8  39449.0000000  45862.9249030   13.98%       0                   
             0        1      8  39449.0000000  43002.5181567    8.26%       0                   
             0        1      8  39449.0000000  42162.5752957    6.44%       0                   
             0        1      8  39449.0000000  41819.2940892    5.67%       0                   
             0        1      8  39449.0000000  41580.6208529    5.13%       0                   
             0        1      8  39449.0000000  41433.6654629    4.79%       0                   
             0        1      8  39449.0000000  41346.9591666    4.59%       0                   
             0        1      8  39449.0000000  41279.4447414    4.43%       0                   
             0        1      8  39449.0000000  41240.2893359    4.34%       0                   
             0        1     11  40545.0000000  41240.2893359    1.69%       0                   
             0        1     11  40545.0000000  41210.5240951    1.61%       1                   
             0        1     11  40545.0000000  41181.8310188    1.55%       1                   
             0        1     11  40545.0000000  41165.4321985    1.51%       1                   
             0        1     11  40545.0000000  41151.4170468    1.47%       1                   
             0        1     11  40545.0000000  41138.9484700    1.44%       1                   
             0        1     11  40545.0000000  41132.1591670    1.43%       1                   
             0        1     11  40545.0000000  41123.5505126    1.41%       1                   
             0        1     11  40545.0000000  41117.2619191    1.39%       1                   
             0        1     11  40545.0000000  41113.0547142    1.38%       1                   
             0        1     11  40545.0000000  41108.3108206    1.37%       1                   
             0        1     11  40545.0000000  41104.7725246    1.36%       1                   
NOTE: The MILP solver added 804 cuts with 11259 cut coefficients at the root.                   
           194      174     13  40789.0000000  41087.8686364    0.73%       2                   
           211      175     14  40908.0000000  41087.8686364    0.44%       2                   
           856      457     15  40920.0000000  41059.4316660    0.34%       3                   
          1016      520     18  40964.0000000  41056.0222574    0.22%       3                   
          1742      232     19  40967.0000000  41049.9964981    0.20%       7                   
          1852      310     20  40974.0000000  41049.9964981    0.19%       7                   
          2431      575     22  40977.0000000  41032.2983583    0.13%       8                   
          3818      351     23  40978.0000279  40987.9165456    0.02%      10                   
          3835      335     24  40979.0000000  40987.8799224    0.02%      10                   
          4232       38     25  40982.0000000  40984.7737670    0.01%      11                   
NOTE: Optimal within relative gap.                                                              
NOTE: Objective = 40982.                                                                        


Using the Dantzig-Wolfe 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;
      %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 Dantzig-Wolfe 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 Dantzig-Wolfe 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 18.7.3. Compared to the original formulation, the numbers of variables and constraints are increased by the number of duplicate variables.

Output 18.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.0000732038
Absolute Gap3.0002572281
Primal Infeasibility4.440892E-16
Bound Infeasibility4.440892E-16
Integer Infeasibility8.881784E-16
  
Best Bound40985.000257
Nodes13
Solutions Found77
Iterations364
Presolve Time0.03
Solution Time113.15


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

Output 18.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 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 4 threads.                                     
      Iter         Best       Master         Best       LP       IP  CPU Real                   
                  Bound    Objective      Integer      Gap      Gap Time Time                   
         .   44109.0000   37658.0000   37658.0000   14.63%   14.63%    1    0                   
         5   44109.0000   37693.0000   37693.0000   14.55%   14.55%    2    1                   
         8   44109.0000   38397.0000   38397.0000   12.95%   12.95%    3    1                   
         .   44109.0000   38397.0000   38397.0000   12.95%   12.95%    4    2                   
        10   44109.0000   38397.0000   38397.0000   12.95%   12.95%    4    2                   
        14   44109.0000   38805.0000   38805.0000   12.02%   12.02%    5    2                   
        17   44109.0000   39097.0000   39097.0000   11.36%   11.36%    6    3                   
         .   44109.0000   39477.0000   39477.0000   10.50%   10.50%    7    3                   
        20   44109.0000   39477.0000   39477.0000   10.50%   10.50%    8    4                   
        23   44109.0000   39593.0000   39593.0000   10.24%   10.24%   10    4                   
        24   44109.0000   39663.0000   39663.0000   10.08%   10.08%   11    5                   
        26   44109.0000   39675.0000   39675.0000   10.05%   10.05%   13    6                   
        29   44109.0000   40280.0000   40280.0000    8.68%    8.68%   16    7                   
        30   44109.0000   40280.0000   40410.0000    8.68%    8.39%   16    7                   
        35   44109.0000   40525.0000   40525.0000    8.13%    8.13%   22    9                   
         .   44109.0000   40529.0000   40525.0000    8.12%    8.13%   28   12                   
        40   44109.0000   40529.0000   40525.0000    8.12%    8.13%   30   12                   
        41   42837.7879   40529.0000   40525.0000    5.39%    5.40%   32   13                   
        42   42464.5494   40529.3333   40525.0000    4.56%    4.57%   34   14                   
        43   42274.6091   40529.3333   40525.0000    4.13%    4.14%   36   15                   
        47   42274.6091   40852.0000   40848.0000    3.37%    3.37%   39   16                   
        49   42274.6091   40904.0000   40900.0000    3.24%    3.25%   40   17                   
        50   42274.6091   40904.0000   40900.0000    3.24%    3.25%   41   17                   
        52   42274.6091   40916.0000   40915.0000    3.21%    3.22%   43   18                   
        59   42274.6091   40937.0000   40924.0000    3.16%    3.19%   52   21                   
        60   42274.6091   40937.0000   40924.0000    3.16%    3.19%   54   22                   
        61   41175.1668   40939.0000   40931.0000    0.57%    0.59%   56   23                   
        62   41123.3615   40939.0000   40931.0000    0.45%    0.47%   58   24                   
        63   41088.1949   40939.0000   40931.0000    0.36%    0.38%   60   24                   
        64   41088.1949   40969.5833   40958.0000    0.29%    0.32%   61   25                   
        65   41088.1949   40984.5833   40973.0000    0.25%    0.28%   62   25                   
        70   41088.1949   40988.5833   40973.0000    0.24%    0.28%   65   27                   
        76   41009.5842   40988.5833   40973.0000    0.05%    0.09%   68   29                   
        77   40997.5838   40988.5833   40973.0000    0.02%    0.06%   70   29                   
        78   40997.5837   40988.5833   40973.0000    0.02%    0.06%   71   30                   
        79   40997.5837   40997.5833   40982.0000    0.00%    0.04%   71   30                   
         .   40997.5837   40997.5833   40982.0000    0.00%    0.04%   71   30                   
        80   40997.5837   40997.5833   40982.0000    0.00%    0.04%   71   30                   
        83   40997.5836   40997.5833   40982.0000    0.00%    0.04%   74   31                   
NOTE: Starting branch and bound.                                                                
         Node  Active   Sols         Best         Best      Gap    CPU   Real                   
                                  Integer        Bound            Time   Time                   
            0       1     77   40982.0000   40997.5836    0.04%     74     31                   
            1       3     77   40982.0000   40997.5836    0.04%    159     69                   
            3       3     77   40982.0000   40991.5835    0.02%    187     82                   
            5       5     77   40982.0000   40991.3334    0.02%    210     92                   
            9       3     77   40982.0000   40987.3343    0.01%    246    109                   
           12       0     77   40982.0000   40985.0003    0.01%    253    113                   
NOTE: The Decomposition algorithm used 4 threads.                                               
NOTE: The Decomposition algorithm time is 113.15 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 Dantzig-Wolfe decomposition algorithm. As seen in Example 18.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 Dantzig-Wolfe 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 18.7.5.

Output 18.7.5: Solution Summary

The OPTMODEL Procedure

Solution Summary
SolverMILP
AlgorithmDecomposition
Objective FunctionTotalProfit
Solution StatusOptimal within Relative Gap
Objective Value40982
  
Relative Gap0.0000975983
Absolute Gap4.0001621674
Primal Infeasibility0
Bound Infeasibility0
Integer Infeasibility0
  
Best Bound40986.000162
Nodes1
Solutions Found48
Iterations45
Presolve Time0.03
Solution Time29.48


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

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

Output 18.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 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 4 threads.                                     
      Iter         Best       Master         Best       LP       IP  CPU Real                   
                  Bound    Objective      Integer      Gap      Gap Time Time                   
         .   41762.0044   37436.0000   37436.0000   10.36%   10.36%    2    1                   
         7   41762.0044   38060.0000   38060.0000    8.86%    8.86%    8    3                   
         .   41762.0044   38715.0000   38715.0000    7.30%    7.30%   10    4                   
        10   41762.0044   38715.0000   38715.0000    7.30%    7.30%   13    5                   
        14   41762.0044   39470.0000   39470.0000    5.49%    5.49%   17    7                   
        17   41762.0044   40416.0000   40416.0000    3.22%    3.22%   21    8                   
        19   41762.0044   40640.0000   40640.0000    2.69%    2.69%   24    9                   
         .   41762.0044   40640.0000   40640.0000    2.69%    2.69%   24    9                   
        20   41762.0044   40640.0000   40640.0000    2.69%    2.69%   26   10                   
        22   41762.0044   40768.0000   40768.0000    2.38%    2.38%   28   11                   
        27   41592.4378   40773.0000   40773.0000    1.97%    1.97%   43   17                   
        28   41592.4378   40795.0000   40795.0000    1.92%    1.92%   45   18                   
        30   41592.4378   40795.0000   40928.0000    1.92%    1.60%   48   19                   
        37   41592.4378   40955.0000   40955.0000    1.53%    1.53%   62   24                   
         .   41592.4378   40955.0000   40955.0000    1.53%    1.53%   64   25                   
        40   41592.4378   40955.0000   40955.0000    1.53%    1.53%   66   26                   
        41   40986.0002   40955.0000   40955.0000    0.08%    0.08%   69   28                   
NOTE: The Decomposition algorithm stopped on the integer RELOBJGAP= option.                     
        45   40986.0002   40957.5000   40982.0000    0.07%    0.01%   72   29                   
         Node  Active   Sols         Best         Best      Gap    CPU   Real                   
                                  Integer        Bound            Time   Time                   
            0       1     48   40982.0000   40986.0002    0.01%     72     29                   
NOTE: The Decomposition algorithm used 4 threads.                                               
NOTE: The Decomposition algorithm time is 29.48 seconds.                                        
NOTE: Optimal within relative gap.                                                              
NOTE: Objective = 40982.                                                                        


Last updated: June 22, 2026