You are on page 1of 9

Int. J. Bio-Inspired Computation, Vol. 1, Nos.

1/2, 2009 71

The intelligent water drops algorithm:
a nature-inspired swarm-based optimization
algorithm

Hamed Shah-Hosseini
Faculty of Electrical and Computer Engineering,
Shahid Beheshti University, G.C.,
Tehran, Iran
E-mail: tasom2002@yahoo.com
E-mail: h_shahhosseini@sbu.ac.ir

Abstract: A natural river often finds good paths among lots of possible paths in its ways from
the source to destination. These near optimal or optimal paths are obtained by the actions and
reactions that occur among the water drops and the water drops with the riverbeds. The intelligent
water drops (IWD) algorithm is a new swarm-based optimisation algorithm inspired from
observing natural water drops that flow in rivers. In this paper, the IWD algorithm is tested to
find solutions of the n-queen puzzle with a simple local heuristic. The travelling salesman
problem (TSP) is also solved with a modified IWD algorithm. Moreover, the IWD algorithm is
tested with some more multiple knapsack problems (MKP) in which near-optimal or optimal
solutions are obtained.

Keywords: swarm intelligence; intelligent water drops; IWDs; travelling salesman problem;
TSP; multiple knapsack problem; MKP; n-queen puzzle.

Reference to this paper should be made as follows: Shah-Hosseini, H. (2009) ‘The intelligent
water drops algorithm: a nature-inspired swarm-based optimisation algorithm’, Int. J.
Bio-Inspired Computation, Vol. 1, Nos. 1/2, pp.71–79.

Biographical notes: H. Shah-Hosseini received his BS in Computer Engineering from Tehran
University, his MS and PhD from Amirkabir University of Technology, all with high honours.
He is now with the Electrical and Computer Engineering Department, Shahid Beheshti
University, Tehran, Iran. His current research interests include computational intelligence
especially time-adaptive self-organising maps, evolutionary computation, swarm intelligence and
computer vision.

1 Introduction rivers. The natural water drops are used to develop IWD and
the IWDs cooperate together to reach a better solution for a
The natural systems that have developed for so long are one
given problem. The IWD algorithm may be used for
of the rich sources of inspiration for inventing new
maximisation or minimisation problems. The solutions are
intelligent systems. Swarm intelligence is one of the
incrementally constructed by the IWD algorithm. Therefore,
scientific fields that are closely related to natural swarms
the IWD algorithm is a population-based constructive
existing in nature, such as ant colonies, bee colonies, brain
optimisation algorithm.
and rivers. Among the problem solving techniques inspired
The IWD algorithm has been used for the travelling
from nature are evolutionary computation (Eiben and Smith,
salesman’s problem (TSP) (Shah-Hosseini, 2007) and
2003), neural networks (Haykin, 1999), time adaptive
multiple (or multidimensional) knapsack problem (MKP)
self-organising maps (Shah-Hosseini, 2006), ant colony
(Shah-Hosseini, 2008) with promising results. Both the TSP
optimisation (Dorigo and Stutzle, 2004), bee colony
and the MKP are NP-hard combinatorial optimisation
optimisation (Sato and Hagiwara, 1997), particle swarm
problems. In the TSP, a map of cities is given to the
optimization (Eberhart and Kennedy, 1995), DNA
salesman and he has to visit all the cities only once to
computing (Adleman, 1994), electromagnetism-like
complete a tour such that the length of the tour is the
optimisation (Birbil and Fang, 2003) and intelligent water
shortest among all possible tours for this map. In the MKP,
drops (Shah-Hosseini, 2007).
there are multiple knapsacks and several items and the goal
One of the recently proposed algorithms in the field of
is to include some of the items in the knapsacks to achieve
the swarm intelligence is the intelligent water drops (IWDs)
maximum profit with the constraint that none of the
algorithm (Shah-Hosseini, 2007; Shah-Hosseini, 2008). The
knapsacks becomes overflowed. Both the TSP and MKP are
IWD algorithm is based on the dynamic of river systems,
often used for testing optimisation algorithms. In this paper,
actions and reactions that happen among the water drops in
the IWD-TSP algorithm (Shah-Hosseini, 2007) is modified

Copyright © 2009 Inderscience Enterprises Ltd.

