You are on page 1of 7

ARI (2001) 52: 23±29 Ó Springer-Verlag 2001


G. B. Kaplan á CuÈneyt GuÈzelisË

Hop®eld networks for solving Tower of Hanoi problems

Received: 23 March 1999 / Accepted: September 1999

Abstract In this paper, Hop®eld neural networks have (Kandel et al. 1991). In human beings, the prefrontal
been considered in solving the Tower of Hanoi test cortex covers 30% of the whole cortex area. No other
which is used in the determining of de®cit of planning part of the brain has increased by this rate during evo-
capability of the human prefrontal cortex. The main lution. This ratio is 3.5% in cats and 17% in chimpanzees.
di€erence between this paper and the ones in the liter- In humans, the prefrontal cortex completes its matura-
ature which use neural networks is that the Tower of tion during the teen-age years (Yaltkaya et al. 1994;
Hanoi problem has been formulated here as a special Boller et al. 1994).
shortest-path problem. In the literature, some Hop®eld During primate evolution, the prefrontal cortex
networks are developed for solving the shortest path reached its maximum area for the human brain. Accord-
problem which is a combinatorial optimization problem ing to Goldman-Rakic, the prefrontal cortex provides the
having a diverse ®eld of application. The approach given property of being directed by an internal representation of
in this paper gives the possibility of solving the Tower of external stimuli which is absent in the goal-directed be-
Hanoi problem using these Hop®eld networks. Also, the haviours (Goldman-Rakic 1990). Thus, the response of
paper proposes new Hop®eld network models for the humans to external physical stimuli becomes a preplanned
shortest path and hence the Tower of Hanoi problems and the most appropriate response rather than just being a
and compares them to the available ones in terms of the re¯exive one. Thanks to this property, the organism
memory and time (number of steps) needed in the sim- evaluates varying conditions and adopts new behaviour
ulations. patterns instead of persisting in the formerly-learned re-
sponses. Damage in the prefrontal portion of the brain
Key words Tower of Hanoi  Directed graph  breaks down this ¯exibility in behaviour and leads to en-
Shortest path  Hop®eld network  Integer vironment-dependent and in¯exible behaviour which is
programming  Penalty function method easily diverted by irrelevant stimuli.
With increasing frequency in neuropsychology, the
behavioural de®cits exhibited by patients with frontal
1 Introduction lobe disease are described as the lack of performing the
executive functions. Herein, the term of executive func-
The cerebral cortex that envelops the cerebral hemi- tions will be used to refer to higher-order cognitive
spheres is responsible for controlling voluntary move- abilities, e.g. judgment, decision-making, planning and
ments, for combining and the orientation of senses, and social conduct. Such abilities are at the top level in the
for regulating the higher mental and emotional functions cognitive hierarchy. Executive functions draw from and
di€erentiating human beings from the rest of the animals rely upon many other components of the cognitive
repertoire, such as memory, perception and linguistic
abilities (Boller et al. 1994). In neuropsychology, there
G. B. Kaplan (&) are several tests investigating the impairment of pre-
Tubitak Marmara Research Center, frontal cortex functions. The Tower of Hanoi problem
Information Technologies Research Institute, provides a means of measuring the planning capability
Gebze 41470, Kocaeli Turkey
e-mail: of the prefrontal cortex. Development of arti®cial neural
Tel.: +90-262-6412300; Fax: +90-262-6463187 networks to solve the Tower of Hanoi problem might be
C. GuÈzelisË
useful for modelling the planning function of the brain.
Istanbul Technical University, In this work, solving the Tower of Hanoi test by
Maslak 80626, Istanbul Turkey using Hop®eld neural networks is considered. Unlike

