Sei sulla pagina 1di 13

Computers & Operations Research 35 (2008) 404 416

www.elsevier.com/locate/cor

A neural model for the p-median problem


Enrique Domnguez , Jos Muoz
Department of Computer Science, University of Malaga,Campus Teatinos s/n, 29071 Malaga, Spain
Available online 18 May 2006

Abstract
There exist several neural techniques for solving NP-hard combinatorial optimization problems. At the beginning of the 1980s,
recurrent neural networks were shown to be able to solve optimization problems. Criticism of this approach includes the tendency
of recurrent neural networks to produce infeasible solutions and poor local minima. This paper proposes a new technique which
always provides feasible solutions and removes the tuning phase since the constraints are incorporated in the neural architecture
instead of the energy function, therefore the tuning parameters are unnecessary.
One of the most popular and well-known facility location problems is the p-median problem, which concerns the location of p
facilities (or medians) in order to minimize the total weighted distance between the demand points and the facilities. There exist
several heuristics to nd optimal solutions of the problem based on the traditional formulation.
In this paper a new formulation for the p-median problem based on two types of decision variables and with only n + p linear equality constraints is presented, where n is the number of demand points or customers and p is the number of facilities
(medians). Also, a competitive recurrent neural network is proposed for this problem. The neural network consists of two layers
(allocation layer and location layer) with 2np process units. The process units constitute n + p groups, where only one process unit per group is active at the same time and process units of the same layer are updated in parallel. Moreover, the energy
function (objective function) always decreases or remains constant as the system evolves according to the dynamical rule proposed. The effectiveness and efciency of our algorithm for different problem sizes are analyzed in comparison to conventional
heuristic methods. The results show that our recurrent neural network generates good solutions with a reasonable computational
effort.
Scope and purpose
Geographical information systems (GIS) have occupied the attention of many researches involving a number of academic elds
including geography, civil engineering, computer science, land use planning, and environmental sciences. GIS can support a wide
range of spatial queries that can be used to support location studies. Model application and model development are the major impact
of GIS on the eld of location science. These systems are designed to store, retrieve, manipulate, analyze, and map geographical
data. GIS can serve as the source of input data for a location model and it can also be used to present the model results. For example,
if a p-median problem has to be solved, then a GIS executes a heuristic algorithm that reads the data from the GIS and it presents
the results in real time.
Locationallocation models simultaneously locate facilities and allocate demand points to them. These models also arise in a variety
of public and private sector problems. The p-median is the most widely used locationallocation model. The p-median model is NPhard and its data set became very large in real problem, so heuristic solutions are required.As the size of the data set grow, the number of
feasible solutions grows and the quality of solutions and computation times from the most commonly used heuristic are deteriorated.
The purpose of this paper is to develop a neural model to be integrated in GIS software. Thus, we propose a new formulation for the

Corresponding author.

E-mail address: enriqued@lcc.uma.es (E. Domnguez).


0305-0548/$ - see front matter 2006 Elsevier Ltd. All rights reserved.
doi:10.1016/j.cor.2006.03.005

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

405

p-median problem based on 2np binary variables and n + p equality linear constraints. A recurrent neural model is proposed for
solving the p-median problem based on this formulation without the difculty in selecting appropriate tuning parameters, since these
parameters are avoided. Moreover, an np-parallel algorithm has been developed based on this formulation. The central property
of this algorithm is that the objective function always decreases (or remains constant) as the algorithm evolves according to its
dynamical rule. Moreover, this algorithm can be also implemented using optical or VLSI technology.
2006 Elsevier Ltd. All rights reserved.
Keywords: Location; p-Median; Clustering; Recurrent neural network

1. Introduction
The traditional location problem is concerned the location of one or more facilities in some solution space so as to
optimize some specied criteria. One of the most popular problems in the facility location literature is the p-median
problem. This problem concerns the location of p facilities (medians) in order to minimize a weighted sum of the
distance from each node (population center or customer) to its nearest facility [1,2]. Transportation costs are assumed
to be linear functions of the distance between the facility and the population centers or customers.
Kariv and Hakimi [3] showed that the p-median problem on a general network is NP-hard. Thus, a lot of heuristic
solution techniques have been developed in an effort to solve large-scale problems to near-optimality with a reasonable
computational effort. Most of the proposed procedures have been based on mathematical programming relaxation and
branch-and-bound techniques. However, new procedures have been developed recently based on tabu search, genetic
algorithms and neural networks. Thus, some proposed procedures include tree search [4,5], lagrangian relaxation
coupled with branch-and-bound [68], as well as heuristic and decision techniques [911] and tabu search [12]. Other
proposed techniques more recent include heuristic concentration [13], variable neighborhood search [14] and genetic
algorithms [15].
Articial neural networks are viable computational models for a wide variety of problems. These include pattern
classication, speech synthesis and recognition, adaptive interfaces between humans and complex physical systems,
functional approximation, image compression, associative memory, clustering, forecasting and prediction, combinatorial optimization, nonlinear system modelling, and control.
The articial neuron is the basic processing unit of a neural network. The activation values (output) of a binary
articial neuron are 1 (ring) and 0 (no ring). A recurrent neural network consists of N articial neurons, a set of
synapses or connecting links, each of which is characterized by a weight or strength, and a set of threshold values. The
activation value of the neuron i at time t + 1 is given by expression

