20
INOM EXAMENSARBETE TEKNIK, GRUNDNIVÅ, 15 HP , STOCKHOLM SVERIGE 2018 A comparison of Intelligent Water Drops and Genetic Algorithm for maze solving JOHAN LEDÉUS JESPER LUNDHOLM KTH SKOLAN FÖR ELEKTROTEKNIK OCH DATAVETENSKAP

A comparison of Intelligent Water Drops and Genetic Algorithm …1214267/FULLTEXT02.pdf · 2018. 7. 10. · Referat Inom de bio-inspirerade algoritmerna nns bland annat evolution

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

  • INOM EXAMENSARBETE TEKNIK,GRUNDNIVÅ, 15 HP

    , STOCKHOLM SVERIGE 2018

    A comparison of Intelligent Water Drops and Genetic Algorithm for maze solving

    JOHAN LEDÉUS

    JESPER LUNDHOLM

    KTHSKOLAN FÖR ELEKTROTEKNIK OCH DATAVETENSKAP

  • A comparison of Intelligent Water Dropsand Genetic Algorithm for maze solving

    En jämförelse av Intelligenta Vattendroppar och GenetiskAlgoritm för att lösa labyrinter

    Johan LedéusJesper Lundholm

    DEGREE PROJECT IN COMPUTER SCIENCE, FIRST CYCLE

    Supervisor: Jeanette Hällgren KotaleskiExaminer: Örjan Ekeberg

    EECS KTH 2018-06-06

  • Abstract

    Evolutionary and swarm based algorithms are subsets of bio-inspiredalgorithms where Genetic Algorithm (GA) belongs to the former and In-telligent Water Drops (IWD) to the latter. In this report we investigatetheir ability to solve mazes with different complexity. As performancemeasures we compare solution quality and success rates. We find thatIWD outperforms GA on mazes of low complexity but results deteri-orate quickly as maze complexity increases. GA produces more stableresults, better solution quality and a higher success rate for high com-plexity mazes. Some potential improvements inspired by other works arediscussed. We conclude that examining different improvements throughstronger subordinate problem-specific heuristics is of interest.

    Referat

    Inom de bio-inspirerade algoritmerna finns bland annat evolutionäraoch svärmbaserade algoritmer. Genetisk Algoritm (GA) tillhör den förraoch Intelligenta Vattendroppar (IWD) den senare. I denna rapport un-dersöker vi dessa tv̊a algoritmers förm̊aga att lösa labyrinter av olikakomplexitet. För att mäta prestandan jämförs lösningskvaliteten samtandelen lösningar där destinationen n̊as. Vi finner att IWD utpresterarGA för labyrinter av l̊ag komplexitet men resultaten försämras snabbtnär komplexitetgraden stiger. För labyrinter av högre komplexitet produ-cerar GA stabilare resultat med bättre lösningskvalitet och högre andelacceptabla lösningar. N̊agra möjliga förbättrings̊atgärder som inspireratsav andras rapporter diskuteras. Sammanfattningsvis fastsl̊ar vi att vidareundersökning av olika förbättringar genom starkare underordnade prob-lemspecifika heuristiker är intressant.

  • Contents

    1 Introduction 11.1 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    2 Abbreviations 2

    3 Background 23.1 Genetic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 23.2 Intelligent Water Drops . . . . . . . . . . . . . . . . . . . . . . . 3

    3.2.1 Initialization phase . . . . . . . . . . . . . . . . . . . . . . 43.2.2 Iteration phase . . . . . . . . . . . . . . . . . . . . . . . . 53.2.3 Evaluation phase . . . . . . . . . . . . . . . . . . . . . . . 6

    4 Related works 7

    5 Methods 85.1 Design of the mazes . . . . . . . . . . . . . . . . . . . . . . . . . 85.2 Design of the Genetic Algorithm . . . . . . . . . . . . . . . . . . 85.3 Designing Intelligent water drops . . . . . . . . . . . . . . . . . . 95.4 Comparing Algorithms . . . . . . . . . . . . . . . . . . . . . . . . 10

    5.4.1 Performance measures . . . . . . . . . . . . . . . . . . . . 105.4.2 Solution quality . . . . . . . . . . . . . . . . . . . . . . . . 105.4.3 Evaluating algorithms . . . . . . . . . . . . . . . . . . . . 10

    6 Results 11

    7 Discussion 13

    8 Conclusion and recommendations 14

    References 14

  • 1 Introduction

    Bio inspired optimization algorithms are algorithms attempting to mimic bio-logical or natural systems to solve optimization problems. Finding the optimalsolution to a complex combinatorial optimization problem is in many cases un-feasible due to the large amount of computing power required. A class of meth-ods called meta-heuristics emerged to undertake this issue in the early 1980’s.(Osman & Kelly, 1996) Meta-heuristics use and combine different concepts cre-ated by mankind or found in nature. Two examples are artificial intelligenceand biological evolution. Meta-heuristics has since then been used with successin engineering applications and hard combinatorial problems (Padhye, 2012;Osman & Kelly, 1996). Genetic Algorithm (GA) and the other bio inspiredalgorithms belong to the meta-heuristic family among other methods such asSimulated Annealing (Osman & Kelly, 1996). They are characterized by theirability to find a near-optimal solution to optimization problems with little or noinitial knowledge of the search space (Binitha & Sathya, 2012; Osman & Kelly,1996).

    The family of bio inspired algorithms has grown quite large and is still ex-panding with new innovative ideas. Binitha and Sathya (2012) suggests that thefamily can be divided into three categories of evolutionary, swarm based andecology based algorithms. These can then be divided into further subgroupsbut for the purpose of this report only Genetic Algorithm of the evolutionarysubgroup and Intelligent Water Drops (IWD) of the swarm based subgroup willbe examined.

    Finding the shortest path in a graph is a problem that has many real worldapplications such as vehicle and network routing, circuit board design and morerecently in path planning in robotics (Hart, Nilsson & Raphael, 1968; Wang,1996). Both swarm based and evolutionary algorithms have been researchedwith promising results in robotic path planning for both two and three dimen-sional navigation (Lu, Gong & Pan, 2016; Garro, Sossa & Vazquez, 2006; Zhou,Qian & Cao, 2017; Duan, Liu & Lei, 2008; Zhang, Liu, Liu & Hu, 2008). An-other application of the shortest path problem (SPP) is the task of finding theshortest path between two points in a maze, which in many ways resemble thetwo-dimensional robotic path planning problem.

    1.1 Problem statement

    The purpose of this report is to investigate how the Intelligent Water Dropsand Genetic Algorithm with basic and similar subordinate heuristics compareagainst each other when applied to maze solving. More precisely, we intendto investigate if one algorithm outperforms the other across different sizes andcomplexities of the mazes. The result may be used when considering whichalgorithm to add a more complex subordinate heuristic to when doing mazesolving or similar constrained path optimization problems.

    1

  • 2 Abbreviations

    ACO Ant Colony OptimizationBFS Breadth-First SearchGA Genetic Algorithm

    IWD Intelligent Water DropSPP Shortest Path Problem

    3 Background

    Meta-heuristics as defined by Osman and Kelly (1996) guides a subordinateheuristic in the search for a near-optimal solution. Evolutionary and swarmbased algorithms attempts to iteratively improve a set of solutions using popu-lation knowledge and randomization (Eiben & Smith, 2015; Binitha & Sathya,2012), meaning they are stochastic. The local optimization is often performedwith a local search heuristic. When used across a population of solutions thisallows for a probability distribution to influence the next iteration based on thequality of each specific solution (Eiben & Smith, 2015; Binitha & Sathya, 2012).This section describes this process in more detail for the GA and IWD as wellas the general intuition behind them.

    3.1 Genetic Algorithm

    Genetic Algorithm proposed by Holland (1975) is a popular variant of Evolu-tionary Algorithms. It is inspired by the natural evolution and solves differentproblems with the concept of trial-and-error. Mitchell (1998) states that thereis no single specific definition of a genetic algorithm, but it is common thatgenetic algorithms have the following components:

    • Populations of chromosome strings (set of solutions).

    • Selection of chromosome strings according to a fitness function (quality ofsolution).

    • Crossover and mutation to generate new offspring.

    2

  • Figure 1: Flow chart for a genetic algorithm

    Figure 1 describes the general work-flow for a genetic algorithm (Eiben &Smith, 2015). Each step is described below.

    1. Initialize populations of chromosome strings.

    2. Evaluate each chromosome string with a fitness function. The fitnessfunction may vary depending on the problem to optimize.

    3. Selecting parent. The process of selecting chromosome string does not ne-cessarily need to be deterministic, i.e. always select chromosome stringwith the highest fitness value. The selection process could rather bestochastic and less fit individuals could be selected for future generations.

    4. Crossover: Two parents are selected to generate a pair of offsprings. Theymight exchange one or more genes within some probability.

    5. Mutation: Some of the chromosome strings are modified to obtain morediversity.

    6. Terminate: The algorithm terminates according to some termination cri-terion.

    The performance and outcome will depend on the population size, the prob-ability for crossover and how the mutation affects the chromosome strings.

    3.2 Intelligent Water Drops

    Based on the flow of water caused by gravity and the dynamics of river systems,the IWD algorithm was first proposed in 2007 by Hosseini (Hosseini, 2007). Ithas been shown to give good results on various NP-hard problems such as trav-elling salesman problem, multidimensional knapsack problem and the n-queenpuzzle (Shah-Hosseini, 2009). Water flowing in a river is constantly changing itsenvironment. Meanwhile, the environment itself affects the path of the water.When multiple paths are possible most of the water will follow the easiest path

    3

  • such that, if unobstructed, the path would be a straight line to the destina-tion. However, obstacles and curves in the terrain makes this an impossibilityin the real world. As the water flows through the system, it picks up soil fromthe riverbed and carries it to another location downstream, effectively changingthe environment for the water that follows. When soil is removed from oneplace, that location allows a greater volume of water which increases the flow.The increase in flow causes soil to be displaced faster, strengthening the effect.The inverse is also true, as soil gathers at the bottom the flow of water decreases.

    An Intelligent Water Drop has two properties:

    • An amount of soil it carries

    • Velocity

    The IWD also has the following behaviour when interacting with its environ-ment:

    • Drops move from a source to a destination in discrete steps of finite length

    • As the drop moves from one location to another it picks up soil propor-tional to its velocity

    • Drops prefer paths with less soil

    The algorithm is constructed consisting of three phases as seen in Figure 2.Initialization phase where the static and dynamic parameters are initialized.Iteration phase where the droplets iterate through the maze searching for asolution. Finally the evaluation phase where the constructed solutions from theprevious phase are evaluated and the global best solution gets reinforced or thealgorithm terminates if termination condition is met.

    Figure 2: Flow chart for IWD

    3.2.1 Initialization phase

    Initialize the static parameters of which values will not change during any ofthe phases:

    • Graph G(V,E)

    • NIWD: Population size, the number of IWDs

    • itermax: maximum number of iterations before termination

    • as, bs, cs: soil updating parameters

    • av, bv, cv: velocity updating parameters

    • InitV el: Constant for the initial velocity of each IWD

    4

  • • InitSoil: Constant for the initial soil on each edge

    • ρl: local soil updating parameter

    • ρg: global soil updating parameter

    Next, initialize the dynamic parameters. These will be reinitialized at the be-ginning of, and updated during, every run of the iteration phase. For each IWDdo the following:

    • Create an empty list of visited nodes

    • Set velocity to InitV el

    • Set the amount of soil carried to 0

    Finally, put all IWDs on the starting node.

    3.2.2 Iteration phase

    Each IWD moves from the current node i to the next node j ∈ J where

    J = {j | (i, j) ∈ E ∧ j /∈ vn(IWD)}

    and vn(IWD) is the visited nodes list of the IWD.

    1. If there are multiple possible nodes to move to, the selection is done withthe probability function pi(j) such that

    pi(j) =f(soil(i, j))h(j)∑

    k∈J(f(soil(i, k))h(k))(1)

    where h(j) ensures that candidate nodes closer to the goal are more likelyto be selected than those further away. h(j) is optional and not presentin the original algorithm. Furthermore,

    f(soil(i, j)) =1

    �+ g(soil(i, j))(2)

    where � is some small number to prevent division by zero and

    g(soil(i, j)) =

    soil(i, j) if minl∈J (soil(i, l)) ≥ 0soil(i, j)−minl∈J

    (soil(i, l)) otherwise(3)

    Add the selected next node to the visited nodes list of the IWD.

    2. When an IWD moves from node i to j, update the velocity according to:

    vel(IWD) = vel(IWD) +av

    bv + cv · soil(i, j)(4)

    where vel(IWD) is the velocity of the specific IWD.

    5

  • 3. Calculate ∆soil(i, j) which is the soil that the IWD absorbs from the edge(i, j).

    ∆soil(i, j) =as

    bs + cs · ( HUD(j)vel(IWD) )(5)

    HUD(j) is some problem-specific heuristic undesirability.

    4. Update soil(i, j) where the IWD has traversed the graph from i to j, alsoupdate soil(IWD) which is the soil that is carried by the IWD.

    soil(IWD) = soil(IWD) + ∆soil(i, j) (6)

    soil(i, j) = (1− ρl) · soil(i, j)− ρl ·∆soil(i, j) (7)

    5. Return to step 1 for all IWD that has not yet reached a solution

    3.2.3 Evaluation phase

    In the evaluation phase the set of solutions generated in the iterative phase isevaluated. The iteration-best solution is found and the edges that make up theiteration-best path have their soils updated. If the the iteration-best solution isbetter than the current total best, this is also updated.

    6. Find the iteration-best solution T IB according to some quality functionq(T IWD)

    7. Update the soil of the nodes that make up the iteration-best solution pathsuch that

    soil(i, j) = (1− ρg) · soil(i, j)− ρg ·1

    VIB − 1· soil(IWDIB) (8)

    where VIB is the number of nodes in TIB and soil(IWDIB) is the amount

    of soil the iteration-best IWD accumulated on the path.

    8. Update the total best TTB according to

    TTB =

    {TTB if q(TTB) ≤ q(T IB)T IB otherwise

    (9)

    9. If termination condition is met the algorithm terminates, otherwise returnto iteration phase.

    6

  • 4 Related works

    Yan and Yuan (2003) used the bio-inspired Ant Colony Optimization (ACO)algorithm to solve complex mazes. The ACO does in many ways resemble IWD,but instead of soil it uses a pheromone trail. They found that the simplest formof their algorithm did not find the exit, so improvements were suggested. Theproblem was that agents (ants) going into a dead end was returned to thestarting position which slowed the convergence down. This can be assumed toalso be a problem in the IWD. One proposed improvement was that when anagent went into a dead end, it traversed the path backwards until a new pathwas available. The last part of the path was then marked with the minimumpheromone amount to deter other agents from taking that path. The equivalentfor IWD would be to set the soil value to maximum.

    Salmanpour, Omranpour and Motameni (2013) used IWD to solve robotpath planning for small graphs. The robot path planning is similar to solving amaze of low density in this report. They proposed to run a second level of IWDon sub-paths of the iteration best solution which improved the solution quality.

    Abeysundara, Giritharan and Kodithuwakku (2005) conducted research onoptimizing the parameters in GA for the shortest path problem to find a plaus-ible solution. The generation transition was implemented with roulette rank,also known as fitness proportionate selection, to select parents for crossover. Inthe crossover stage they used a multi-point crossover with a 70%-90% probab-ility for a crossover. Elitism retained the fittest individuals, meaning that thefittest individuals survive for the next generation. 10% of the new generationwas mutated at a random position. The authors states that if the GA convergesto a solution it will be able to find a more diverse set of solutions within itssurroundings. There might be some obstacles with this approach. If the GAhas converged on a local optimum, the probability for the GA to find a morequalified solution is substantially decreased.

    Castelli, Manzoni and Vanneschi (2011) propose that you can increase theoptimization ability for GA by replacing a fraction of the worst individualsfrom the most recent generation by substituting them with some from an oldergeneration. The motivation for this approach is that later generations might bemore specialized and be stuck at local optimum, thus it increases the diversityof solutions. The conclusion from their study is that this approach will probablyperform better than GA’s using elitism.

    Eiben and Smith (2015) suggests a method in evolutionary algorithms inwhich populations evolve independently in tandem. After some generations ofevolution the independent populations exchange some individuals. This ap-proach may prevent early convergence but there are no guarantees.

    7

  • 5 Methods

    5.1 Design of the mazes

    Due to ease of implementation, a maze was represented by a matrix of cells.The cells are accessible through Cartesian coordinates and each cell is eitherempty or occupied by a wall. To gather data on the algorithms’ performance inmazes of varying complexity the concept of density is introduced. The densitylevels are low, medium and high. Low density means there is much open spacein the maze while high density only has aisles of width 1. An example of thedifferent densities can be seen in figure 3. Start and goal positions were alwayslocated in the top left and bottom right corner respectively, visible as the redsquares in figure 3.

    Figure 3: 35x35 maze of low, medium and high density

    5.2 Design of the Genetic Algorithm

    The Genetic Algorithm was implemented using 5 populations in tandem. Eachpopulation was set with the following properties.

    Representation of chromosomes: The encoding for a chromosome stringcan be seen in Figure 4, which represents a path in the maze from (1, 2) →(1, 3)→ (2, 3) and so forth.

    Figure 4: Encoding for a chromosome string

    Population size: The number of chromosome strings in each population was10.

    Initial population: Each chromosome string was given the start position inthe maze. The penalty term in the fitness function was set to 0.

    Mutation:

    1. Each chromosome string tried to explore the maze by taking 5 steps inrandom directions. If they reach a position they already visited they will

    8

  • be penalized. In that case the penalty term in the fitness function wasincreased by 5. This will decrease the probability for survival.

    2. 10% of the chromosome strings were randomly selected and for each ofthem a mutation occur at a random locus (position in chromosome string)with an evenly distributed probability. From that locus they tried to take10 steps in random directions. The penalty term was treated as describedabove.

    Fitness function:

    fit(j) = |dx − jx|+ |dy − jy|+ α · Vpath + penalty (10)

    where Vpath is the number of nodes in the current path, dx, dy are the coordin-ates of the destination and jx, jy are the coordinates of the current position.Just as in equation 11 this is the Manhattan distance from the current positionto the destination with the weighted path length added. α was set to 0.001

    Selection: The selection of 20 parents was based on the roulette wheel al-gorithm (Eiben & Smith, 2015). The probability of being selected is inverselyproportional to the fitness value generated by equation 10.

    Crossover: For each gene (node in solution path) the parents have in common,the probability for crossover was 70%. A crossover means that both parents splittheir respective chromosome string at the gene that they have in common. Theythen exchange the parts on one side of the break point.

    Evaluate and Select survivors: Elitism to retain 50% of the fittest chro-mosome strings. The penalty term was set to 0 for the offsprings.

    Running the algorithm with populations in tandem: If the solutionquality has not improved over the independent populations in 8 iterations. Eachpopulation exchanges their weakest chromosome string with the fittest chromo-some string from a randomly selected population. The algorithm terminates ifthere is no improvement over 10 iterations.

    5.3 Designing Intelligent water drops

    The IWD was implemented true to the original definition with the exceptionthat droplets can end up in situations where there are no candidate nodes tomove to. When this occurs the droplet was removed from the set of dropletswith partial solutions and its path is considered a solution for the iteration.

    Static parameters

    The static parameter values for the IWD algorithm used were: NIWD = 40, itermax =15, as = 1.0, bs = 0.01, cs = 1.0, av = 0.5, bv = 0.01, cv = 1.5, InitSoil =10000, InitV el = 200, ρl = 0.05, ρg = 0.15

    9

  • HUD

    Similar to the GA fitness function (equation 10), the HUD was defined as:

    HUD(j) = |dx − jx|+ |dy − jy|+ α · VIWD (11)

    where dx, dy are the coordinates of the destination, jx, jy are the coordinates ofthe node j and VIWD is the number of nodes in the visited list of the IWD. Thisis the Manhattan distance of j to the destination with the weighted path lengthadded to ensure that positions further away from the destination are deemedmore undesirable. α was set to 0.2.

    5.4 Comparing Algorithms

    5.4.1 Performance measures

    Eiben and Smith (2015) discuss performance measuring of evolutionary al-gorithms and mentions three basic measures: success rate, solution quality andefficiency.

    We gathered data on the difference in solution quality and success rate toanswer if one algorithm outperforms the other on mazes of varying complexityand size. The success rate is of interest because it is expected that neither ofthe algorithms will be able to always find a solution as the complexity and sizeof the maze increases. It is also a good indicator of early convergence. Thesolution quality shows how close to the optimal solution the algorithm got.

    Efficiency is dependent on many outside factors such as hardware, data struc-tures and implementation. Therefore, the efficiency measure is not gathered forour results.

    5.4.2 Solution quality

    If an algorithm was able to generate an acceptable solution the quality wasmeasured with the function in equation 12. An acceptable solution is any pathending at the goal position, regardless of length.

    Q(path) =VoptVpath

    (12)

    where Vpath is the number of nodes in the path and Vopt is the number ofnodes in the shortest path from start to goal. A BFS was used to find Vopt.

    This will normalize the solution quality into the range (0,1] where 1.0 in-dicates that an optimal solution was found. This is done to make results fromdifferent mazes comparable.

    5.4.3 Evaluating algorithms

    Mazes of 4 different dimensions and 3 different densities were randomly gener-ated. The dimensions were 15 × 15, 25 × 25, 35 × 35 and 45 × 45. For everydimension and density, 200 mazes were generated for a total of 600 mazes perdimension. Both algorithms then ran one time each on every maze. The result-ing paths (if found) were scored against the optimal solution using equation 12.Finally, the success rates were calculated for each density.

    10

  • 6 Results

    To compare solution quality and success rate of the IWD and GA with simplesubordinate heuristics, mazes of varying density were randomly generated andthe algorithms were given one attempt per maze to find the destination. 200mazes were tested for each dimension and density. The algorithms start in thetop left corner of the maze and the destination is always in the diagonally op-posed corner as seen in figure 3. The solutions were scored in the range (0,1] were1.0 is the optimal solution. The optimal solution is the lowest number of stepsthat has to be taken to traverse from the starting position to the destination.

    The figures in this section shows two diagrams. To the left is a box plot ofthe solution quality determined by equation 12 and to the right is the successrate where 1.0 indicates that the algorithm found a solution in 100% of the testsfor the specific density.

    Dimension 15x15

    Figure 5: Solution quality and success rates for 15×15 mazes

    As seen in figure 5, even with a relatively small maze the algorithms can convergeto a local optimum. The IWD algorithm had a higher success rate and bettersolution quality with more than 48% of the acquired solutions having an optimalpath length across all density levels. Furthermore, the density does not havemuch of an impact on success rate.

    11

  • Dimension 25x25

    Figure 6: Solution quality and success rates for 25×25 mazes

    Figure 6 shows that for low and medium density mazes the IWD delivers solu-tions of higher quality. For high density mazes the GA is slightly better with ahigher median value. The IWD has a higher success rate than the GA but asthe density increases the success rate for both algorithms decreases.

    Dimension 35x35

    Figure 7: Solution quality and success rates for 35×35 mazes

    For low density mazes the IWD has a higher success rate and solution qualityas seen in figure 7. For medium and high density mazes the GA will generatesolutions of a higher quality. The success rate of the IWD is decreased at ahigher rate than the GA as the density increases.

    12

  • Dimension 45x45

    Figure 8: Solution quality and success rates for 45×45 mazes

    In figure 8 we can see that the success rate of the IWD is still high for low densitymazes but for the medium and high density levels it is very low. This showsthat the droplets are struggling to make their way through the maze withoutgetting stuck. Note that the IWD has a success rate of 6.5% at the high densitylevel. This means that the box plot is based on a small sample size of just 13.The GA outperforms the IWD in solution quality across all densities.

    7 Discussion

    In this report both algorithms are constructed to be close to their most basicimplementation. The IWD is mostly true to the original implementation byHosseini (Hosseini, 2007) and as stated in section 3.1 there is no original defin-ition of a GA. Our GA is implemented using basic techniques. There are noadditional local search heuristics added during the crossover or mutation step.As with any heuristic approach to an NP-hard problem, the success is highlydependent on the heuristic. If the subordinate heuristics of the two algorithmsdiffer too much the result would not be of interest for comparing the meta-heuristic. Therefore the subordinate heuristics in both algorithms are simpleand similar. They differ in that the probability function in the IWD (equation 1)has a factor that slightly increases the chance of moving towards the destinationwhile GA moves in a completely random direction. The HUD (IWD, equation11) and fitness function (GA, equation 10) are identical except for the penaltyterm in equation 10. The penalty term makes the GA more prone to exploreinitially deteriorating fitness values which may help it escape local optimums.This may explain some of the success rate discrepancy. Both algorithms sharethe disadvantage that the quality assessment of a solution coupled with weak orabsent local heuristics creates a tendency to get stuck in local quality optimumsthat are not actually an acceptable solution. This is most likely what causes thelow success rates in the medium and high density levels for large mazes as seenin figure 8. To attempt to prevent the early convergence to local optimums,the technique suggested by Castelli et al. mentioned in section 4 could be aninteresting addition to the GA.As suspected, the IWD has the same problem with stuck agents as the ACO inthe report by Yan and Yuan mentioned in section 4. To improve the success rate

    13

  • of the IWD the technique of backtracking and marking dead ends as suggestedin the same report could be used. There is much potential for improvementwhich falls well in line with the conclusion in (Hosseini, 2007; Shah-Hosseini,2009). Also, both meta-heuristics are dependent on their parameters whichhave not been optimized for this report. The parameters can be optimized byrunning some optimization algorithm on the algorithms and their parametersthemselves but that was not in the scope of this report. It is also likely that theused parameters are better for some sizes and densities than others.

    The high success rate and solution quality for IWD when exploring lowdensity mazes indicates that the IWD is good at exploring search spaces wherethere is a reduced risk of ending up in a situation where there are no candidatenodes to move to. Such a situation forces the droplet to terminate prematurely.With a too strong local soil update, controlled by parameter ρl, the probabilityof converging to such a local optimum grows as other droplets will be morelikely to choose the path leading to that same dead end, further reinforcing theconvergence.

    8 Conclusion and recommendations

    Both algorithms compared in this report show potential for further improvementwhen it comes to solving mazes of varying densities. The results in this reportare not enough to conclude that one algorithm is definitively better than theother. For mazes of low density and size the IWD generated better solutionsand had a higher success rate. For larger mazes with medium and the highdensity the GA outperformed the IWD in solution quality.

    One thing to investigate further could be the parameters impact on theperformance of the algorithm for the specific problem of solving a maze. Neitherimplementation guarantees a near optimal or even acceptable solution. Nor aparticularly high success rate for mazes of higher dimension. For future work,we propose to look into a hybrid implementation or a stronger heuristic for thespecific problem, alternatively optimizing the parameters.

    References

    Abeysundara, S., Giritharan, B. & Kodithuwakku, S. (2005). A genetic al-gorithm approach to solve the shortest path problem for road maps. InProceedings of the international conference on information and automa-tion (pp. 272–275).

    Binitha, S. & Sathya, S. (2012). A survey of bio inspired optimization al-gorithms. 2, 137–151.

    Castelli, M., Manzoni, L. & Vanneschi, L. (2011). The effect of selection fromold populations in genetic algorithms. In Proceedings of the 13th annualconference companion on genetic and evolutionary computation (pp. 161–162). ACM.

    Duan, H., Liu, S. & Lei, X. (2008). Air robot path planning based on intelli-gent water drops optimization. In 2008 ieee international joint conferenceon neural networks (ieee world congress on computational intelligence)(pp. 1397–1401). doi:10.1109/IJCNN.2008.4633980

    14

  • Eiben, A. & Smith, J. (2015). Introduction to evolutionary computing. NaturalComputing Series. Berlin, Heidelberg: Springer Berlin Heidelberg.

    Garro, B. A., Sossa, H. & Vazquez, R. A. (2006). Path planning optimizationusing bio-inspirited algorithms. In 2006 fifth mexican international confer-ence on artificial intelligence (pp. 319–330). doi:10.1109/MICAI.2006.38

    Hart, P. E., Nilsson, N. J. & Raphael, B. (1968). A formal basis for the heuristicdetermination of minimum cost paths. IEEE Transactions on SystemsScience and Cybernetics, 4 (2), 100–107. doi:10.1109/TSSC.1968.300136

    Holland, J. H. (1975). Adaptation in natural and artificial systems. an introduct-ory analysis with application to biology, control, and artificial intelligence.Ann Arbor, MI: University of Michigan Press, 439–444.

    Hosseini, H. S. (2007). Problem solving by intelligent water drops. In Evolu-tionary computation, 2007. cec 2007. ieee congress on (pp. 3226–3231).IEEE.

    Lu, N., Gong, Y. & Pan, J. (2016). Path planning of mobile robot with pathrule mining based on ga. In 2016 chinese control and decision conference(ccdc) (pp. 1600–1604). doi:10.1109/CCDC.2016.7531239

    Mitchell, M. (1998). An introduction to genetic algorithms. MIT press.Osman, I. H. & Kelly, J. P. (1996). Meta-heuristics: An overview. In I. H. Osman

    & J. P. Kelly (Eds.), Meta-heuristics: Theory and applications (pp. 1–21).Boston, MA: Springer US. doi:10.1007/978-1-4613-1361-8 1

    Padhye, N. (2012). Evolutionary approaches for real world applications in 21stcentury. In Proceedings of the 14th annual conference companion on ge-netic and evolutionary computation (pp. 43–48). GECCO ’12. Philadelphia,Pennsylvania, USA: ACM. doi:10.1145/2330784.2330792

    Salmanpour, S., Omranpour, H. & Motameni, H. (2013). An intelligent waterdrops algorithm for solving robot path planning problem. In Computa-tional intelligence and informatics (cinti), 2013 ieee 14th internationalsymposium on (pp. 333–338). IEEE.

    Shah-Hosseini, H. (2009). Optimization with the nature-inspired intelligent wa-ter drops algorithm. In Evolutionary computation. InTech.

    Wang, J. (1996). A recurrent neural network for solving the shortest path prob-lem. IEEE Transactions on Circuits and Systems I: Fundamental Theoryand Applications, 43 (6), 482–486. doi:10.1109/81.503260

    Yan, Z. & Yuan, C.-W. (2003). Ant colony optimization for navigating com-plex labyrinths. In International workshop on rough sets, fuzzy sets, datamining, and granular-soft computing (pp. 445–448). Springer.

    Zhang, H., Liu, M., Liu, R. & Hu, T. (2008). Path planning of robot in three-dimensional grid environment based on genetic algorithms. In 2008 7thworld congress on intelligent control and automation (pp. 1010–1014).doi:10.1109/WCICA.2008.4593059

    Zhou, L., Qian, W. & Cao, G. (2017). An ant colony optimization algorithmfor three dimensional path planning. In 2017 international conference onsecurity, pattern analysis, and cybernetics (spac) (pp. 564–568). doi:10.1109/SPAC.2017.8304341

    15

  • www.kth.se