others in the literature, this test has been formulated in eter. Each trial has to be completed in minimal time and
this paper as a shortest path problem. Herein, the legal movements. Later on, an evaluation is made considering
moves imposed by the rules of Tower of Hanoi test total time and movements (Boller et al. 1994). For two
correspond to the arcs of a graph while illegal moves are disks, all possible movements are shown in Fig. 1.
assumed to be learned a priori and the arcs corre- Herein, two disks are considered due to its simplicity.
sponding to them are not included in the graph. The The Tower of Hanoi test can be solved in a recursive
shortest path problem is a classical combinatorial opti- way if all the disks are initially placed on the ®rst peg in
mization problem having widespread applications in a the order of the smallest disk at the top while the largest
diverse ®eld (Bertsekas and Gallager 1992). The appli- disk is at the bottom. But, this method can not provide
cations include vehicle routing in transportation sys- solutions for di€erent initial placements, since it is based
tems, trac routing in communication networks and on the knowledge of the order of the disks.
path planning in robotic systems. For the shortest path In arti®cial intelligence literature, the Tower of Hanoi
problem, in the literature, as well as classical labelling test is solved by di€erent search techniques. One of them
algorithms (Cormen et al. 1990), search methods in ar- is the General Problem Solver (GPS) which is intended
ti®cial intelligence (Charniak and McDermott 1985) and to model human performance in search problems, such
methods based on neural networks have been developed. as puzzles and symbolic integration. GPS, which is one
In this work, ®rst the Hop®eld network of Ali and of the ®rst examples of search methods, is based on
Kamoun (1993), which has been proposed for solving selecting the operations that will decrease the di€erent
the shortest path problem, is used for the Tower of between the initial and target states (Charniak and
Hanoi test. So, a Hop®eld network solution is obtained McDermott 1985).
for the Tower of Hanoi problem. Secondly, the qua- A neutral network solution to the Tower of Hanoi
dratic cost function obtained by the penalty function problem is given in Sohn and Gaudiot (1992), where the
method applied on the linear integer programming for- researchers considered the Tower of Hanoi test as a
mulation of the shortest path is equated to Hop®eld planning problem. Their work is concerned solely with
energy (Lyapunov) function. In this procedure, the learning legal moves in the Tower of Hanoi test. They
penalty terms are chosen in several di€erent ways proposed a model for three disks. The network in their
yielding new Hop®eld network models which have sim- model is arranged in an array of 3  3 neurons. The
pler structures as compared to the one in Ali and Ka- neurons are fully connected. Each neuron takes a
moun (1993). In the simulation of these simpli®ed weighted sum of other neuron outputs as its input, and its
models, it has been observed that they require consid- output become 1 if this sum exceeds a threshold and 0
erable less memory and time (number of steps). otherwise. In this approach, a set of constraints is derived
The organization of the paper is as follows: in Sect. 2, from the problem domain. Each constraint is used to help
the Tower of Hanoi test, shortest path problem and the the learning process eventually generate legal moves
formulation of the Tower of Hanoi test as a shortest in the Tower of Hanoi test. In the above mentioned
path problem are explained. In Sect. 3, the Hop®eld model, the constraint that the top disk must be moved
network proposed in Ali and Kamoun (1993) for the ®rst has not been considered. In addition to this de®-
solution of the shortest path problem and its application ciency, for more than three disks the model cannot handle
to the Tower of Hanoi test are explained and the related the constraint of not placing a disk above a smaller one.
simulation results are given. The last section covers the
integer formulation of shortest path problem, uncon-
strained quadratic formulations obtained by the penalty 2.1 Shortest path problem
function method and integer relaxation and the Hop®eld
network based on these formulations together with the The shortest path problem can be described as ®nding
simulation results. the minimum cost path between a start and a target node
in a given weighted, directed graph (Bazarra and Jarvis
1977). The given graph G…N ; S† is composed of sets N
and S, where N ˆ figniˆ1 is the node set, and
2 The Tower of Hanoi test S ˆ f…i; j†g ˆ N  N is the arc set where each arc joins a
pair of nodes. Arc(i; j) is said to be incident with nodes i
This test examines the planning function of the prefrontal and j and is directed from node i to node j. Each arc has
cortex. In this test, there are three pegs and di€erent size a cost ci;j .
disks. The idea is to transfer the disks to the third peg A path (from node i0 to iq ) is a sequence of arcs
from an arbitrary initial placement according to some P ……i0 ; i1 †; …i1 ; i2 †; . . . ; …iq 1 ; iq †† in which the initial node
rules. In the ®rst (and respectively in the second) part of of each arc is the same as the terminal node of the
the test, three (and respectively four) disks are arranged preceding arc in the sequence. The path cost is equal to
on three pegs in a di€erent order. The subject has to the sum of the costs of arcs forming the path.
transfer all disks on the third peg by moving only one The application of the shortest path problem for
disk at a time. During the transfer process the subject can telecommunications and for transportation networks is
not place a disk above a disk which has a smaller diam- diverse. Moreover, there is a large class of network