N


wij xj (t)i ,
1 if
xi (t + 1) =
(1)
j =1

0 otherwise,
where wij is the weight of the connection between neurons i and neuron j, xj (t) is the output (activation value) of
the neuron j at time t, and i is the threshold value of the neuron i. Note that the expression (1) corresponds to a
linear threshold gate. Hopeld [16] introduced the idea of an energy function into neural network theory. The energy
function is

1 
wij xi (t)xj (t) +
i xi (t).
2
N

E(t) =

i=1 j =1

(2)

i=1

The main property of an energy function is that it always decreases (or remains constant) as the system evolve
according to its dynamical rule (1). The term energy function comes from a physical analogy to magnetic systems. The
most general name, from the theory of dynamical systems, is Lyapunov function.
Hopeld and Tank [17] proposed a recurrent neural network for solving optimization problems using an analogy
between the networks energy function and a cost function to be minimized. The main task of the neural network
developer is to translate the problem-specic cost function into a quadratic form, from which network weights can

406

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

be extracted. An appropriate representation must be developed, relating problem parameters to neuron output values.
After the weights are determined, the neurons are initialized with values chosen randomly.
Although the recurrent neural networks implement a gradient descent method they should not be viewed as naive gradient descent machines, but as an ensemble of interconnected processing units with simple computational requirements
that can implement complex computation (inspired in many natural phenomena). Thus, the true advantage of using recurrent neural networks to solve difcult optimization problems relates to speed considerations. Due to their inherently
parallel structure and simple computational requirements, neural network techniques are especially suitable for direct
hardware implementation, using analog or digital integrated circuits [8,18]. Moreover, they can be implemented very
easily using optical computers [1].
In this paper we present a new formulation for the p-median problem and propose a recurrent neural network model to
solve it. The problems associated with the recurrent neural networks as Hopeld neural network include the tendency
of the energy function to settle in poor local minima, often one that does not represent a feasible solution to the
optimization problem, and the difculty in selecting appropriate parameters in the energy function. Many researchers
have tried to optimally select these parameters [19], while others have focused their attention on reducing the number of
terms in the energy function. In this work, we propose a new recurrent neural network which always provides feasible
solutions and removes the tuning phase since the constraints are incorporated in the neural architecture instead of the
energy function and so tuning parameters are not necessary. The effectiveness and efciency of these algorithms under
varying problem sizes are analyzed.
The rest of this paper is organized as follows: Section 2 describes the problem and a new formulation is presented with a preliminary analysis. Section 3 shows how to apply a simple recurrent neural network to this problem.
Section 4 contains illustrative and comparative simulation results. Finally, Section 5 provides a summary and
conclusions.
2. Problem formulation
The p-median problem is a well-known problem that has been studied during years. This problem is concerned with
the location of p facilities (medians) in order to minimize the total weighted distance between the facilities and the
demand points (population centers or customers). ReVelle and Swain [20] provided an integer programming formulation
for the discrete p-median problem, which is given below.
Minimize

Subject to

n
n 


dij xij .

i=1 j =1
n


xij = 1,

j =1
n


(3)
i = 1, . . . , n,

xjj = p,

(4)

(5)

j =1

xij xjj ,

i = 1, . . . , n, j = 1, . . . , n,

(6)

where n is the considered number of demand points, p the number of facilities or medians, dij the distance (cost)
between the demand point i and the facility j,

1 if i is assigned to the facility j,
xij =
0 otherwise,

1 if the demand point j is a facility,
xjj =
0 otherwise.
Restrictions (4) prevent a demand point i from being free, i.e. having not assigned facility. Constraints (5) establish
the number of facilities or medians. The last conditions (6) assure the coherence of the solutions, that is, a demand
point i cannot be assigned to the facility j (xij = 1), which is not established as facility (xjj = 0).
This model is an integer linear programming problem and can be solved by general purpose linear/integer programming software, usually linear programming with branch-and-bound. But the above model has n2 variables and n2 + 1

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

407

