The OPTLSO Procedure

Example 3.10 Multiobjective Optimization

The following optimization problem is discussed in Huband et al. (2006); Custódio et al. (2011). This example illustrates how to use PROC FCMP to define multiple nonlinear objectives. This problem minimizes

\[  f_1(x) = (x_1-1)^2 + (x_1-x_2)^2 \text { and } f_2(x) = (x_1 - x_2)^2 + (x_2 - 3)^2  \]

subject to $0 \le x_1, x_2 \le 5.$ The VARIABLES=VARDATA option in the PROC OPTLSO statement specifies the variables and their respective bounds. The objective functions are defined by using PROC FCMP, and the objective function names and other properties are described in the SAS data set objdata. The problem description is then passed to the OPTLSO procedure by using the options VARIABLES=VARDATA and OBJECTIVE=OBJDATA.

data vardata;
   input _id_ $ _lb_ _ub_;
   datalines;
x1 0 5
x2 0 5
;
proc fcmp outlib=sasuser.myfuncs.mypkg;
   function fdef1(x1, x2);
      return ((x1-1)**2 + (x1-x2)**2);
   endsub;

   function fdef2(x1, x2);
      return ((x1-x2)**2 + (x2-3)**2);
   endsub;
run;

data objdata;
   input _id_ $ _function_ $ _sense_ $;
   datalines;
f1 fdef1 min
f2 fdef2 min
;
options cmplib = sasuser.myfuncs;
proc optlso
   primalout = solution
   variables = vardata
   objective = objdata
   logfreq = 50
;
run;

proc transpose data=solution out=pareto label=_sol_ name=_sol_;
   by _sol_;
   var _value_;
   id _id_;
run;

proc gplot data=pareto;
   plot f2*f1;
run;

quit;

Output 3.10.1 shows the ODS tables that are produced.

Output 3.10.1: Multiobjective: ODS Tables

The OPTLSO Procedure

Performance Information
Execution Mode Single-Machine
Number of Threads 4

Problem Summary
Problem Type NLP
   
Objective Definition Set OBJDATA
Variables VARDATA
   
Number of Variables 2
Integer Variables 0
Continuous Variables 2
   
Number of Constraints 0
Linear Constraints 0
Nonlinear Constraints 0
   
Objective Definition Source OBJDATA
Objective Sense Minimize

Solution Summary
Solution Status Function convergence
Nondominated 4425
Progress 1.5319498E-6
Infeasibility 0
Iterations 346
Evaluations 18800
Cached Evaluations 129
Global Searches 1
Population Size 80
Seed 1


Output 3.10.2 shows the iteration log.

Output 3.10.2: Multiobjective: Log

 
 
NOTE: The OPTLSO procedure is executing in single-machine mode.                 
NOTE: The OPTLSO algorithm is using up to 4 threads.                            
NOTE: The problem has 2 variables (0 integer, 2 continuous).                    
NOTE: The problem has 0 constraints (0 linear, 0 nonlinear).                    
NOTE: The problem has 2 FCMP function definitions.                              
NOTE: The deterministic parallel mode is enabled.                               
        Iteration    Nondom        Progress    Infeasibility    Evals     Time  
                1         7               .                0       84        0  
               51       880     0.000088236                0     2934        0  
              101      1724     0.000018425                0     5827        1  
              151      2382     0.000009200                0     8526        1  
              201      3029     0.000003216                0    11185        2  
              251      3512     0.000050433                0    13842        3  
              301      3955     0.000001423                0    16432        4  
              346      4425     0.000001532                0    18800        5  
NOTE: Function convergence criteria reached.                                    
NOTE: There were 2 observations read from the data set WORK.VARDATA.            
NOTE: There were 2 observations read from the data set WORK.OBJDATA.            
NOTE: The data set WORK.SOLUTION has 22125 observations and 3 variables.        
 
 


When solving a multiobjective problem with 2 objectives, it can be useful to create a plot with PROC GPLOT of the Pareto-optimal set returned by PROC OPTLSO.

Output 3.10.3 shows a plot of the Pareto-optimal set found by PROC OPTLSO.

Output 3.10.3: Multiobjective: Plot of Pareto-optimal Set