optimization problems whose solution requires solving

the shortest path problem as a subproblem (Ali and
Kamoun 1993).
The shortest path problem has been investigated ex-
tensively (Cormen et al. 1990). The well-known algo-
rithms for solving the shortest path problem include the
h…n2 † Bell-man's dynamic programming algorithm for
directed acyclic networks, the h…n2 † Dijkstra-like label-
ling algorithm for networks with only nonnegative cost
coecients, and the h…n3 † Bellman-Ford successive ap-
proximation algorithm for networks without negative
cost coecients, where n denotes the number of nodes in Fig. 2 State diagram for two-disk problem
the network (Nemhauser and Wolsey 1988). For a large-
scale and real-time applications such as trac routing and movements. In this ®gure, a movement corresponds
and path planning, the existing series algorithms may to an arc between two states. A symbol is associated to
not be e€ective due to the limitation of sequential pro- each arc to represent the changing peg numbers of a disk
cessing in computational time. Therefore, parallel solu- during a movement. For example, A:(1 3) represents the
tion methods are more desirable. movement of disk A from peg 1 to peg 3.
As seen from the state diagram in Fig. 2, the Tower
of Honoi problem can be considered as a special shortest
2.2 Tower of Hanoi test as shortest path problem path problem in a weighted and directed graph. The
nodes in the graph correspond to the states in the state-
During the test, a placement of disks can be considered space. The starting node is used for initial disk positions
as a state of the problem's universe at a particular time and the target node is used for disk positions on the
(Boller et al. 1994). These states include all the infor- third peg. As a result of this correspondence, seeking
mation about the problem. A new state is reached when solutions for the Tower of Hanoi problem within the
a disk is moved to a new place according to the rules. neural networks domain has been transformed into
For a two-disk problem, a state can be represented by a ®nding solutions for the shortest path problem by neural
pair of numbers indicating the peg numbers where the networks.
disks are placed. The ®rst number re¯ects the peg on
which small disk (A) rests while the second number the
peg on which large disk (B) rests. Fig. 1 shows all
possible states of the two-disk problem. 3 Solving shortest path problem using neural networks
In Fig. 2, the state diagram for a two-disk problem is
shown. The state diagram consists of all possible states Since Hop®eld and Tank's pioneering work (Hop®eld
and Tank 1985), neural networks for solving optimiza-
tion problems have been a major topic in neural network
research. The use of neural networks to ®nd the shortest
path between a given start-target pair was initiated by
Rauch and Winarske (Raush and Winarske 1988). They
proposed a neural network architecture in a two di-
mensional array of size n  m, where m is the number of
nodes forming the path. The output Vkl of the neuron at
location (k; l) is 1, if node k is the lth node to be visited in
the path, and is 0 otherwise.
One obvious limitation of the above representation is
that it requires a prior knowledge of the number of
nodes forming the path. To overcome this shortcoming,
Zhang and Thomopoulos (1989) extended m to the total
number of nodes in the network, which is also the
maximum number of nodes the shortest path may con-
sist of. In this work, arc costs which are seen as energy
function expression, determine the connection weights
among the neurons. In practice, the are costs in real
applications are usually time varying. So, Zhang and
Thomopoulos's neural network will not be suitable for
use in real applications since, for hardware realization,
the synaptic connections must be changed continuously
Fig. 1 All possible movements for two-disk problem in order to meet changes in arc costs.