constraints, and can become relatively unwieldy in size, even for modest sized networks. Although this limitation has
been raised over time as optimization software have become faster and capable of solving larger problems, this still
remains a drawback in using the original formulation. Due to this disadvantage, researchers have explored new solution
approaches as heuristics, Lagrangian relaxation and dual ascent procedures, hybrids, and model reformulations.
In this paper a new reduced formulation to the p-median problem is proposed. The new reduced model has 2np binary
variables and n + p constraints, and can become relatively simpler than the above model. The proposed model is a
binary quadratic programming problem and, evidently, cannot be solved by general purpose linear/integer programming
software. However we think that this limitation is not problematic, since numerous modern heuristics (e.g. genetic
algorithms, neural networks, tabu search, path relinking, scatter search, ant colony, etc.) have been proposed for
solving several nonlinear optimization problems.
The proposed model [21] is based on two variable types, allocation variables and location variables, and is given
below.
Minimize

Subject to

p
n 
n 


dij xiq yj q .

i=1 j =1 q=1
p

q=1
n


(7)

xiq = 1,

i = 1, . . . , n,

(8)

yj q = 1,

q = 1, . . . , p,

(9)

j =1

where n is the number of points, customers or population centers, p the number of facilities (medians) to locate, dij the
distance between the point i and the facility j,

1 if i is assigned to the cluster q,
xiq =
0 otherwise,

1 ifj is the center of the cluster q,
yj q =
0 otherwise.
We have two types of variables (neurons): xiq are the allocation variables and yj q are the location variables. Note
that the constraints have a certain aesthetic simplicity; by the restrictions (8) we only allow that each demand point is
assigned to an only cluster, and by the conditions (9) we guarantee that there is exactly one facility or median in each
cluster. The above formulation is a relaxed formulation to the p-median problem in that it does not assure that the p
selected medians are different. However, it leads to an optimal solution of the p-median problem.
Denition 1. Two optimization problems P1 and P2 are equivalent (P1 P2 ) if and only if P1 and P2 have the same
optimal solutions.
Now, we show that the above formulations are equivalent.
Proposition 2. The minimization problem (7)(9) is equivalent to the p-median problem (3)-(6).
Proof. The constraints (8) assign each demand point only to an cluster and the restrictions (9) guarantee that there is
only one facility (median) in each cluster. However, a median could be assigned to several clusters, and the number of
elements of the
set of medians, C, would be less than the number of facilities to locate (|C| < p).
p
Let C = {j : r=1 yj r = 1} be the solution set of medians. Suppose that |C| = p k where 0 < k < p. Due to p < n,
at least there exist k points (e.g. P1 , P2 , . . . , Pk ) that are not facilities. Then xiq i = 1 and yji qi = 1 where i
/ C, i  = ji ,
i = 1, 2, . . . , k and
p
n 

j =1 q=1

dij xiq yj q = dij > 0,

i = 1, 2, . . . , k.

408

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

If k new medians are aggregated in the solution according to the expressions


xic = 1,

yic = 1,

xiq i = 0,

yji qi = 0,

i = 1, 2, . . . , k, where c = p k + i

then a new solution is obtained with


p
n 


dij xiq yj q = 0,

i = 1, 2, . . . , k.

j =1 q=1

Hence, the initial solution of length p k is not optimal.

3. Competitive recurrent neural model


3.1. Architecture
The more popular approach to using neural networks for optimization is to formulate a combinatorial optimization
problem in terms of minimizing a cost or energy function. So, some neural network models have been developed or
interpreted as minimization machines [17,22,23]. Before using a network to solve a problem, one must express the
problem as a mathematical function that is to be minimized.
In order to design a suitable neural network for this problem, the key step is to construct an appropriate energy function
E for which any global minimum is an optimal solution of the p-median problem according to above formulation
(7)(9). The simplest approach to construct a desired energy function is the penalty function method. The basic idea
in this approach is to transform the constrained problem into an unconstrained one by adding penalty function terms
to the objective function (7). These terms cause a high cost if any constraint is violated. More precisely, increasing the
objective function by a quantity that depends on the amount by which the constraints are violated eliminates some or
all constraints. That is, the energy function of the neural network is given by the Lyapunov energy function dened as

E=

p
n 
n 

i=1 j =1 q=1

dij xiq yj q + 1

n

i=1

p

q=1

2
xiq + 2

p

q=1

n


2
yj q ,

(10)

j =1

where i > 0 are penalty parameters that they determine the relative weight of the constraints. The penalty parameters
tuning is an important problem associated with this approach.
In this paper, the n + p restrictions (8) and (9) are incorporated in the architecture of the neural network and so, the
energy function is reduced to expression (7). In this way, the neural network does not include any tuning parameter.
For a given initial state, the neural network will converge to a stable state and the stable states generated by the network
will be local minima of the problem. In each step, the network evolves to a better solution until to a local minimum of
the problem is reached.
The proposed neural network consists of two layers of np interconnected binary neurons or processing elements. The
connecting link between neuron i and j has associated a synaptic weight wij . Each neuron i presents an output binary
state. This state depends of its activation potential hi , which it is a weighted linear combination of the output states of
other neurons. Therefore, the new state of neuron i depends on the state of all neurons.
In order to guarantee a valid solution and avoid the parameter tuning problem, we will organize our neural network in
disjoint groups according to the two types of restrictions, that is, for the p-median problem with n points, we will have
n groups, according to constraints (8), and p groups, according to restrictions (9). In each group only one neuron can be
activated at the same time (the winner neuron). Thus, we avoid the parameter-tuning problem, since the restrictions are
incorporated in the neural architecture. Note that any state of the network is a valid solution of the problem. Therefore,
we will reorganize our neurons in two layers (one layer per neuron type) where a group is represented by a row or
column of the layer according to neuron type.
Fig. 1 shows two matrices, the rst matrix contains the states of the allocation neurons and the second contains the
states of the location neurons. The allocation neurons inside same group are in the same row of the matrix, and the
location neurons inside same group are in the same column.

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