The amount of soil on the twists and turns along their paths. is also have memories for soil. 2 Basics of the IWDs the iteration-best solution TIB is found and it is used to By looking at rivers in nature. a path with less itercount is set to zero. One thing that makes us edges of the iteration-best solution TIB is reduced based on think is that why these twists have been created and is there the goodness (quality) of the solution. can begins another iteration with new IWDs but with the same we use the mechanisms that happen in rivers and as a result. the parameters are av = 1 . as = 1 . The algorithm stops when it reaches the maximum them? The IWD algorithm is a step in the direction to model number of iterations itermax or the total-best solution TTB a few actions that happen in natural rivers and then to reaches the expected quality. Section 3 introduces the IWD algorithm. An IWD flows from a source to a destination. One In the IWD algorithm. to pass from its current location to the next location. the goal is uniform random distribution on the soils of the available to obtain the global optimal solution and no near-optimal paths. IWDs are created with two main kind is those that remain constant during the lifetime of the properties: algorithm and they are called ‘static parameters’. It may be said that soil is the source material of near-optimal solutions. the IWD velocity is increased q(T TB ) = −∞ . algorithm. gradually by travelling on the nodes of the graph along the Concluding remarks are the final section of the paper. Moreover. Experimental results with the form of a graph (N. Therefore. One iteration of the algorithm is complete when all IWDs have completed their solutions. The IWD algorithm has two kinds of parameters. The next section reviews some processes that occur in a Therefore. Therefore.01 and cv = 1 . For soil updating. This needs to place n queens on a chessboard of size n × n such behaviour of path selection is implemented by imposing a that no two queens attack each other. inversely proportional to the soils of the available paths. The maximum number of iterations by the amount non-linearly proportional to the inverse of the itermax is specified by the user. Then. The iteration count soil between the two locations. During its trip. soil lets the IWD become faster than a path with more soil. and n-queen problems form Section 5. integer value. proportional to the inverse of the time needed for the IWD For velocity updating. MKPs. It should be reminded that the values chosen for the static parameters of the IWD algorithm are the same Both of the two properties may change during the lifetime used in Shah-Hosseini (2008) until specified otherwise. 2008) is used for some other the environment that are used with more IWDs will have MKPs to observe its power for getting optimal or less soil. paths with lower soils have higher chance to be river. E) of it removes some soil and it may gain some speed. the algorithm any logic or intelligence behind them? And if that is so. which are • velocity dynamic and they are reinitialised after each iteration of the • soil. explains IWDs that have been developed based on the ideas of natural water drops. of an IWD. velocity of the IWD and inversely proportional to the which is a small positive number less than one. Moreover. bs = . which involves the water drops of the river and selected by the IWD. implement them in a form of an algorithm. Shah-Hosseini to get better results for the TSPs. is set as . the time taken is proportional to the and cs = 1 . The number of water drops NIWD is set to a positive This soil is removed from the path joining the two locations. used here to test the performance of the IWD algorithm. E) with the node set N and edge set the proposed IWD algorithm for artificial and standard E. From its current total-best solution TTB is initially set to the worst value: location to its next location. information such that the environment and water drops both The n-queen problem. The An IWD needs a mechanism to select the path to its next IWD algorithm that is used for solving the n-queen is called location or step. soils on the paths of the graph and the whole process is can we design and develop intelligent algorithms based on repeated. This bv = . Section 4 3 The IWD algorithm shows how to use the IWD algorithm for solving three The IWD algorithm gets a representation of the problem in different optimisation problems. the IWD prefers the the ‘IWD-NQ’ algorithm. edges of the graph until the IWD finally completes its solution. The local soil updating parameter ρ n . The graph (N. An IWD the problem is given to the algorithm. After each iteration. we are surprised to see lots of update the total-best solution TTB. which uses IWDs for problem solving. it travels in the environment from which 1 Initialisation of static parameters. each IWD begins constructing its solution TSPs. the probability of the next path to select is solution is acceptable. those parts of algorithm (Shah-Hosseini. The other kind is those parameters of the algorithm. The n-queen puzzle (problem) paths having low soils to the paths having high soils. an NP-complete problem.01 time interval is calculated by the simple laws of physics for linear motion. which is usually set to the number of The amount of soil added to the IWD is non-linearly nodes Nc of the graph.72 H. In this mechanism. Thus. Then. An IWD gathers soil during its trip in the environment. The IWD algorithm is specified in the following steps: The IWD begins its trip with an initial velocity and zero soil. The quality of the is supposed to flow in discrete steps. Then. the IWD-MKP distance between the two locations.

3 For the IWD moving on the path from node i to changes are not constant and are dependent on the velocity j. j ) ) piIWD ( j ) = (1) 8 Update the total best solution TTB by the current ∑ f ( soil (i. add the newly visited node j to the list TTB. l )) else 10 The algorithm stops here with the total-best solution Then. T IB = arg max IWD q (T IWD ) (5) ∀T 4 Update the visited node list of each IWD to include the nodes just visited. paths they flow over. The IWDs change soil on the the IWD. using the following ( N IB -1) probability piIWD ( j ) : where N IB is the number of nodes in the solution TIB. k ) ) iteration-best solution TIB using k∉vc ( IWD ) ⎧⎪T TB if q (T TB ) ≥ q(T IB ) such that T TB = ⎨ (7) IB 1 ⎪⎩ T otherwise f ( soil (i. for the application. j ) that the IWD and soil of the IWD visiting the paths.2 For each IWD moving from node i to node j. j ) of the path from node InitVel = 200.9 . j ) ∈ T IB vc( IWD) of the IWD. property of convergence in value (Shah-Hosseini. 1]. j) optimisation algorithms (Bonabeau et al. soil 2 (i. For the IWD-MKP. j ) All IWDs are set to have zero amount of soil. j. The initial velocity of each IWD is ( time i. compute the soil Δsoil (i. Every IWD has a visited node list Vc ( IWD) . j ) = (1 − ρn ) .1 For the IWD residing in node i.1 to 5. The global soil updating parameter ρ IWD . 2008). go to Step 2 if ⎪ l∉vc(IWD) g(soil (i. InitSoil = 10000 and 5. the IWDs loads from the path by may gain different velocities throughout an iteration of the IWD algorithm whereas in ant-based algorithms the velocities of the ants are irrelevant to the algorithm. f ( soil (i. j ) (4) Vc ( IWD) = { } . . soil (i.. vel IWD (t + 1) = ) HUD( j ) vel IWD (t + 1) where set to InitVel. soil that the IWD carries soil IWD by 2 Initialisation of dynamic parameters. l )) ≥ 0 Itercount = Itercount + 1 .4 Update the soil soil (i. Δsoil (i. j )) 9 Increment the iteration number by ⎧ soil (i. is set as ρ IWD = 0. bs + cs . It update its velocity vel IWD (t ) by means that the IWD algorithm is able to find the optimal solution if the number of iterations be sufficiently large. soil IWD = soil IWD + Δsoil (i. The intelligent water drops algorithm: a nature-inspired swarm-based optimisation algorithm 73 ρ n = 0. The ants in an ant colony optimisation algorithm deposit pheromones where vel IWD (t + 1) is the updated velocity of on the paths they move on.9 . where function q(. It is reminded that the IWD has been shown to have the 5. time 2 ( i. Here. However. which is initially empty: soil (i. iteration-best solution TIB by 5. which does not violate any constraints of soil (i. j)) = ⎨ Itercount < Itermax . 5 Repeat Steps 5.4 for those IWDs with partial 7 Update the soils on the paths that form the current solutions. ⎪⎩soil (i. 6 Find the iteration-best solution TIB from all the 3 Spread the IWDs randomly on the nodes of the graph as solutions TIWD found by the IWDs using their first visited nodes. j ) = InitSoil . soilIB ∀(i. j. 1999). j ) = (3) which is chosen from [0. av vel IWD (t + 1) = vel IWD (t ) + (2) The IWD algorithm may be compared to the ant-based bv + cv . j )) = and ε s + g ( soil (i. in contrast to the ants. vel IWD (t + 1) ) Moreover. j ) − ρn . Both parameters InitSoil and InitVel are the heuristic undesirability HUD(j) is defined user selected and they should be tuned experimentally appropriately for the given problem. these 5. i to j traversed by that IWD and also update the which is the same value used in Shah-Hosseini (2008). soil (i. choose the next node j. Moreover.) gives the quality of the solution. j) − l∉vcmin ( IWD) (soil (i. Each IWD’s velocity is set to InitVel. j ) = (1 + ρ IWD ) . . the initial soil on each path (edge) is denoted by the constant InitSoil such that the soil of the path such that between every two nodes i and j is set by soil (i. as Δsoil (i. j ) the problem and is not in the visited node list 1 IWD (6) − ρ IWD . Then. InitVel = 4 is used. vc( IWD ) . j) if min (soil (i.

the graph of the TSP is a every constant number of iterations. Then.. it is A modification to the IWD-TSP is proposed here to get assumed that the direct path between each two cities is an better tours and hopefully escape local optimums. Therefore.. the measure set N denotes the n cities of the TSP and the edge set E HUD(i. cn ) = ∑ d ( ci . cn ) 8-queen puzzle can be generalised to the n-queen puzzle in where TL (. The IWD changes the soil of node to node on the links of the graph. So. Shah-Hosseini 4 Solving problems by the IWD algorithm undirected graph (N... In the TSP. in summary. Therefore. column. The time. a solution requires that no (9) two queens occupy the same row. j ) measures the in the TSP is to find the tour with the minimum total length among all such possible tours. TL(... As a result. The goal of any optimisation 4.) is calculated by where α I is a small positive number chosen here as 0. The which n queens must be placed on an n × n chessboard such that no two queens attack each other (Watkins. E) where the node becomes small whereas for far cities i and j. In order to use the IWD algorithm for the TSP. j ) = ⎨ I I (11) this way until it gets to city cn. E). 1]. c2 . denotes the Euclidean which is visited twice to form a round trip (tour). A solution of the TSP having the graph (N. c2 . cn ) . c2 . Each link of the edge set E has an amount of soil. is proportional to the graph of the TSP is considered a complete graph. The tour length. near cities i and j. the soils of all complete undirected graph.. An IWD starts its tour from a random problem. E) is then an ordered set of n distinct cities. j ) becomes big. This list shown how to use the IWD algorithm for solving them. The salesman than the other paths: travels from city c1 to c2. So. which is taken for the denotes the paths between each two cities. The goal norm. the IWD constructs incrementally a solution to the positions of cities. For given map. Here. c2 .. cn* ) The 8-queen puzzle is the problem of putting eight chess with the minimum length among all possible tours: queens on an 8 × 8 chessboard such that no two queens are TL (T *) ≤ TL (c1 . cities of the TSP are changes the environment of the given problem. 2004). for following. c2* .1 The travelling salesman’s problem are not in the visited list Vc ( IWD) of the IWD. the heuristic measure HUD(i... He then returns to the first ⎪⎩ InitSoil otherwise city c1. A swarm of IWDs each link that it flows on while completing its tour. the TSP problem as mentioned above is viewed as a complete .2 The n-queen problem ( algorithm for the TSP is to find the tour T * = c1* . Thus. The problem should be presented to the IWD node and it visits other nodes using the links of the graph algorithm in the form of a graph and the IWDs actually go until it returns to the first node.. An IWD in the algorithm both searches and of the soils on the links.. An IWD can travel between nodes of the The IWD algorithm may be used to solve optimisation graph through these links and is able to change the amount problems. the constraint that each IWD never visits a the hope of finding optimal or near optimal solutions. paths of the graph problem are reinitialised again such that A TSP solution for an n-city problem may be the paths of the total-best solution TTB are given less soil represented by the tour T = ( c1 . denoted by solving the travelling salesman problem or the TSP. heuristic HUDTSP (i. After undirected path. By doing denoted by nodes of the graph.74 H.) returns the total length of the given tour. includes the cities visited so far by the IWD. a visited city list Vc ( IWD) is employed. or diagonal. the next possible cities for an IWD are selected from those cities that 4.. which are obtainable for the undesirability of an IWD to move from city i to city j. we specifically express the steps for The local heuristic for the TSP. The for every tour (c1 . The function . IWDs prefer to choose paths of TTB because less soil on its paths is such that cn +1 = c1 and the distance function d (.. N I . the IWD to pass from city i to city j. solution exists for n = 1 and n ≥ 4 . then from c2 to c3 and he continues ⎧⎪α Γ InitSoil for every (i. The tour T * is called the global optimum tour. a map of cities is given to the HUDTSP (i. every city has a direct path to another city. j ) .. The local heuristic HUDTSP (i. Moreover. has been suggested as follows: modification to the IWD-TSP in Shah-Hosseini (2007) is proposed... j ) = c(i ) − c( j ) (10) salesman and he is required to visit the entire cities one after the other to complete his tour such that in this tour every where c(k ) denotes the two dimensional positional vector city is visited only once except the first city of the tour for the city k. j ) .) which deposited. j ) A TSP is represented by a graph (N.1. In this paper. which is drawn from a uniform i =1 distribution in the interval [0..... computes the distance between two cities is often selected as the Euclidean distance. a HUDTSP (i. ci +1 ) (8) denotes a random number. Γ I n TL ( c1 . flows in the graph with the guidance of a local heuristic in For the TSP. j ) ∈ T TB soil (i.. which hold the physical that. cn ) able to attack each other. three different problems are stated and then it is the IWD. In this subsection. In the city twice in its tour must be kept satisfied.

j ) = (1 + r ) i− j − (12) 2 mod is the modulus function. for the n-queen problem. then the n-queen problem four steps: may be considered as a TSP. coming out of such The IWD algorithm for the n-queen problem is called local optima takes considerable iterations of the algorithm. 2. The symbol n denotes the number of cities 4. the proposed NQLS on the chessboard reduces the search space to n! where the algorithm is activated when the quality of the iteration-best symbol ‘!’ denotes the factorial.3): undirected TSP graph is created.2 if q(Tk ) = 0 . the ith row chosen by the ith queen is considered the ith city of the tour. This local search algorithm (12) and the local search algorithm NQLS. c2IB .1 Increment each city’s number (row) by one such IWD algorithm. It is hoped that the total-best iteration TTB have occupied. In summary. city of the tour. the second queen is placed on any ⎪⎩ 0 else row of the second column except the row of the first queen. where HUDNQ (i. The intelligent water drops algorithm: a nature-inspired swarm-based optimisation algorithm 75 One strategy to reduce the huge search space 64n in the such that n-queen problem is to place the n queens one by one on the chessboard such that the first queen is placed on any row of ⎧⎪1 if ci and c j attack each other attack (ci .. then set T0 = Tk and jump to Step problem. a complete 2. the proposed NQLS is expressed in chessboard is considered a city. if every row of the In the following. The 3. solution TTB becomes –1. only the final positions of queens on the 4.3 End loop. For this 2.1 to salesman. ‘IWD-NQ’ algorithm. …. cnIB with the quality q (T IB ) = −1 . n-queen problem is the solution in which no two queens attack each other and that is the desired solution. the final feasible (optimal) solution(s) is not wanted. the local 3 For k=1. Sometimes.3): 3. In this regard.. The second row chosen by the second queen is called the second ( ) T IB = c1IB . which has been called ‘n-queen local search’ or NQLS is activated only proposed above. n–1 do the following steps (Steps 3. c j ) (13) profit bi and resource (capacity) requirement ri such that i =1 j =i +1 . the quality of a solution T is 4. chessboard are desired to be found while the path to reach 2. The 3. As a result.. This incremental strategy of putting queens reaches the quality zero. no updating is implemented by this usually trapped in the local optima in which only two algorithm. The first row chosen by the 1 Get the iteration-best solution with tour first queen is considered the first city of the tour.. c j ) = ⎨ (14) the first column. (columns or rows) of the chessboard of size n × n.3 The multiple knapsack problem given by The knapsack problem or KP (Kellerer et al. 2. then the total-best iteration solution TTB rows of neighbouring columns to be near the length n/2. Then. …. j ) is the undesirability of an IWD to go each city of the tour Tk −1 . queens attack each other. a simple local with the local heuristic HUDNQ (i. For the n-queen problem..3 End loop. Following this strategy. 2. it is observed experimentally has been obtained and is updated by TTB = T0.2 If q(Tk ) = 0 . is proposed as follows: that the highest row becomes the lowest row in n the chessboard: Tk = (Tk −1 + k ) mod n . when the iteration-best solution of the IWD algorithm contains only two queens attacking each other.1 Shift the cities in the tour one position to the In the n-queen problem. Moreover. that the IWD algorithm with the proposed local heuristic is otherwise. For an IWD to solve the n-queen problem.1 to heuristic undesirability HUDNQ (i. 1]. n–1 do the following steps (Steps 2. In the incremental strategy. The proposed IWD-NQ algorithm Using a good local search algorithm may help to come out uses the standard IWD algorithm mentioned in Section 3 of such local optima faster. heuristic of equation (12) favours the distance between the 4 If q(T0 ) = 0 . from current row (city) i to the next row (city) j. Continuing this way. the increment inside the parenthesis is applied to where HUDNQ (i. any feasible solution is also the right such that the last city becomes the first city optimal solution because any feasible solution for an in the tour: Tk = shift Right (Tk −1 ) . The 2 Set T0 = T IB . then set T0 = Tk and jump to Step variable r is a random number chosen uniformly from the interval [0. j ) defined in equation search algorithm is proposed. which is used in the 3. For the n-queen problem. 2004) is to n −1 n select a subset of items i of the set I each item i with the q(T ) = −∑ ∑ attack (ci . j ) . constraint that no two queens are in the same row is viewed as no two cities of the TSP graph are visited by the For k=1. the ith queen is placed on any row The optimal solution T* has the quality value zero: of the ith column except those rows that previous queens q(T *) = 0 .

requirements of item j are high.2 for the requires from knapsack j. 2008) is queens. It is seen that the number of iterations to get to the optimal The heuristic undesirability HUDMKP ( j ) that has been solution(s) does not depend necessarily to the number of used in the IWD-MKP algorithm (Shah-Hosseini. The first set of words. 2. In this figure. the TSP and the MKP.893 in ten runs. Therefore. in where n is increased from ten to 100 by increments of ten. constraints.. Let the variable rij represents the resource 5 Experimental results requirement of an item i with respect to the resource The IWD algorithm is used for three different problems: constraint (knapsack) j having the capacity a j . there exists algorithm mentioned in Section 3 and the local heuristic multiple knapsacks and thus there are multiple resource HUDMKP ( j ) defined in equation (17) to solve the MKP. queens is composed of a subset of n items. the average number of iterations for defined as follows: the 90-queen problem is bigger than the 100-queen problem. For example. Let the HUDMKP ( j ) for the MKP be defined as with 100. the number of IWDs is kept constant with 50 i =1 IWDs. The multiple or multidimensional knapsack problem. The minimum and maximum . HUDMKP ( j ) represents how undesirable is the iterations 4. the knapsacks.1 } for i = 1. As a result. The inclusion of an item i in the m knapsacks is denoted by setting the variable yi to one. For the MKP. Shah-Hosseini they all fit in a knapsack of limited capacity and the sum of action of selecting item j as the next item to be included in profits of the selected items is maximised. Equation iterations increases as the number of queens is increased. the items with The IWD-NQ algorithm is tested with the 200-queens less resource requirements and higher profits are more problem using 50 IWDs and it gets an average number of desirable. the order of Note: The results shown here are the average iterations selecting items in the solution of the MKP is not important of ten runs of the proposed IWD-NQ algorithm and not all items may be included in the solution. the results for best performance (lowest iterations) in ten runs depend on the number of queens and high whereas HUDMKP ( j ) increases if the resource often increase with increase in the number of queens. E) where the 1000 node set N denotes the items of the MKP and the edge set E denotes the arcs (paths) between the items (nodes). m . (16) n-queen puzzle (see online version for colours) i =1 3000 where yi ∈ { 0.. In these max ∑ yi bi (15) experiments. the number of resource requirement for item j from knapsack k. In other n-queen puzzle. The IWD-NQ has a simple heuristic and a (knapsacks) and n items wants to maximise the total profit plain local search algorithm to escape from local optimums. (17) shows that HUDMKP ( j ) decreases if the profit b j is Therefore.. otherwise yi is set to zero. the profits bi 2500 and the resources requirements rij are non-negative values. subject to the following constraints: Figure 1 The average number of iterations to get to the global n optimal solution versus the number of queens for the ∑ rij yi ≤ a j for j = 1. the lowest numbers of iterations in ten runs of the IWD-NQ algorithm Where b j denotes the profit of item j and r jk is the are shown in Figure 2.... rij represents the amount of capacity that item i experiments is used to test the capabilities of the proposed IWD-NQ algorithm introduced in Section 4. which maximises the profit defined in equation (15). 2. of including a subset of the n items in the knapsacks without The IWD-NQ is tested with ten different n-queens puzzle surpassing the capacities of the knapsacks. Here. A 500 feasible solution is a set of N ′ items such that they do not 0 violate the constraints in equation (16) and N ′ ⊆ N . the optimal solution is also a feasible solution and it 70 80 90 100 no.76 H.. The IWD-MKP algorithm uses the standard IWD MKP. the search 1500 space of the problem is viewed as a graph (N. A simple local heuristic is used which reflects the One reason is that getting out of the local optimal solution undesirability of adding an item to the current partial for the case with 90 queens is more difficult than the case solution. In the MKP. For the 10 20 30 40 50 60 MKP. k =1 For the aforementioned experiments. is a generalisation of the KP. more specific terms: The average number of iterations for the ten runs of each n n-queen puzzle is depicted in Figure 1.. n . In other words. The MKP with m constraints n-queen puzzle. the proposed local heuristic of m equation (12) works better for some number of queens than 1 HUDMKP ( j ) = mb j ∑ rjk . 2000 Iteratio n s To solve the MKP using the IWD algorithm. (17) the others.

The best tours of with NI = 15. the best run of the IWD-MKP algorithm converges obtained. The IWD-MKP is tested with eight problems in file number of IWDs used for all experiments of Figure 3 is 50. The almost monotonically increases. queens Note: The results shown here are the average numbers of iterations of ten runs of the MIWD-TSP algorithm The local optimums of the n-queen problem should be thoroughly analysed and based on the analyses some more Four TSPs are chosen from the TSPLIB95 (the TSP library efficient local search algorithms should be designed to help in the internet) to test the capability of the MIWD-TSP the IWD to escape from the local optimums. 10. IWD-MKP algorithm finds the global optimums for the first It is reminded that the IWD-TSP in Shah-Hosseini six MKPs with two constraints and 28 items. Figure 3 The average number of iterations to get to the global Figure 2 The minimum number of iterations to get to the global optimal solution versus the number of cities of the TSP optimal solution versus the number of queens for the problem where cities equally spaced on the perimeter n-queen puzzle in ten runs of the proposed IWD-NQ of a circle (see online version for colours) algorithm (see online version for colours) 500 700 400 600 Iteratio n s 500 300 Iteratio n s 400 200 300 100 200 100 0 0 10 20 30 40 10 20 50 60 30 40 70 80 50 90 100 60 70 No. The for the 20-city problem. in one of the runs of the IWD-TSP ‘WEING8’ with two constraints and 105 items obtained by for the 10-city problem. For example. It is seen that there is a wide gap between the However. It is reminded algorithm.txt’ of the OR-library (the OR-library in the It is seen that as the number of cities increases. we call this Modified the TSPs in five runs of the MIWD-TSP algorithm are IWD-TSP or ‘MIWD-TSP’. so large that it is impractical to use the IWD-TSP for them. For each MKP. One reason optimum for the toy problem as reported in Shah-Hosseini of such a wide gap in the number of iterations is that some (2008). For example. It is seen in Figure 4 that the tours MIWD-TSP algorithm is executed for a number of cities have no self-crossing regions and thus the MIWD-TSP that are placed on the perimeter of a circle in equal distances solves the self-crossing that sometimes happen in the from each other. In summary.964 and 13.3. . ‘mknap2. The iterations to get to the global optimums are depicted. respectively. the (2007) gets stuck in some hard local optimums for the cities qualities of solutions of the problems ‘WEING7’ and on a circle. 2008) mentioned in Section 4. The first experiment with the depicted in Figure 4. local optimums. for the qualities of optimal solutions are known for the eight MKPs 10-city problem. the average number of iterations 2046 is obtained runs of the IWD algorithm are depicted in Figure 5. the average number 387 is figure. The algorithm is tested for different IWD-TSP experiments in Shah-Hosseini (2007). In the whereas for the MIWD-TSP. The lengths of average and best tours in five runs that better local heuristics may make the algorithm converge of the MIWD-TSP algorithm are reported in Table 1. 39. cities 80 90 100 no. However. The results of this experiment are IWD-MKP algorithm having the local heuristic shown in Figure 3 in which the average numbers of (Shah-Hosseini. To avoid the confusion. the qualities of iteration-best solutions for five problem. The intelligent water drops algorithm: a nature-inspired swarm-based optimisation algorithm 77 number of iterations in these ten runs are 1. the lengths of best tours of some other of hard local optimums. For the circle TSP with more cities.6 average iterations are needed.1 and the modification introduced in equation (11) are comparable to the other metaheuristics. the IWD-TSP works well in finding a good local minimum and maximum number of iterations. Moreover. the large iteration number 22275 is the IWD-MKP are very close to the qualities of optimal observed whereas the largest iteration number of the solutions. The table The next set of experiments is implemented with the shows that the tours obtained by the MIWD-TSP algorithm IWD-TSP algorithm with the local heuristic mentioned in are satisfactorily close to the known optimum solutions and Section 4.597. number of cities on the circle from ten to 100 cities The final set of experiments is executed with the incremented by ten. the MIWD-TSP algorithm is much of the local optimums are harder to escape from than other more efficient for the toy TSP problem. For the problem ‘WEING4’ with two constraints MIWD-TSP in ten runs is 33. the best and the average qualities number of iterations to find the relevant optimal solution of ten runs of the IWD-MKP are reported in Table 2. the average to the optimum solution 119377 in 12 iterations whereas its numbers of iterations to get to the global optimums become worst run converges in 60 iterations. for the 20-city and 28 items.4 average iterations are needed whereas and are mentioned in the table for comparison. For faster to the global optimum and/or may reduce the number comparison. the average internet). metaheuristics are also mentioned in Table 1.

txt’ which are solved by the IWD-MKP algorithm Quality of Quality of the No.62 677. of iterations of the Constraints × IWD-MKP’s solution IWD-MKP Problem name optimum variables solution Best Average Best Average WEING1 2 × 28 141278 141278 141278 59 1243.9 200 200 Note: The global optimal solutions are also mentioned.. BCO (Teodorovic et al.23 st70 675 – 678. 4500 for eil76 and 6000 for st70 and kroA100 Table 2 Some of the problems of the OR-library in file ‘mknap2.08 kroA100 21282 21282 21441.62 eil76 538 – – 544. 2005).10 677.4 WEING3 2 × 28 95677 95677 95677 314 609..txt’ mentioned in Table 1.57 21904. 1996).8 WEING4 2 × 28 119337 119337 119337 4 48. 2006) for the four TSPs mentioned below Method Problem Optimum name length MIWD-TSP MMAS BCO EA Improved ACO Best Average eil51 426 426 431.03 Notes: The MIWD-TSP iterations: 3000 for eil51.5 WEING5 2 × 28 98796 98796 98796 118 698. Figure 5 Convergence curves of five runs of the IWD-MKP Figure 4 The best tours of five runs of the MIWD-TSP algorithm for the MKP ‘WEING4’ in file ‘mknap2.10 684. 2006).36 – 549.78 H. Improved ACO (Song et al. .98 432. (a) the tour of eil51 (b) the tour of the OR-library with the global optimum 119337 of eil76 (c) the tour of st70 (d) the tour of kroA100 120000 100000 80000 Q u a l i ty 60000 40000 20000 0 1 6 11 16 21 26 31 36 41 46 51 Iterations 56 Note: Each curve in the figure shows one run of the algorithm.44 – 21407.10 677.3 WEING7 2 × 105 1095445 1094736 1094223 100 100 WEING8 2 × 105 624319 620872 617897.87 428. Shah-Hosseini Table 1 The comparison between the MIWD-TSP and four other metaheuristics MMAS (Stutzle and Hoos.8 WEING2 2 × 28 130883 130883 130883 154 618.13 – 428.5 WEING6 2 × 28 130623 130623 130623 71 970..96 558.5 21285. EA (Yan et al.

T. After enough iterations of the Sato. the IWD algorithm is used for Vancouver. (2003) Introduction to Evolutionary solutions in the environment of the given problem. and Kennedy. and Cybernetics. optimization method for solving the multiple knapsack The IWD algorithm is modified for the TSP problem problem’. NEUREL-2006. 1. It is shown that the MKP-NQ drops’. However. Serbia. an IWD gains some velocity and removes some http://people. the TSP and the MKP. Oxford University Press. August. Nagoya. . pp. M. Science. Then. IEEE Int. pp. M. (2008) ‘Intelligent water drops algorithm: a new reduced. E. Princeton University Press. Springer-Verlag. L. 2nd ed. References Adleman. among the obtained solutions.uk/~mastjjb/jeb/orlib/files. Pferschy. H.M. pp. Princeton. and Pisinger. It also demonstrates that the nature is an TSP library. and Kang. The intelligent water drops algorithm: a nature-inspired swarm-based optimisation algorithm 79 6 Conclusions Eberhart. the best one Kellerer. (2003) ‘An electro-magnetism-like mechanism for global optimization’. and Hagiwara..E. X-S. July. is a neural network based on artificial immune system’. X.uni- excellent teacher for designing and inventing new heidelberg. J. Proc. U. S.1145–1148. H. Conf. by soil removal. (1999) Neural Networks: A Comprehensive problem by moving on the graph representation of the Foundation. Li.1021–1023. Prentice-Hall. FG Intellektik. and Smith. M. (1996) ‘Improving the ant system: a detailed report on the MAX-MIN ant system’. of the Sixth Int. (1997) ‘Bee system: finding solution by IWD algorithm. H. and Hoos. pp. Proc. New York. Germany. Springer. NY.3226–3231. During each iteration of the IWD OR-library. Bonabeau. algorithm can find the global optimal solutions of the Swissotel The Stamford. or near optimal solutions for the given MKPs.. (1994) ‘Molecular computation of solutions to combinatorial problem’. 2. by suggesting better heuristics pp. G. on Intelligent Systems Design and Applications. embedding ‘Bee colony optimization: principles and applications’. This paper indicates that the IWD algorithm is capable Stutzle. (1999) Swarm Intelligence: From Natural to Artificial Systems. J. on Machine Learning Beheshti University. B. Computing. and Orco. of the Fourth Int. J. R. Journal of Intelligent Computing and and this MIWD-TSP gets better tours with shorter lengths in Cybernetics. Proc. Vol. pp. However. I. (2004) Across the Board: The Mathematics of Chessboard Problems. pp. (2007) ‘Problem solving by intelligent water local search algorithm. Lucic. Prentice-Hall.ac. H.. Here. TU Darmstadt. Singapore. D. pp. Proc. P. IEEE Congress on Evolutionary Computation.informatik.. Journal of Global Optimization. Int. (2005) ‘A fast evolutionary algorithm for combinatorial optimization This work has been supported by a research grant of Shahid problem’. H. Markovic. (2006) ‘The time adaptive self-organizing map IWD algorithm. G. T. Japan. L-S. A. Canada. (2004) Knapsack in terms of quality is chosen and its total path is reinforced Problems.brunel.E. pp. Dorigo. Acknowledgements Yan.. NJ. 25.1007–1014. comparison to the standard MKP-TSP algorithm. (2006) for modifications in the standard algorithm. and it is observed that the algorithm is able to find optimal Conf. September. Three different problems are used to experiment the Shah-Hosseini. (2006) ‘Improved ant colony some new MKPs are tested with the IWD-MKP algorithm algorithm and its applications in TSP’. Dorigo. for the first time. soil from the path it flows on. Cai. and Theraultz.39–43.263–282. 8th other mechanisms that exist in natural rivers and/or Seminar on Neural Network Applications in Electrical inventing local heuristics that fit better with the IWD Engineering. and local search algorithms the number of iterations may be Shah-Hosseini. September. T. Conf. H. (2004) Ant Colony Optimization. M. No. swarm-based optimisation algorithms. IEEE World Congress on Computational Intelligence.de/groups/comopt/software/TSPLIB95/STSP. S. D. each IWD constructs incrementally a solution to the Haykin. (1995) ‘A new optimizer using particle swarm theory’.3288–3292.. Birbil.3954–3959.C.C. on Computational decoded to good solutions of the problem. Proc. Sixth Int. Symposium on Micro The IWD algorithm is an optimisation algorithm that uses a Machine and Human Science. good or optimal qualities.. swarm of water drops to collectively search for optimal Eiben. and Yang. the IWDs find the good paths that are a concentrated search’. and Fang. Cybernetics and Simulation.html.25–27. and Stutzle. available at http://www.193–212. Li. Available at algorithm. Watkins. algorithm.. Moreover. Z-H. there is an open space Teodorovic. the n-queen puzzle. n-queen puzzle. Vol. In fact. problem. Song. H. solving n-queen problems having a simple heuristic and a Shah-Hosseini.D. Technical to deal with optimisation problems in finding solutions with Report AIDA 96-12. pp.