Hello everyone!
I have values as integer array x[i][j], y[i].
These values are obtained using a heuristic algorithm now, I want to pass these values to CPLEX as start solution using these values.
I using addMIPStart() method for this.After reading the related problem https://www.or-exchange.org/questions/8191/addmipstart-problem,I learn about some information ,but there still some errors.
My approach is as:
I defined
IloIntArray tstart(env);
IloIntArray2 xstart(env);
IloIntArray xstartyiwei(env);//Turn 2D xstart to 1D xstartyiwei
and similarly
IIloArray<iloboolvararray> X(env, TotalNode);
IloNumVarArray Xyiwei(env, TotalNode*TotalNode, 0, 1) ////Turn 2D X to 1D Xyiwei
IloIntVarArray t(env, TotalNode, 0, Tteam);
(and also defined memory for both of these arrays).
Then I stored the values of x[i][j], y[i] in xstart(env),tstart(env)
Now I am calling addMipStart as follows:
cplex.exportModel("model.lp");
IloNumVarArray startVar(env);
IloNumArray startVal(env);
for (int i = 0; i < TotalNode*TotalNode; i++)
{
startVar.add(Xyiwei[i]);
startVal.add(xstartyiwei[i]);

```
}
for (int i = 0; i < TotalNode; i++)
{
startVar.add(t[i]);
startVal.add(tstart[i]);
}
IloCplex::MIPStartEffort effort = IloCplex::MIPStartEffort::MIPStartAuto;
cplex.addMIPStart(startVar, startVal, effort, "startsolusion.mst");
cplex.readMIPStarts("startsolusion.mst");
cplex.solve();
startVal.end();
startVar.end();
when it turn to the statement"cplex.addMIPStart(startVar, startVal, effort, "startsolusion.mst"); ",it gives me the error"Error: IloExtractable 1 IloNumVarI has not been extracted by IloAlgorithm 0000028CD910E0D0";But if I Comment out this statement：
```

"for (int i = 0; i < TotalNode*TotalNode; i++)
{
startVar.add(Xyiwei[i]);
startVal.add(xstartyiwei[i]);

```
}"
there are not the error.
However,another error will be when it turns to "cplex.readMIPStarts("startsolusion.mst");"
Actually,there are not a startsolusion.mst file accur after the ststement "cplex.addMIPStart(startVar, startVal, effort, "startsolusion.mst");"
So,I think the last two parameters "effort",and "startsolusion.mst" in "cplex.addMIPStart(startVar, startVal, effort, "startsolusion.mst");" are not true.
My English is poor,please bear with me.I want to learn more about cplex.readMIPStarts.
```