Originally posted by: SystemAdmin
Yes, you can use the same indices into the arrays returned by CPXgetx() and CPXgetcolname(). Provided, of course, that you specified the same ranges of indices to the two functions.
To access solutions other than the optimal ones note that CPLEX also stores feasible solution it finds as MIP starts. Consequently, you can access some of the solutions that CPLEX found using the MIP start interface after the solution process terminates.
You may also want to look at the solution pool feature (see the user's or reference manual) that is explicitly designed to collect solutions during the solve. It allows you fine-grained control about the solutions you want to collect etc.
#CPLEXOptimizers#DecisionOptimization