409

Fig. 1. Neural organization for the p-median problem with n demand points.

In this model exactly one neuron per group is activated (ring), so the penalty terms are removed from the objective
function, since the constraints are incorporated in the neural architecture. In this way, the energy function of the neural
network is reduced to
E=

p
n 
n 


dij xiq yj q .

(11)

i=1 j =1 q=1

The output state of a neuron depends on its activation potential, which is given by the following expressions
hxiq (k) =

n


dij yj q (k),

(12)

dij xiq (k),

(13)

j =1

hyj q (k) =

n

i=1

where k denotes the time, hxiq is the activation potential of allocation neuron iq, that is, the negative distance between
the point i and the median of cluster q. And hyj q is the activation potential of the location neuron jq, that is, the total
negative distance between the median j and all points of cluster q.
3.2. Computational dynamics
Neuron states are updated according to the dynamical rules of neural network. The next state (at time k + 1) of a
neuron depends on its current activation potential (at time k) and it is dened by the following expressions

1 if hxiq (k) = max {hxj q (k)},
1j n
xiq (k + 1) =
(14)
0 otherwise,

1 if hyj q (k) = max {hyiq (k)},
1i n
yj q (k + 1) =
(15)
0 otherwise.
Observe that exactly one neuron of the same group can be activated. The main property of the proposed network is
that the computational energy function (11) always decrease (or remains constant) as the network evolve according to
its computational dynamics (14) and (15). Note that, the neuron xiq will be activated if the median of group q is the
nearest median to the demand point i. And the neuron yj q will be activated when the point j is the median of cluster q.
Two different computational dynamics (group-parallel or layer-parallel) are dened in the neural model according
to the parallelism level. Both group- and layer-parallel computational dynamics are based on the above expressions

410

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

(14) and (15). Group-parallel computational dynamics consists of an update on group at a same time, and layer-parallel
dynamics consist of the layer update at a same time, i.e. updating all competitive groups in the same layer at a same
time.
Theorem 3 (Layer-parallel dynamics). Let M be a binary neural network characterized by a Lyapunov energy function
(11) where the activation potential of the neurons are computed by (12) and (13). The energy function E decreases
when each layer is updated according to the computational dynamics of the neural network given by expressions (14)
and (15).
Proof. See Appendix A.
Theorem 4 (Group-parallel dynamics). Let M be a binary neural network characterized by a Lyapunov energy function
(11) where the activation potential of the neurons are computed by (12) and (13). The energy function E decreases when
each competitive group is updated according to the computational dynamics of the neural network given by expressions
(14) and (15).
Proof. Similar to the proof of the above theorem.

3.3. Neural algorithms


This subsection describes a neural algorithm based on the group-parallel dynamics (NA-G), and other one based on
the layer-parallel dynamics (NA-L). The following scheme points up the proposed neural algorithms.
(i) [BOTH] Set the initial state by randomly selecting a neuron (winner neuron) in each of n + p groups to be one
and all the others neurons in the group to be zero.
(ii) [BOTH] Evaluate the energy function (11).
(iii) [NA-L] Select the allocation or location layer to be updated. [NA-G] Select a competitive group to be updated.
(iv) [BOTH] Determine the activation potential of the neurons in the selected layer/group by expression (12) or (13)
depending on the neuron type (allocation or location neuron, respectively).
(v) [BOTH] Update neurons by expression (14) or (15) depending on the neuron type.
(vi) [BOTH] Repeat from step (iii) until no more changes.
On step (v), if there are different neurons with the maximum input value, the algorithm must randomly select one of
them.
It is clear that the proposed algorithms pursue an allocationlocation strategy similar as the alternating algorithm
[24]. In fact, all solutions produced by both NA-G and NA-L procedures exhibit the following properties which are
necessary, but not sufcient for an optimum solution:
All facilities are local medians for the demand points allocated to them.
All demand points are allocated to their closest facility.
It is well-known that the interchange algorithm proposed by Teitz and Bart [11] produce better results than the
alternating algorithm, since the interchange algorithm ensures a third property:
Removing a facility from the solution and replacing it with a candidate facility always involves an increase in the
value of the objective function.
Our goal was to construct a new heuristic based on the proposed model that would perform as well as the modern
heuristics, but which would require far less computation, especially for large problems. Due to the choice of the initial
solution is very important for the proposed algorithms, both NA-G and NA-L were improved generating good initial
solutions. Our empirical analysis showed that some scatter facilities were a good initial solution for the proposed
algorithms. In this sense, the proposed algorithms were improved modifying the rst step for selecting a good initial

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

