Hi,

I need a help. I need to solve my problem by using CPLEX. My objective function is nonlinear function where in some formulation, there have a division of decision variable. I know CPLEX can not solve nonlinear programming, so I used 'using Cp;' in my file.mod to solve it. It can be solved but unfortunately, the solution given is not an optimal solution. There are some errors in the solution given. Can anybody help me how to solve this problem? Can be any other ways to solve this in order to get exact solution? Here I attach my coding for file.mod. Thank you.

using CP;

int scale=1000;

{string} depot=...;

{string} customer=...;

{string} vehicle=...;

{string} node=...;

int N=card(customer);

int pr=...;

float dist[node][node]=...;

float fcost[depot]=...;

float D[customer]=...;

float R[customer]=...;

float VC[vehicle]=...;

float VD[depot]=...;

dvar boolean x[node][node][vehicle];

dvar boolean z[depot];

dvar boolean y[depot][customer];

//dvar float+ u[customer][vehicle];

dvar int u[customer][vehicle];

dvar int scaleQ[i in depot] in 0..240000;

dexpr float Q[i in depot]=scaleQ[i]/scale;

dexpr float facility=sum(i in node, j in node:j!=i, k in vehicle)x[i][j][k]*dist[i][j];

dexpr float travel=sum(i in depot)fcost[i]*z[i];

dexpr float setup=17*sum(i in depot, j in customer)(D[j]-R[j])*y[i][j]/Q[i];

dexpr float holdinginventory=(1/pr)*sum(i in depot)(Q[i]*pr - Q[i]*sum(j in customer)(D[j]+R[j])*y[i][j]);

dexpr float cost=travel + facility + setup + holdinginventory;

minimize cost;

subject to {

forall(j in customer) sum(i in node, k in vehicle)x[i][j][k]==1;

forall(k in vehicle) sum(i in depot, j in customer)x[i][j][k]<=1;

forall(k in vehicle) sum(i in node, j in customer:j!=i)D[j]*x[i][j][k]<=VC[k];

forall(i in node, k in vehicle) (sum(j in node)x[i][j][k])- (sum(j in node)x[j][i][k])==0;

forall(i in depot) sum(j in customer)D[j]*y[i][j]<=VD[i]*z[i];

forall(j in customer) sum(i in depot)y[i][j]==1;

forall(l in customer, j in customer, k in vehicle) u[l][k]-u[j][k]+N*x[l][j][k]<= N-1;

forall(i in depot, j in customer, k in vehicle) (sum(h in node)(x[i][h][k]+x[h][j][k]))-y[i][j]<=1;

}

------------------------------

Farahanim Misni

------------------------------