Download presentation
Presentation is loading. Please wait.
1
Weighted Quadratic Assignment Flocking
Everyone The Boids Evan Cooper Shelby, Sabrina Balcerak, Yujiemi Chisholm
2
Abstract The goal for this project is to model and study all possible migration paths for birds between recorded nesting sites in North Carolina, searching for an optimal path between nests that costs the flock of birds the least amount of energy to travel on, and seeing if the behavior of boids and swarm intelligence has any effect on finding an optimal solution. The algorithms used for study are: Random Search Algorithm Simulated Annealing Genetic Algorithm Ant System Algorithm Cooper
3
Background Terminology
Boids – an artificial life program which simulates the flocking behavior of birds. The name "boid" corresponds to a shortened version of "bird-oid object," which refers to a bird-like object. Boids are an example of emergent behavior; that is, the complexity of Boids arises from the interaction of individual agents (the boids, in this case) adhering to a set of simple rules. The rules applied in the simplest Boids world are as follows: Yujiemi Cohesion: Steer to move toward the average position of local flockmates Alignment: Steer towards the average heading of local flockmates Separation: Steer to avoid crowding local flockmates
4
Background Terminology
Optimization – An optimization problem is the problem of finding the best solution from all feasible solutions. Strong Branching – Strong branching involves testing which of the candidate variables give the best improvement to the objective function before actually branching on them. Quadratic Assignment – The problem models the following real-life problem: There are a set of n sites and a set of n locations. For each pair of locations, a distance is specified and for each pair of nesting sites a weight or flow is specified (e.g., the amount of birds flying between the two nesting sites). The problem is to assign all nesting sites to different locations with the goal of minimizing the sum of the distances multiplied by the corresponding flows. Yujiemi
5
Introduction Traveling Salesman (TSP) vs. Quadratic Assignment Problem – The traveling salesman problem is a problem in graph theory requiring the most efficient (i.e., least total distance) Hamiltonian cycle a salesman can take through a number of cities. The quadratic weighted assignment algorithm is different compared to TSP because, in addition to the distance traveled between cities, there is an additional factor (namely a “weight”) that contributes to the calculated distance. For our project, the “weighting factor” will be the number of birds present in the flock that must travel from one site to another. Sabrina
6
Previous Work Computer graphics expert Craig Reynolds developed the original flocking algorithm in 1986. Many animations of Hollywood base flocking on the outstanding and exciting visuals produced by the flocking characteristics of separation, alignment, and cohesion. The movie Batman Returns (1992) used the Boid characteristic rules to produce the incredible animation of bat swarms. A vast amount of previous research and present applications, such as sequential order problems, internet and vehicle routing, communications and tracking, medical data classification, and heating systems use the knowledge attained from work done involving boids and swarm intelligence. Sabrina Craig Reynolds Original 1986 Boids simulation:
7
Informal Problem Statement
Given a group of birds consisting of between 0 and 100 birds, and a group of 90 nesting sites in a test space, find the path with the lowest total weighted energy consumption between a set of nesting sites such that each time the group of birds comes to a nesting site, a specific amount of number of birds are dropped off at the site depending on the carrying capacity at each site. Yujiemi
8
Formal Problem Statement
Let G be a specified test space. Let bi be a single bird within G. Let B be the set of all birds within G Let vi be a single nesting site within G. Let V be the set of all nesting sites within G Let Lvi be the carrying capacity at some site vi Let eij be an edge connecting some vi and some vj. Let E be the set of all possible edges within G Let εij be the magnitude of an edge connecting some vi and some vj, or the distance between some vi and some vj. Let Pij be a set of consecutive edges connecting some vi to some vj Let Bi be a subset of B that represents the birds remaining in B after visiting the ith site in a particular path. Given these characteristics, MINIMIZE: Σ (Bi * εij) For i = 1…k Cooper
9
Constraints 𝑉 =90 0< 𝐵 <100 0≤ 𝐿 𝑣 < 𝐵 ∀ 𝑣∈𝑉
0≤ 𝐿 𝑣 < 𝐵 ∀ 𝑣∈𝑉 After any v is visited, the number of birds in B is decreased by the 𝐿 𝑣 found at that site The number of birds dropped off must be less than or equal to the 𝐿 𝑣 found at that site Cooper
10
Experimental Procedure
Retrieve spatial data of bird siting's and nesting sites in North Carolina from the Bird Breeding Survey website. Import the data into a .txt file. Generate ten randomly calculated carrying capacity .txt files for comparison during testing. Run each chosen algorithm in iterations of 100, 1000 and repetitions for each of the carrying capacity files Calculate the average and standard deviation best weight and elapsed run time for the carrying capacity files for each iteration value for every algorithm, and observe the results in bar graph format Run the test again to verify the results Sabrina
11
Test Space
12
Algorithms The algorithms used for this project fall into one of four categories: Stochastic – Stochastic algorithms are the most basic type of algorithm categories. Unlike other algorithms, stochastic algorithms aren’t “inspired” by any real-life behavior or phenomena. For this project, we will be using the Random Search Algorithm. Evolutionary – Evolutionary algorithms are inspired by the process of evolution through natural selection. These types of algorithms focus on systems that display characteristics of evolution to achieve an adaptive system. For this project, we will be using the Genetic Algorithm. Physical – Physical algorithms are based off real-life physical processes. Some physical processes of influence include metallurgy, music, and avalanches. For this project, we will be using Simulated Annealing. Swarm – Swarm algorithms are influenced by the “collective intelligence” of a system. The behavior is self-organizing and distributive across the environment. For this project, we will be using the Ant System Algorithm. Yujiemi
13
Random Search Algorithm
The Random Search Algorithm is a direct method for calculating a solution in a test space. The strategy uses a uniform distribution to sample solutions across a test space. It involves generating a number of randomly generate solutions, one after another, and then finding the most optimal result amongst all calculated solutions. Unlike most other algorithms, the result for a future calculate in a random search program isn’t dependent on the results of past calculations. Cooper
14
Random Search Algorithm Pseudocode
Set initial best weight Set initial best path (empty list) For repeat in max_iter: Generate random solution / path Calculate weight of solution Generate path list of solution If weight of solution > best weight: best weight = weight of solution Best path = path Return best weight Return best path
15
Random Search Algorithm
Cooper
16
Random Search Algorithm Results (Calculated Best Weights)
Carrying Capacity File # 100 Iterations 1000 Iterations 10000 Iterations 1 2 3 4 5 6 7 8 9 10 AVERAGE STANDARD DEVIATION Cooper
17
Random Search Algorithm Pros and Cons
Simple and fast to implement Good for simple and smaller data sets Not the best for finding global optimal solutions Cooper
18
Simulated Annealing Simulated Annealing is a probabilistic technique for approximating the global optimum of a given function. Specifically, it is a meta- heuristic to approximate global optimization in a large search space. The algorithm is inspired by the process of annealing in metallurgy, where a material is heated to a high temperature and then gradually cooled to minimize any defects or stress, as well as toughen the material by maximizing the number of crystals found in the material Whereas most local-search algorithms utilize strict criterion for finding best solutions, simulated annealing relaxes this criterion. The algorithm utilizes an initial “temperature” function to decide on optimal solutions. When the temperature is high, the acceptance rate of feasible solutions is high. As the temperature cools, the acceptance rate gradually decreases until an optimal global solution is found. For problems where finding an approximate global optimum is more important than finding a precise local optimum in a fixed amount of time, simulated annealing may be preferable Cooper
19
Simulated Annealing Pseudocode
Set starting temperature Set alpha (cooling factor) Set minimum temperature Produce an initial randomly generated solution Set best weight to weight of initial solution Set best path to path of initial solution While (temperature > minimum temperature): For repeat in max_iter: Randomly get a site in the test space New path = initial path Replace a randomly chosen site with the new chosen site Calculate weight of new path If new path weight > intial path weight: Best weight = new path weight Else: Acceptance probability = Math.exp[(new weight – intial weight)/temperature] If acceptance probability > randomly generated number between 0 and 1: Best weight = new weight Temperature *= alpha
20
Simulated Annealing Cooper
21
Simulated Annealing Results (Calculated Best Weight)
Carrying Capacity File # 100 Iterations 1000 Iterations 10000 Iterations 1 2 3 4 5 6 7 8 9 10 AVERAGE STANDARD DEVIATION Cooper
22
Simulated Annealing Pros and Cons
Able to escape from a local optima in order to find a better global solution Applicable to large data sets A large number of iterations may be required to achieve a global optimal solution Does not guarantee that an optimal solution will be found Cooper
23
Genetic Algorithm The Genetic Algorithm is commonly used to generate high-quality solutions to optimization and search problems by relying on biologically-inspired operators such as mutation, crossover and selection. In a genetic algorithm, a population of candidate solutions to an optimization problem is evolved toward better solutions. Each candidate solution has a set of properties which can be mutated and altered; traditionally, solutions are represented in binary as strings of 0s and 1s, but other encodings are also possible. Sabrina
24
Genetic Algorithm Pseudocode
Initialize a population with randomly generated solutions Initialize a best weight and best path For repeat in max iterations: Choose a random parent solution Calculate weight and path of parent solution Choose another random parent solution Calculate weight and path of second parent solution Cut both parent solutions at a specified location in the path Generate a child solution with the first part of the path filled by the first half of the cut from the first parent and the second part of the path filled by the second half of the cut from the second parent Calculate weight of child solution Generate a second child solution with the first part of the path filled by the first half of the cut from the second parent and the second part of the path filled by the second half of the cut from the first parent Calculate weight of second child solution If first child weight > second child weight: Set best child weight to first child weight Else if second child weight > first child weight: If best child weight > best weight: Best weight = best child weight
25
Genetic Algorithm Sabrina
26
Genetic Algorithm Results (Best Calculated Weight)
Carrying Capacity File # 100 Iterations 1000 Iterations 10000 Iterations 1 2 3 4 5 6 7 8 9 10 AVERAGE STANDARD DEVIATION Sabrina
27
Genetic Algorithm Pros and Cons
Able to compute a global optimal solution Performance speed is very slow and computationally expensive Sabrina
28
Ant System Algorithm The Ant System Algorithm utilizes the mechanism of stigmergy, inspired by the behavior of ants laying pheromones when looking for food In nature, ants wander randomly when searching for food. When food is found, an ant lays pheromones to mark the route. As more ants travel on the route, more pheromones are laid down. Pheromones on routes not travelled decay over time. Eventually, a best path is found from the ant-hill to the food source. For our project, in order to keep the flock together, the algorithm was modified to have the birds travel to a number of relatively close sites to their starting site. Yujiemi
29
Ant System Algorithm Pseudocode
NOTE: The above pseudocode is from an already existing Ant System Algorithm program written by Jason Brownlee, PhD that our group used to calculate the results. ALL CREDIT FOR THE PSEUDOCODE AND PROGRAM GOES TO JASON BROWNLEE, PhD
30
Ant System Algorithm Results (Best Weight)
Carrying Capacity File # 100 Iterations 1000 Iterations 10000 Iterations 1 2 3 4 5 6 7 8 9 10 AVERAGE STANDARD DEVIATION Yujiemi
31
Ant System Algorithm Pros and Cons
Efficient rank based system of finding optimal solutions Effective at finding a global optimal solution Computation time is very slow and costly Complex and challenging to understand Yujiemi
32
Algorithm Comparison Yujiemi
33
Algorithm Comparison Yujiemi (Note: The Ant System Algorithm is not shown due to excessive space needed to display the elapsed time on the graph above)
34
Error Consideration The nesting site latitude and longitude location points were given in decimal degree (DD) measurements, which takes into account the curvature of the Earth. Because of this, the measured distance between nesting sites might have been biased or calculated inaccurately. The Ant System Algorithm was modified from an already existing program written in the Ruby programming language. Because the members of the group aren’t proficient in the Ruby language, there may have been miscalculated values in for the algorithm. Because some of the site locations were very close to one another, there may have been a bias if the carrying capacity for locations relatively close to one another were high. Cooper
35
Conclusion From the tests run and the average best weight calculated, the Ant System Algorithm performed the best in terms of calculating a path with minimal energy consumption between nesting sites. However, the Ant System Algorithm also was the most expensive to run Since the original goal was to minimize the energy consumed, algorithms such as the Greedy Algorithm that take into account the distance between sites in localized areas in the test area performed better than algorithms that treat the data set as a global whole. Cooper
36
Future Work For our future work, we want to consider how real-life flocking and scenarios would affect the main criteria of the optimization of energy for migrating birds. Environmental factors such as weather, food consumption, the time of year, and predatory hazards within migration would be important to show how situations may contribute to relative shifts in our optimal analysis. Research on two or more specific species of flocking behavior to study the shifts of energy used. Aerodynamics (formation of birds): To show how less amount of energy can be used with different flocking formations, such as the benefits of the 'V' formation. Sabrina
37
Questions 1) What are the three fundamental characteristics used for modeling boids and flocking behavior? Cohesion, Alignment, and Separation 2) What differentiates a stochastic algorithm with other algorithms? Stochastic algorithms aren’t influenced by any real-life phenomena 3) How is the mechanism of stigmergy implemented in a number of swarm algorithms? When a feasible solution is found, pheromones are laid on the path for that solution to direct the members of the solution. Solutions with components travelled by more members of the swarm have the pheromone strength increased, whilst paths less travelled have their pheromones decayed over time. Eventually, an optimal solution is found after a number of iterations with the strongest pheromone collected. Everyone
38
Questions 4) What is the difference between the Traveling Salesman Problem and the Quadratic Assignment Problem? The quadratic weighted assignment algorithm is different compared to TSP because, in addition to the distance traveled between cities, there is an additional factor (namely a “weight”) that contributes to the calculated distance. 5) What is a major influence that goes toward defining swarm algorithms? The collective intelligence, which is a shared or group intelligence that emerges from the collaboration, collective efforts, and competition of many individuals, for example, bees and ants.
39
References Alerstam, Thomas. “Optimal bird migration revisited.” Journal für Ornithologie = Journal of Ornithology, Springer Verlag, 2011, 152 (S1), pp < /s >. <hal > Applegate, David, et al. The Traveling Salesman Problem: A Computational Study. Princeton, 2006. Brooks, Jeffrey, and David, Hibler. “The Genetic Flock Algorithm.” Science Direct, Procedia Computer Science. Elsevier B.V. 20: pp Brownlee, Jason. Clever Algorithms: Nature-inspired Programming Recipes Ebook. Camacho, Carlos. “Variations in flocking behavior from core to peripheral regions of a bird species’ distribution range.” Department of Evolutionary Ecology, Springer Verlag, 2011, 15: pp < DOI /s z> Eberhart, Russel, and James Kennedy. Swarm Intelligence. Morgan Kaufmann Publishers, 2001.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.