# ---------------------------------------- # PROBLEMA TRANSPORTE Y LOCALIZACION # ---------------------------------------- set ORIG; # origenes (warehouses) set DEST; # destinos (stores) param supply {ORIG} ; param demand {DEST} ; param fix_cost {ORIG}; param var_cost {ORIG,DEST}; param unmet_cost {DEST} default 150; var Build {ORIG} binary; # 1 si se usa y 0 sino var Ship {ORIG,DEST} >= 0; # cantidades enviadas var Unmet {DEST} >= 0; # cantidades no satisfecha minimize Costo_Total: sum {i in ORIG} fix_cost[i] * Build[i] + sum {j in DEST} unmet_cost[j]*Unmet[j] + sum {i in ORIG, j in DEST} var_cost[i,j] * Ship[i,j] ; subject to OFERTAS {i in ORIG}: sum {j in DEST} Ship[i,j] <= supply[i] * Build[i]; subject to DEMANDAS {j in DEST}: sum {i in ORIG} Ship[i,j] + Unmet[j]= demand[j];