Query the Results

If the solve method succeeded in finding a solution, you will then want to access that solution. The objective value of that solution can be queried using method:

    double objval = cplex.getObjValue();

Similarly, solution values for all the variables in the array x can be queried by calling:

    double[] xval = cplex.getValues(x);

More solution information can be queried from IloCplex, including slacks and, depending on the algorithm that was applied for solving the model, duals, reduced cost information, and basis information.


Previous Page: Solve the Model  Return to Top Next Page: Building and Solving a Small LP Model in Java