411

solution. The following procedure describe the proposed improved neural algorithm (NA-L+ ).
(i) Set the initial state by selecting p neurons (facilities) within the location layer in order to maximize their dispersion,
and selecting the others n neurons from allocation layer to their nearest facility.
(ii) Evaluate the energy function (11).
(iii) Select the allocation or location layer to be updated.
(iv) Determine the activation potential of the neurons in the selected layer by expression (12) or (13) depending on
the neuron type (allocation or location neuron, respectively).
(v) Update neurons by expression (14) or (15) depending on the neuron type.
(vi) Repeat from step (iii) until no more changes.
The above procedure is repeated several times selecting the best solution found, since this procedure requires a
minimal computational time.
4. Experimental results
This section presents the results obtained by the proposed algorithms. All computational results described in this
section are produced by a Matlab code on a conventional Pentium IV 2.4 GHz computer with 512 Mb. We solved 40
p-medians problems with known optimal solutions in the OR Library [25] to test the performance of our algorithms.
We rst compared the proposed neural algorithms (NA-G, NA-L and NA-L+ ) on 10 ORLIB test problems, where
the problem parameters range from instances with n = 100, 200 and p = 5, 10, 20, 33, 67. Table 1 gives the results
of comparing the proposed neural algorithms with group-parallel dynamics (NA-G) and with layer-parallel dynamics
(NA-L and NA-L+ ). Note that the computational results have been produced on a conventional computer with only
one processor, thereby the CPU time shown in columns 79 can become less in a neurocomputer. The % error of the
two methods are reported in columns 1012 and calculated as
f fopt
100,
fopt

(16)

where f denotes the best solution found by the algorithm and fopt is the optimum value of the objective function.
It appears that NA-L improves the quality of solution obtained by NA-G. Moreover, we conclude that not only the
difference of solution quality between NA-L and NA-G, but also NA-L causes a big difference in CPU time.
The choice of initial solution is very important for the proposed neural algorithms. Table 1 shows the results obtained
by the proposed neural algorithm for two different strategies of selecting the initial solution. A randomly strategy (NA-G
and NA-L) to construct an initial solution provides a poor performance like as the alternating algorithm. However, a
scattering strategy (NA-L+ ) improves the method notably with a signicant increase of CPU time.

Table 1
Comparison of the proposed neural algorithms (NA-G, NA-L and NA-L+ ) for 10 ORLIB test problems
Problem

pmed1
pmed2
pmed3
pmed4
pmed5
pmed6
pmed7
pmed8
pmed9
pmed10

(n, p)

(100, 5)
(100, 10)
(100, 10)
(100, 20)
(100, 33)
(200, 5)
(200, 10)
(200, 20)
(200, 40)
(200, 67)

Optimum

5819
4093
4250
3034
1355
7824
5631
4445
2734
1255

Objective function

Time (s)

NA-G

NA-L

NA-L+

5821
4300
4276
3205
1633
7867
5862
4955
3179
1840

5819
4248
4278
3238
1570
7995
5819
4928
3096
1597

5819
4093
4250
3034
1355
7824
5631
4445
2747
1270

NA-G
0.84
1.61
0.84
2.91
1.67
1.56
3.05
4.21
7.96
9.71

% Error
NA-L

NA-L+

NA-G

NA-L

NA-L+

0.01
0.01
0.01
0.02
0.02
0.01
0.02
0.02
0.05
0.05

0.27
1.86
0.83
21.37
27.46
2.10
7.37
77.50
120.89
167.07

0.03
5.06
0.61
5.64
20.52
0.55
4.10
11.47
16.28
46.61

0.00
3.79
0.66
6.72
15.87
2.19
3.34
10.87
13.24
27.25

0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.48
1.20

412

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

Table 2
NA-L+ and VNS performances for ORLIB test problems
Problem

pmed4
pmed5
pmed7
pmed8
pmed9
pmed10
pmed11
pmed14
pmed15
pmed17
pmed18
pmed19
pmed20
pmed23
pmed24
pmed25
pmed27
pmed28
pmed29
pmed30
pmed33
pmed34
pmed37
pmed40

(n, p)

(100, 20)
(100, 33)
(200, 10)
(200, 20)
(200, 40)
(200, 67)
(300, 5)
(300, 60)
(300, 100)
(400, 10)
(400, 40)
(400, 80)
(400, 133)
(500, 50)
(500, 100)
(500, 167)
(600, 10)
(600, 60)
(600, 120)
(600, 200)
(700, 70)
(700, 140)
(800, 80)
(900, 90)

