MCLP problem

75 views
Skip to first unread message

Juan Andres Monsalve Medina

unread,
Dec 19, 2016, 12:24:39 PM12/19/16
to AMPL Modeling Language
I need help about a maximal covering location problem using ampl cplex. The answer using my program is 0 in Binary, but it's not correct. The problem search the maximal numbers of servers to install in a places, subjet to maximun numbers of servers and maximun distance from the server to client. 

#CONJUNTOS
set I; #conjunto de nodos demanda
set J; #conjunto de nodos candidatos a instalar estatuas

#PARAMETROS
param Dij{I,J} >=0 ; #distancia minima desde el nodo demanda i a la ubicación de la estatua candidata en j
param Dmax >=0 ; #distancia maxima aceptable de un nodo demanda a una estatua
param Hi{I} >=0 ; #Demanda nodo i-esimo
param P >=0; #maximo de servidores a instalar 

#VARIABLES

var Xj{J} binary; #1 si se instala la estatua en j.
var Yi{I} binary; #1 si el nodo i esta cubierto.

#FUNCIÓN OBJETIVO

maximize COBERTURA: sum{i in I} Hi[i]*Yi[i];

#RESTRICCIONES

subject to R1 {i in I}: 
sum{j in J} Xj[j] >= Yi[i] ; #nodo dda no puede estar cubierto a menos que exista un servidor en i
subject to R2{i in I}:
sum{j in J: Dij[i,j] <= Dmax} Xj[j] >=1  ; #distancia entre nodo dda y nodo candidato debe ser menor que distancia maxima
subject to R3 :
sum{j in J} Xj[j] <= P ; #maxima cantidad de estatuas disponibles
#Restricciones de no negatividad incluidas en la definición de variables.

Robert Fourer

unread,
Dec 21, 2016, 1:46:28 AM12/21/16
to am...@googlegroups.com
Did you get an "optimal solution" message from the solver? If not, the solver message may indicate that your problem is infeasible, in which case the solver will not return a solution to AMPL, and the variables will remain at zero. You will need to study the model and data to determine why no feasible solution is possible.

If you did get an "optimal solution" message then it does seem that at least one of the Yi[i] variables should be 1. In that case, to get more help you should also post the data file that you used.

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages