Algorithms
  • Introduction
  • Algorithms
    • Insertion Sort
    • Shell Sort
    • Selection Sort
    • Heap Sort
    • Merge Sort
    • Quick Sort
    • Dual Pivot QuickSort
    • Radix Exchange Sort
  • Data Structures
    • Basic Datastructures
      • Table or Array
      • List
      • Linked List
      • Stack
      • Queue
      • Deque
      • Dictionary
      • HashTables
    • Trees
      • Tree
      • Binary Search Tree
      • Heap
      • Red-Black Trees
      • Splay Trees
      • Randomized Search Trees
    • Dynamic Programming
      • Fibonacci
      • Knapsack
      • Optimal Binary Search Trees
      • Longest Common Sub sequence
    • External Data Structures
      • B-Trees
      • Variants
    • Multi-dimensional Data Structures
      • Point-Region Quadtree
      • Point-Quadtrees
    • Priority Queues
      • Binomial Queues
  • Graphs
    • Basics
    • Depth First Search
    • Applications of Depth First Search
    • Breadth First Search
    • Shortest Paths
    • Transitive Closure
    • Flow Networks
    • Matching
  • Strings
    • Data Structures for Strings
      • Tries
        • Binary Tries
        • Multiway Trie
        • Patricia Tries
      • Variable Length-code
        • Elias Code
        • Gamma Code
        • Fibonacci Code
      • Huffmancode
      • Ternary Search Tree
    • Searching in Strings
      • Prefix Function
      • Knuth-Morris-Pratt
      • Boyer-Moore
      • Monte-Carlo Algorithms
      • Karp-Rabin
      • Automatons
      • Shift-AND
    • Indexing Text
      • Suffix Trees
      • Suffix Arrays
      • Search Engines & Inverted Files
  • P and NP
    • Introduction
    • SAT and 3-SAT
    • Graph Problems
    • Problems with Collections
    • Networks
    • Data storage
  • Metaheuristics
    • Trajectory Methods
      • Local Search
      • Simulated Annealing
      • Tabu Search
    • Population Based
      • Ant Colony
      • Evolutionary Computation
  • Sources
Powered by GitBook
On this page

Was this helpful?

  1. Metaheuristics
  2. Population Based

Ant Colony

The Ant Colony algorithm is based on the real life example of ants. Ants find the shortest path from the nest to a food source by putting "pheromone" on the ground. When they have to pick a direction, they will now choose the direction with higher probability paths that are marked by stronger pheromone concentrations. A few of the ants will randomly pick other directions, while most of them will follow the pheromone markers.

Algorithm

  1. InitPheromoneValues to a low value

  2. for every ant

    1. constructSolution based on the previously deposited pheromone trails. Most ants follow the existing trail, while some ants will follow a new trail. This is computated by a state transition rule.

  3. Apply this pheromone trail on the components of their chosen solution

  4. The total pheromone trail evaporates a bit based on the evaporation rate

/**
 * @author: Xavier Geerinck
 * @title: Heuristic - Ant Colony Optimization
 * @subtitle: 
 * @method: Ants find the shortest path from the nest to a food source by putting "pheromone" on the ground. When they have to pick a direction, they will now choose the direction with higher probabilith paths that are marked by stronger pheromone concentrations. A few of the ants will randomly pick other directions, while most of them will follow the pheromone markers.
 * 
 * @algorithm:
 * 1. InitPheromoneValues to a low value
 * 2. for every ant
 *     i. constructSolution based on the previously deposited pheromone trails. Most ants follow the existing trail, while some ants will follow a new trail. This is computated by a state transition rule.
 * 3. Apply this pheromone trail on the components of their chosen solution
 * 4. The total pheromone trail evaporates a bit based on the evaporation rate
 */
PreviousPopulation BasedNextEvolutionary Computation

Last updated 6 years ago

Was this helpful?