In Ali and Kamoun (1993), these problems were Here, l1 term corresponds to the total cost of a path, l2
solved. Arc costs were used only in the determining of term prevents nonexisting arcs from being included in a
the bias values of the neurons. For this reason, this solution path, l3 term is used to consider the arti®cial
paper considers the Hop®eld network solution of Ali target-start arc which is implemented in order to enforce
and Kamoun (1993) in solving the Tower of Hanoi the construction of a path which includes both start (s)
problem. and target (t) nodes, l4 term is considered to obtain
equal number of incoming and outgoing arcs for each
node in a path (path constraint), and the l5 term is
3.1 Hop®eld network for shortest path problem considered to force the outputs of neurons to be 1 or 0.
The output function is de®ned as Vkl ˆ 1=…1 ‡ e kUkl †.
In the Hop®eld model of Ali and Kamoun (1993), for Where Ukl is the state of the neuron …k; l†.
each possible arc in a given graph, a neuron is needed. So, The dynamics of a …k; l†th neuron is given in Eq. 2
for a given graph with n nodes, the proposed model is
organized in an n  n matrix, with all diagonal elements dUkl Ukl X n X n
ˆ ‡ Tkl;pq  Vpq ‡ Ikl : …2†
removed, since the considered graphs have no self loop. dt s pˆ1 qˆ1
Therefore, the computational network requires (n2 n) q6ˆp
neurons, and a neuron at location (k; l) is characterized
by its output Vkl . If the arc from node k to node l is in the Here s is the linear time constant and Tkl;pq 's denote the
shortest path then Vkl takes 1, and 0 otherwise. connection weights between pairs of neurons.
Since there corresponds a neuron to each possible It is shown in Hop®eld and Tank (1985) that for
arc, then the nonexisting arcs are also represented in the symmetric connection weights and suciently a high k
network. This may yield a nonexisting arc to appear in parameter the (truncated) energy function is given as in
the resulting path. A new variable rk;l and a penalty term Eq. 3:
in the Hop®eld energy function explained below, are 1X n X n X n X n
introduced to overcome this problem, rk;l is set to 1, if Eˆ Tkl;pq  Vkl  Vpq
2 kˆ1 lˆ1 pˆ1 qˆ1
the arc from node k to node l does not exist, and set to 0
otherwise. n X
X n
A Hope®eld network is a completely stable dynamical Ikl  Vkl : …3†
system, where all the trajectories end in one of the kˆ1 lˆ1
equilibrium points. The stable equilibrium points of The dynamics of a neuron in terms of the energy func-
the network indeed correspond to the minimums of the tion is as follows:
scalar function called energy or Lyapunov function. Due
to this fact, the cost function can be rendered as a dUkl Ukl @E
ˆ : …4†
Hop®eld energy function and the minimums of this cost dt s @Vkl
function can be obtained as the steady state solutions of
According to this, the di€erential equation de®ning the
the di€erential equations de®ning the Hope®eld net-
state of …k; l†th neuron in the network is given below:
work. The main approach in solving optimization
problems with the Hop®eld network is to formulate the dUkl Ukl 1X n X n
optimization problem by minimizing a quadratic cost ˆ Tkl  Vpq ‡ Ikl :
dt s 2 pˆ1 qˆ1
function which can be equated to the Hop®eld energy
function. In Ali and Kamoun (1993), the shortest path
problem is formalized as an unconstrained optimization When the cost function U is equated to the energy
problem for which the cost function is given in Eq. 1. function E, the weights and biases of the Hop®eld net-
0 1 0 1
work used for minimizing the cost are obtained as:
l1 B
n X
n C l BX
C 2B
n X
n C Tkl;pq ˆ l4 dkp dkq l3 dkp l3 dlq ‡ l3 dqk ‡ l3 dlp ;
C …5†
Uˆ B Cxi  Vxi C ‡ B rxi  Vxi C
2 B iˆ1 C 2 B iˆ1 C I ˆ l C …1 d  d † l2 r …1 d  d †
@ iˆ1 A @ iˆ1 A kl 1 kl kt ls kl kt ls
i6ˆx i6ˆx 2
…x;i†6ˆ…d;s† …x;i†6ˆ…d;s† l4 l
0 12 ‡ 5 dkt  dls : …6†
2 2
l3 l4 X
n BXn
B Vxi
n C Here, dkl is the Kronecker delta, i.e. when k ˆ l, dkl ˆ 1
‡ …1 Vds † ‡ @ Vix C
A and otherwise, dkl ˆ 0.
2 2 iˆ1 iˆ1 iˆ1
i6ˆx i6ˆx
0 1
l5 BXn X
n C 3.2 Simulation results
‡ B Vxi  …1 Vxi †C
2 iˆ1 iˆ1 A : …1†
In the simulation, the Tower of Hanoi problem with two
i6ˆx disks is considered. The graph formed for this problem is
given in Fig. 2. As can be realized from graph, there are X
n X
n 1 if i ˆ s
9 nodes and 24 arcs. For this purpose, a two-layer 1† xik xli ˆ 0 if i 6ˆ s; i 6ˆ t ; …8†
Hop®eld network (HN-1) with 72 neurons, which is in- kˆ1 lˆ1 1 iˆt
troduced in Sect. 3.1 is used. The number of connection k6ˆi l6ˆi

