Originally posted by: BCDS_Daniel_Underwood
Suppose a file named myProblem.mod exists with the following contents:
range N = 1..4;
int c[N][N]= [[99999, 7, 6, 3],
[3, 99999, 6, 9],
[2, 3, 99999, 1],
[7, 9, 4, 99999]];
dvar boolean x[N][N];
minimize sum(i in N) sum(j in N) c[i][j]*x[i][j];
subject to {
forall(i in N) sum(j in N) x[i][j]==1;
forall(j in N) sum(i in N) x[i][j]==1;
}
To solve the model, I enter the following at the command line:
$ oplrun myProblem.mod
This solves my model and displays, among other information, the optimal objective value. However, this does
not display the optimal solution. How can I modify the above command, or the code inside myProblem.mod, such that the optimal solution (the optimal values of the decision variables) is also displayed on the screen (standard output)?
#DecisionOptimization#OPLusingCPLEXOptimizer