Optimum

3034
1355
5631
4445
2734
1255
7696
2968
1729
6999
4809
2845
1789
4619
2961
1828
8307
4498
3033
1989
4700
3013
5057
5128

Objective function

% Error

NA-L+

VNS

NA-L+

CPU time (s)


VNS

NA-L+

VNS

3038
1359
5631
4448
2751
1264
7696
2983
1751
6999
4811
2863
1815
4624
2986
1865
8307
4508
3060
2016
4706
3038
5071
5155

3038
1363
5639
4445
2750
1385
7723
3332
2442
7003
4876
3432
2725
4954
3944
2922
8310
4898
4137
2970
5290
4070
5875
6243

0.13
0.30
0.00
0.07
0.62
0.72
0.00
0.51
1.27
0.00
0.04
0.63
1.45
0.11
0.84
2.02
0.00
0.22
0.89
1.36
0.13
0.83
0.28
0.53

0.13
0.59
0.14
0.00
0.59
10.36
0.35
12.26
41.24
0.06
1.39
20.63
52.32
7.25
33.20
59.85
0.04
8.89
36.40
49.32
12.55
35.08
16.18
21.74

21.37
27.46
7.37
77.50
120.89
167.07
3.23
388.51
526.11
94.02
787.03
1024.50
1317.00
1889.50
2157.20
2634.60
171.75
3368.70
3827.80
4705.30
5927.20
6747.60
9243.10
13331.00

6.91
16.73
9.02
41.75
122.42
172.84
8.84
435.11
547.09
94.25
766.28
1118.24
1340.77
1877.39
2344.09
2992.72
180.13
3537.70
4028.19
5130.24
6111.86
7771.86
9438.63
13170.88

We also tested the improved proposed neural algorithm (NA-L+ ) against the variable neighborhood search (VNS)
[14] on 40 ORLIB problems from Beasley [25]. In the same manner that NA-L uses a scatter strategy to construct an
initial solution, Hansen and Mladenovic [14] suggested a greedy plus fast interchange algorithm (G + I) to obtain an
initial solution for VNS. Table 2 summarizes the comparative results for solving the 40 ORLIB test problems. Optimum
values are not included in the table for simplicity. Columns 4 and 5 present the objective function values found by the
tested algorithms, their respective % error are included in columns 6 and 7, and their computational time is shown in
columns 8 and 9. The maximum number of NA-L+ iterations were xed to the number of points (n), thus the NA-L+
procedure was repeated at most n times. The maximum CPU time allowed of VNS was xed to similar CPU time
of NA-L+ to compare the efciency of both algorithms. The performance of NA-L+ is better than VNS, moreover
NA-L+ solves more test problems exactly than VNS in similar CPU times. An interesting future investigation would
be to apply VNS to the solutions produced by NA-L+ in larger scale problems to reduce the computational time of
VNS. A desirable feature of the proposed algorithm (NA-L+ ) is that it nds good solutions quickly. Although optimum
solution of the largest instance (pmed40) was not found by algorithms in more than 3 h, the NA-L+ error (0.53%) is
far less than VNS error (21.74%).
Fig. 2 shows an estimation of the VNS error for instances between 100 and 900 demand points and between ve and
200 facilities to locate. In the same way, an estimation of the NA-L+ error is shown in Fig. 3. These simple regressions
were calculated from the results reported in the Table 2. The two gures show the signicant differences between the
quality of solutions provided by VNS and NA-L+ . Note that the error scale of the Fig. 3 is 10 times less than the error
scale of Fig. 2.
Actually, a disadvantage of VNS is the computational time required to nd a good solution. This inconvenience
can be irrelevant in a research laboratory including modern mainframes with great computation capabilities. But this
characteristic is essential in interactive applications as GIS or other interactive locator software. Moreover, 3 h could
become an unacceptable time in an interactive application environment. Table 3 shows the results obtained by the
proposed neural algorithm with 100 maximum iterations allowed. The best solutions of 18 instances were found in

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

413

Error

0.8
0.6
0.4
0.2
0
200
150
Fa
cili 100
tie
s(
p)

1000
50
0

200
0

400
nd
ema

800

600