weights de®ned are 2160. So a nonlinear di€erential 2† xij 2 f0; 1gn 8 i 6ˆ j; i; j 2 f1; 2; . . . ; ng : …9†
equation set composed of 72 equations is considered.
For a numerical solution of these di€erential equations, Here xij is a variable representing the arc between node i
a fourth order Runge±Kutta method as proposed in Ali and node j, cij is the cost of arc…ij†, n is the number of
and Kamoun (1993) is used and the step size is taken as nodes, s is the start node, and t is the target node.
10 5 . The Hop®eld networks proposed in this section aims
The time constant s of each neuron is set to 1 and, for to solve the shortest path problem and then the Tower of
simplicity, k is taken as 1 in the output function Hanoi problem and are based on the above linear integer
Vkl ˆ 1=…1 ‡ e kUkl † of neurons. Since the neural net- programming formulation. In these models, each neuron
work should have no a priori favour for a particular corresponds to an arc in the state diagram. This repre-
path, initial values for all Uk;l have to be set to 0. sentation which considers the existing arcs only provides
However, some random noise between 0:00002 and a considerable reduction in the network size as com-
0.00002 is added initially to break the symmetry caused pared to the Hop®eld network in Ali and Kamoun
by symmetric network topologies. The simulation is (1993). The output xi;j of the neuron related to the arc
stopped when the system reaches steady state. This is from node i to node j will be equal to 1 if this arc is in
assumed to occur when all neuron outputs do not the shortest path, equal to 0 otherwise.
change by more than a threshold value of 10 5 from one In the sequel, a new x vector will be used in order to
update to the next. At the steady state each neuron is obtain a compact form. x is formed from the node
either On …Vk;l  0:5† or O€ …Vk;l < 0:5†. values of xij by reordering them lexicographically. If the
In the simulation, values for l are chosen as in Ali arcs' costs, cij 's, corresponding to xij 's are reordered in
and Kamoun (1993) and as follows; the shortest path is the same way to form a new c vector, the Eqs. 7±9 are
found after 7860 steps: l1 ˆ 950, l2 ˆ 2500, l3 ˆ 1500, transformed into the following matrix form:
l4 ˆ 475, l5 ˆ 2500. min U…x† ˆ cT x ; …10†
Beside these values, a large number of simulations are
done to explore the region of parameter values. Ac- subject to:
cording to this paper, a ®ve-dimensional region which is ANA  x ˆ b and …11:1†
de®ned by following ranges is found:
x 2 f0; 1g : …11:2†
l1 2 f36; 1400g; l2 2 f1510; 1g; l3 2 f990; 1g; Here, m is the number of nodes, n is the number of arcs.
l4 2 f405; 1490g; l5 2 f1483; 1g :
c ˆ ‰1; 1; . . . ; 1ŠT 2 Rm ; x 2 f0; 1gn ;
Except for the graphs related to the Tower of Hanoi b ˆ ‰1; 0; . . . ; 0; 1ŠT 2 Rm ; ANA 2 f0; 1; 1gnm :
problem, the simulation experiments are done with
random weighted and directed graphs to have a statis- ANA represents node-arc incidence matrix. An element aij
tical evaluation. The shortest paths have been found of this matrix is de®ned as follows:
with the above l values only if arc costs are between 0 (
1 if arc j is incident to node i
and 1. For this reason, in the simulations arc costs were aij ˆ 1 if arc j is incident from node i :
taken as equal valued and as 0.5. When these arc costs
0 otherwise
are changed to 1 and the above l values are doubled, the
same paths are obtained. The constrained optimization problem posed in Eqs. 10
and 11 can be transformed into an unconstrained opti-
mization problem by using the penalty function method.
In this method, penalty terms related to the constraints
4 Proposed Hop®eld networks for shortest path problem are formed, then added to the cost function with some
penalty coecients. So, the formulation of Eqs. 10 and
The shortest path problem, which is a graph problem, 11 is converted into the minimization of the cost func-
can be given in the following integer linear programming tion de®ned in Eq. 12. Note that although it was not
formulation (Bazarra and Jarvis 1977). remarked in Ali and Kamoun (1993), the cost function
given in Sect. 3.1 can be obtained also from the linear
n X
n integer programming formulation in Eqs. 7 and 9 by
min cij  xij : …7† using the penalty function method.
iˆ1 jˆ1
j6ˆi W…x† ˆ g1  cT x ‡ g2  kANA  x bk2
Subject to: ‡ g3  …eT x xT x† : …12†

Here, cT x is responsible for minimizing the total cost of to a neuron. As a result of this di€erence, there is not
a candidate path, k  k denotes the Euclidean norm, any term in Eq. 12 corresponding to the l2 term in
kANA  x bk is the term that forces construction of a Eq. 1. (2) In HN-2, there is no arti®cial arc between
valid path including start and target nodes, target and start nodes. So, there is only g2 term in Eq. 12
e ˆ ‰1; . . . ; 1ŠT 2 Rn is a vector with all components 1 instead of l3 and l5 terms of Eq. 1. This single term
and …eT x xT x† forces to x 2 f0; 1gn . re¯ects the path constraint and the constraint of the
existence of the start and target nodes in the path.
As in HN-1, a term can be added to the cost function
4.1 Derivation of network parameters which emphasizes the construction of a path that must
originate from a start node and terminate at a target
In Sect. 3.1, the network parameters are given for the node. For this purpose, an arti®cial arc with zero cost
two-dimensional Hop®eld network of Ali and Kamoun between the target and start node is added to the graph.
(1993). In the sequel, the network parameters will be By adding this arti®cial arc …xhb † to the arc vector x as a
derived for a Hop®eld network arranged as a one-di- last term, another Hop®eld network (HN-3) is derived
mensional array of neurons in accordance with the with the parameters given below. In this case, the sizes of
above integer linear program. The connection weights arc vector x and cost vector c are increased by 1. The
associated to the links between neurons of such a net- …1 xhb †2 term multiplied by g4 coecient must be
work can be described through a connection matrix W. added to the cost function. Vector b becomes a vector
Each neuron also receives an external input called bias. with all elements 0, after this arrangement. The resulting
These biases constitute a bias vector I. The output connection weight matrix W3 and bias vector I3 are
function is de®ned as xi ˆ 1=…1 ‡ e kui †. Where ui is the given below.
state of the (i)th neuron.
The dynamics of …i†th neuron in this one-dimensional W3 ˆ 2…g2  ATNA  ANA g3  U ‡ g4  eN  eTN †;
Hop®eld network is given as follows: I3 ˆ g1  c g3  e ‡ 2  g4  eN :
dui ui X
ˆ ‡ wi;j  xj ‡ Ii : Here, eN is de®ned as follows: eN ˆ ‰0; . . . ; 0; 1ŠT 2 Rn‡1 .
dt s jˆ1 The last Hop®eld network (HN-4) proposed here is
j6ˆi obtained by removing the binary condition x 2 f0; 1gn
in the cost function related to HN-3. In HN-4, the bi-
The corresponding energy function is: nary condition is provided automatically because of the
1X n X n X
n following facts which have been also con®rmed by the
Eˆ wi;j  xi  xj Ii  xi : simulations. (1) The integer linear programming for-
2 iˆ1 jˆ1 iˆ1 mulation given in Eqs. 10±11, can be transformed into
the standard (continuous) linear programming formu-
The dynamics of a neuron in terms of the energy func-
lation by integer relaxation. This is done by transform-
tion is given below:
ing the integrality constraint of Eq. 11.2 into the
dUi Ui @E following inequality constraint o  x  e. The solutions
ˆ : of the new linear programming problem coincide with
dt s @xi
previous integer programming solutions since node-arc
According to this, the di€erential equation de®ning the incidence matrix ANA which determines the constraint
state of …i†th neuron in the network is as follows: given in Eq. 11.1, is totally unimodular (Bazarra and
Jarvis 1977). (2) Since the components of x vector cor-
dui ui 1X n
ˆ wij  xj ‡ Ii : respond to the outputs of neurons in the network and
dt s 2 jˆ1 the output function, which is sigmoid, taking values
j6ˆi between 0 and 1, then the inequality constraints
o  x  e are satis®ed automatically.
The connection weights and biases are determined for
The network parameters …W4 ; I4 † related to HN-4 are
the ®rst proposed Hop®eld network (HN-2) to minimize
derived from W3 and I3 , by setting parameter g3 to 0.
Eq. 12, by equating the cost function W in Eq. 12 to the
The results of the simulations, related to the newly
Hop®eld energy function in Eq. 3. Eventually, connec-
derived three Hop®eld networks, are given in Sect. 4.2.
tion weight matrix W2 and bias vector I2 are obtained as
follows (here U represents identity matrix).
W2 ˆ 2…g2  ATNA  ANA g3  U†; 4.2 Simulation results
I2 ˆ g1  c ‡ 2g2  ATNA b g3  e :
In the simulations, again the Tower of Hanoi problem
There are two fundamental di€erences between HN-1 with two disks is considered. The graph formed for this
and the proposed HN-2: (1) In HN-2, each existing arc problem is given in Fig. 2.
in the graph is corresponded to neuron in the network. HN-2: As can be seen from the graph, there are 9
But, in HN-1, each possible arc in the graph corresponds nodes and 24 arcs. In the proposed Hop®eld networks

(HN-2, HN-3, HN-4) the number of neurons must be Acknowledgements The authors thank the referee for the invalu-
equal to the number of arcs in the graph. So a Hop®eld able comments on the readability of the paper and on the technical
aspects he/she pointed out. The ®rst author also thanks Dr. N.S.
network with 24 neurons is used. The number of con- SengoÈr for very useful discussions.
nection weights de®ned are 576. So a nonlinear di€er-
ential equation set composed of 24 equations is
considered. For the numerical solution of the di€erential
equations, the forward Euler method is used and the References
step size is taken as 10 5 .
In the proposed Hop®eld networks, the values of s, k Ali MK, Kamoun H (1993) Neural networks for shortest path
computation and routing in computer networks. IEEE Trans.
and initial states Ux;i …0†'s are chosen as in HN-1. The Neural Networks 4: 941±954
integration of the di€erential equations are done also in Bazarra M, Jarvis JJ (1977) Linear programming and network
the same way with HN-1. ¯ows. Wiley, London New York
In the simulation, the values of parameters g1 , g2 and g3 Bertsekas D, Gallager R (1992) Data networks. Prentice Hall,
Englewood Cli€s NJ
which give the shortest path are in the following regions: Boller H, Spinnler H, Henler JA (1994) Handbook of neuropsy-
g1 2 f200; 1500g, g2 2 f3000; 20 000g, g3 2 f0; 1000g. chology. Elsevier, Amsterdam
HN-3: The simulation for HN-2 is repeated for HN-3 Charniak E, McDermott D (1985) Introduction to arti®cial intel-
and the region for the values of parameters g1 ; g2 ; g3 and ligence. Addison Wesley, Reading
g4 are: g1 2 f100; 3000g, g2 2 f500; 15 000g, g3 2 f375; Cormen TH, Leiserson CE, Rivest RL (1990) Introduction to
algorithms. Addison Wesley, Reading
8750g, g4 2 f400; 1000g. Goldman-Rakic PS (1990) Cortical localization of working
HN-4: In the simulation for HN-4 the below pa- memory. In: McGaugh JL, Weinberger NM, Lynch G (eds)
rameters values region is determined: g1 2 f500; 2000g, Brain Orgainization and Memory. Oxford University Press,
g2 2 f3500; 1600g, g4 2 f2000; 1g. Oxford
Graham N (1979) Arti®cial intelligence: making machines think.
McGraw-Hill, New York
Hadley G (1967) Linear programming. Addison Wesley, Reading
Hop®eld JJ, Tank DW (1985) Neural computation of decisions in
5 Conclusion optimization problems. Biological Cybernetics, 52: 141±152
Kandel ER, Schwartz JH, Jessell TM (1991) Principal of neural
science. Elsevier, Amsterdam
In this paper, for the Tower of Hanoi problem new Nemhauser GL, Wolsey LA (1988) Integer and combinatorial
Hop®eld networks are proposed as considering that the optimization, Wiley, London New York
Tower of Hanoi test is a special shortest path problem. Raush HE, Winarske T (1988) Neural networks for routing com-
It is observed in the simulations that the Hop®eld net- munication trac. IEEE Control Systems Magazine. April: 26±
work of Ali and Kamoun (1993) developed for general 30
Sohn A, Gaudiot J (1992) Learning legal moves in planning
shortest path problems ®nds a solution path in the problems: a connectionist approach to examining legal moves in
Tower of Hanoi. Moreover, three new simpli®ed Hop- the Tower-of-Hanoi. Engineering Application of Arti®cial
®eld networks are derived based on a linear program- Intelligence. 5: 239±245
ming formulation of the shortest path problem. These Yaltkaya K, Balkan S, OgÆuz Y (1994) NoÈroloji. Palme, Ankara
Zhang L, Thomopoulos SCH (1989) Neural network implemen-
simpli®ed models have some advantages for implemen- tation of the shortest path algorithm for trac routing in
tation since they need fewer neurons saving the memory communication networks. Proc. Int. Joint Conf. Neural Net-
and a fewer number of steps. works, June 1989, p. 1591