The OPTGRAPH Procedure

Matrix Input Data

This section describes the matrix input format that you can use with some of the algorithms in PROC OPTGRAPH. The DATA_MATRIX= option in the PROC OPTGRAPH statement defines the data set that contains the matrix values. You can specify any values that you want for the data set variable names (the columns) by using the DATA_MATRIX_VAR statement, as described in the section DATA_MATRIX_VAR Statement. If you do not specify any names, then PROC OPTGRAPH assumes that all numeric variables in the data set are to be used in defining the matrix.

The following statements find the principal eigenvector of the square symmetric matrix that is defined in the data set Matrix:

data Matrix;
   input col1-col5;
   datalines;
1 0 2 6 1
0 2 3 0 1
2 3 1 0 2
6 0 0 0 0
1 1 2 0 0
;
proc optgraph
   data_matrix    = Matrix;
   eigenvector
      eigenvalues = LA
      nEigen      = 1
      out         = EigenVector;
run;

The following statements solve the linear assignment problem for the cost matrix that is defined in the data set CostMatrix:

data CostMatrix;
   input back breast fly free;
   datalines;
35.1 36.7 28.3 36.1
34.6 32.6 26.9 26.2
31.3 33.9 27.1 31.2
28.6 34.1 29.1 30.3
32.9 32.2 26.6 24.0
27.8 32.5 27.8 27.0
26.3 27.6 23.5 22.4
29.0 24.0 27.9 25.4
27.2 33.8 25.2 24.1
27.0 29.2 23.0 21.9
;
proc optgraph
   data_matrix = CostMatrix;
   data_matrix_var
      back--free;
   linear_assignment
      out      = LinearAssign;
run;