ts (n

poin

Fig. 2. Regression surface for the prediction of the VNS error.

0.1

Error

0.08
0.06
0.04
0.02
0
200
150

800

Fa

100

cili

tie

50

s(

p)

200

1000

600
400
(n)
oints
d
n p
a
m
De

Fig. 3. Regression surface for the prediction of the NA-L+ error.

less than 15 min, which are not included in the table for simplicity. Although VNS was allowed to run more than 3 h
to found a solution with a 21.74% of error in the largest instance (pmed40), NA-L+ used only 16 min to nd a better
solution (2.85% of error).
5. Conclusions
A new formulation of the p-median problem with 2np decision variables and n + p equality constraints has been
proposed. Based on this formulation, a neural network is proposed as an alternative for solving the p-median problem and
it is compared to classical optimization techniques and well-known heuristics. Motivations for using neural networks
include improvement in speed of operation through massively parallel computation, and possible implementation
by optical devices, which operate at a higher speed than conventional electronic circuits. Our objective has been to
exploit the features of neural networks and show that a simple recurrent neural network can generate good solutions to
locationallocations problems. Other heuristics applied to the p-median problem involve somewhat arcane analogies

414

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

Table 3
NA-L+ results (max. iter. = 100)
Problem

(n, p)

Optimum

NA-L+

CPU time (s)

% Error

pmed5
pmed8
pmed9
pmed10
pmed13
pmed14
pmed15
pmed18
pmed19
pmed20
pmed23
pmed24
pmed25
pmed28
pmed29
pmed30
pmed32
pmed33
pmed34
pmed36
pmed37
pmed40
Average

(100, 33)
(200, 20)
(200, 40)
(200, 67)
(300, 30)
(300, 60)
(300, 100)
(400, 40)
(400, 80)
(400, 133)
(500, 50)
(500, 100)
(500, 167)
(600, 60)
(600, 120)
(600, 200)
(700, 10)
(700, 70)
(700, 140)
(800, 10)
(800, 80)
(900, 90)

1355
4445
2734
1255
4374
2968
1729
4809
2845
1789
4619
2961
1828
4498
3033
1989
9297
4700
3013
9934
5057
5128

1362
4449
2766
1308
4401
3032
1828
4832
2917
1894
4672
3065
1986
4581
3174
2200
9315
4794
3175
9947
5156
5274

20.13
34.75
37.31
52.76
55.09
82.10
118.50
131.78
169.83
209.62
248.18
298.58
363.55
394.06
445.46
520.05
413.46
571.26
648.78
600.96
798.30
968.90

0.52
0.09
1.17
4.22
0.62
2.16
5.73
0.48
2.53
5.87
1.15
3.51
8.64
1.85
4.65
10.61
0.19
2.00
5.38
0.13
1.96
2.85
1.66

from the physical or biotic world, where many unintuitive parameters such as temperature, long and short-term memory,
or pheromone characteristics, must be devised, estimated and applied. Here, we need only to decide the problem
parameters n, the number of demand points, and p, the number of facilities or medians.
The proposed neural model based on this formulation guarantees that every stable state of neural network is a
feasible solution without any penalty parameters tuning. This neural network implements a gradient descent or hillclimbing search method that only accepts moves (state change) that improve solution quality, i.e. the energy is decreased.
However, this neural network should not be viewed as naive gradient descent machine, but as ensemble of interconnected
processing units with simple computational requirements that can implement complex computation.
The results show that the proposed neural algorithm (NA-L+ ) outperforms VNS when the computational time is
limited. Moreover, this neural network can be easily implemented by VLSI and can operate in the parallel mode without
any additional effort. Based on our computational tests, we believe that neural networks have the potential to be useful
heuristic for the p-median problem.
Acknowledgments
This work was partially supported by the Spanish Science and Technology Ministry under grant TIC2003-03067
(VIDEO project). The authors thank two anonymous referees for their valuable comments, and would like to acknowledge the helpful suggestions and comments of H.A. Eiselt.
Appendix A. Proof of the energy decrease
If we consider discrete time dynamics then the increment of energy for any change of the state of any neuron of the
network is given by the next expression
E(k) = E(k + 1) E(k) =

p
n 
n 

i=1 j =1 q=1

dij xiq (k + 1)yj q (k + 1)

p
n 
n 

i=1 j =1 q=1

dij xiq (k)yj q (k).

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

415

We introduce now the notion of layer update, that is, instead of selecting a single neuron for update we can select
a layer containing a number of np neurons. Then, the difference in the energy that would result if only the state of
the neurons in the selected layer are altered depends on the type of layer (allocation or location layer). If all neurons
contained in the selected layer are allocation neurons (xiq ), the difference in the energy is
E(k) =

p
n 
n 


dij (xiq (k + 1) xiq (k))yj q (k) =

i=1 j =1 q=1

n


p
n 


(xiq (k) xiq (k + 1))hxiq (k)

i=1 q=1

[(xis i (k) xis i (k + 1))hxiq i (k) + (xir i (k) xir i (k + 1))hxrq i (k)].

i=1

Let us suppose now that at time k the allocation neurons xir i is the only one that is on in group i and that allocation
neuron xis i are the candidate neurons in group i that is going to be on at time k + 1. Then we have that
xir i (k) = 1,
xiq (k) = 0,

1 q p, q = ri ,

xis i (k + 1) = 1,
xiq (k) = 0,

1 q p, q = si .

By substituting these values we have that


E(k) =

n


(hxir i (k) hxis i (k))0.

i=1

Hence, we have that if the neuron with the maximum input hxis i per group i is always selected as the candidate
neuron xis i , then the energy descent is guaranteed. 
References
[1] Glesner M, Pchmller W. Neurocomputersan overview of neural networks in VLSI. London, UK: Chapman & Hall; 1994.
[2] Hakimi SL. Optimum distribution of switching centers in to communication network and some related graph theoretic problems. Operations
Research 1965;13:46275.
[3] Kariv O, Hakimi SL. An algorithmic approach to network location problem. Part 2: the p-median. SIAM Journal on Applied Mathematics
1979;37:53960.
[4] Bartezzaghi E, Colorni A. A search tree algorithm for plant location problems. European Journal of Operational Research 1981;7:3719.
[5] Christodes N, Beasley JE. A tree search algorithm for the problem p-mediates. European Journal of Operational Research 1982;10:196204.
[6] Khumawala BM. An efcient branch and bound algorithm for the warehouse location problem. Management Science 1972;18(12):71831.
[7] Galvao RD, A dual-bounded algorithm for the problem p-mediates. Operations Research 1980;28:111221.
[8] McAulay A. Optical computer architectures: the applications of optical concepts to next generation computers. New York, USA: Wiley; 1991.
[9] Drezner Z, Guyse J. Application of decision analysis to the Weber facility location problem. European Journal of Operational Research
1999;116:6979.
[10] Hribar M, Daskin MS. A dynamic programming heuristic for the problem p-mediates. European Journal of Operational Research 1997;101:
499508.
[11] Teitz MB, Bart P. Heuristic methods for estimating the generalized vertex median of a weighted graph. Operations Research 1968;16:95561.
[12] Rolland E, Shilling DA, Current JR. An efcient tabu search procedure for the p-median problem. European Journal of Operational Research
1997;96:32942.
[13] Rosing KE, ReVelle CS. Heuristic concentration: two stage solution construction. European Journal of Operational Research 1997;97:7586.
[14] Hansen P, Mladenovic N. Variable neighborhood search for the p-median problem. Location Science 1997;5(4):20726.
[15] Alp O, Erkut E, Drezner Z. An efcient genetic algorithm for the p-median problem. Annals of Operations Research 2003;122:2142.
[16] Hopeld J. Neural networks and physical systems with emergent collective computational abilities. Proceedings of the National Academy of
Sciences 1982;79:25548.
[17] Hopeld JJ, Tank DW. Neural computation of decisions in optimization problems. Biological Cybernetics 1985;52:14152.
[18] Hung DL, Wang J. Digital hardware realization of a recurrent neural network for solving the assignment problem. Neurocomputing 2003;51:
44761.
[19] Smith K, Palaniswami M, Krishnamoorthy M. A hybrid neural approach to combinatorial optimization. Computer and Operations Research
1996;23(6):597610.

416

E. Domnguez, J. Muoz / Computers & Operations Research 35 (2008) 404 416

[20] ReVelle C, Swain R. Central facilities location. Geographical Analysis 1970;(2):3042.


[21] Dominguez E, Muoz J. An efcient neural network algorithm for the p-median problem. Proceedings of Iberamia 2002, Sevilla, Spain, 2002.
p. 4609.
[22] Galan G, Muoz J. Design and analysis of maximum Hopeld networks. IEEE Transactions on Neural Networks 2001;12(2):32939.
[23] Takefuji Y. Neural network parallel computing. Dordrecht: Kluwer; 1992.
[24] Maranzana FE. On the location of supply points to minimize transport costs. Operational Research Quarterly 1964;15:26170.
[25] Beasley JE. OR-Library: distributing test problems by electronic mail. Journal of the Operational Research Society 1990;41(11):106972.

Further Reading
[26]
[27]
[28]
[29]
[30]
[31]
[32]

Daskin MS. Network and discrete location: models, algorithms and applications. New York: Wiley; 1995.
Farhat NH, Psaltis D, Prata A, Peak E. Optical implementation of the Hopeld model. Applied Optics 1985;24:146975.
Hakimi SL. Optimum locations of switching centers and absolute centers and medians of to graph. Operations Research 1964;12:4509.
Kung SY. Digital neural networks. Englewood Clifs, NJ, USA: Prentice-Hall; 1993.
Love RF, Morris JG, Wesolowsky GO. Facilities location models & methods. North-Holland: Amsterdam; 1998.
Narula SC, Ogbu UI, Samuelsson HM. An algorithm for the problem p-mediates. Operations Research 1977;25:70913.
Shams S, Gaudiot JL. Implementing regularly structured neural networks on the DREAM machine. IEEE Transactions on Neural Networks
1995;6:40721.

Potrebbero piacerti anche