Computer Algorithms inspired by the Animal Kingdom
In the field of Research and Development, the most valuable source of inspiration comes from nature itself. Animals, insects, vermin, micro-organisms all of them exhibit certain working principles that inspires the modern day science to develop and provide ingenious ideas to achieve advancements in the field of Science. So popular has this research grown out that a branch of Science has been specifically dedicated for this type of research and is known as Bionics. Scientists from the fields of computer science and operations research are consistently conducting various researches over the behavior of different organisms to explore diversified possibilities in order tackle various numerical problems. Considered here are a few such examples that have introduced a whole new paradigm in the field of research and development.
Ant Colony Optimization (ACO)
Inspired from Ants, the ACO is an algorithm that is based on probabilistic technique used to strong>solve computational problems. ACO is used to determine reasonably better paths to follow through graphs. Appearing for the first time in the PhD research thesis of Marco Dorigo in 1992, the ACO is one of the swarm intelligence methods, tended to be a member of the ant colony algorithms family. Since the constitution of the algorithm, several problems have been formulated based upon the various aspects such as quadratic assignment to protein folding or routing vehicles, stochastic problems, multi-targets and parallel implementations which are associated with the behavior of ants.
The principle behind ACO is based upon the working of ants in the nature. Basically ants wander around randomly in search of food (target). Once the food is located, they then return back to their colony while spreading pheromone trails on the way back hence forming a path. Such paths when found by the other ants, is then followed over instead of travelling randomly, thereby reinforcing the paths. Comparatively the shortest path is followed more by the ants, which increases the density of pheromone along the path and ultimately the shortest path is adopted as the optimal solution. A number of enhanced variations in ACO algorithms exist, some of them are mentioned here:
- Elitist ant system
- Max-Min ant system (MMAS)
- Rank-based ant system (ASrank)
- Continuous orthogonal ant colony (COAC)
- Recursive Ant Colony Optimization
The Bees Algorithm
Based upon the dynamics of population, the Bees algorithm is categorized as a search algorithm and it was developed in 2005 by a group of researchers from the Manufacturing Engineering Centre of Cardiff University in UK. The algorithm employs imitation of the food foraging behavior of honey bee colonies. The algorithm can be used to implement both combinatorial optimization and continuous optimization using a combination of the neighborhood search with the global search. A prerequisite for the implementation of the Bees Algorithm is that a slight hint of the topological distance between the solutions must be defined in order to acquire satisfactory results.
In nature, a small number of scout bees, from a bee colony, constantly search for rich flower sources. As soon as they find one, they return back to their hive and inform others about it by performing a ritual known as waggle dance. The duration of this dance performance is directly proportional to the potential of food source. So if the source is highly rich, the dance will tend to last longer, thereby informing more number of bees about the source. Due to this autocatalytic process, the bee colony is able to focus its foraging effort on the most profitable flower patches instantaneously. Working on the same pattern the Bees Algorithm follows the foraging strategy of honey bees to opt for the best possible solution in an optimization problem. Further applications of the Bee algorithm include and are not limited to:
- Optimization of classifiers / clustering systems
- Multi-objective optimization
Formularized for the first time in 1834 by Peter Gustav Lejeune Dirichlet, the pigeon principle is a mathematics problem, which states that if n items are put into m pigeonholes provided n > m, then at least one pigeonhole will be containing more than a single item. The principle can be generalized by the example that "there must be at least two left gloves or two right gloves in a group of three gloves".
In the field of computer science, the pigeon hole principle can be estimated using this example where, the collisions in a hash table are inevitable because since the number of possible keys (i.e “n”) exceed the number of indices (i.e “m”) in an array, where a hashing algorithm cannot avoid such collisions. The principle helps in proving that any lossless compression algorithms, will make a few inputs larger if they make inputs smaller. Some examples which follow the Pigeon principle are given below:
- Softball team
- The birthday problem
Published for the first time in 1973 by the name of "The number of caterpillars" in Discrete Mathematics by Harary and Schwenk, the Caterpillar Tree is a tree in which all the vertices are within distance 1 of a central path. The following description provides the characterization of the Caterpillar Tree, [Source]:
- They are the trees for which removing the leaves and incident edges produces a path graph.
- They are the trees in which there exists a path that contains every node of degree two or more.
- They are the trees in which every node of degree at least three has at most two non-leaf neighbors.
- They are the trees that do not contain as a subgraph the graph formed by replacing every edge in the star graph K1, 3 by a path of length two.
- They are the connected graphs that can be drawn with their vertices on two parallel lines, with edges represented as non-crossing line segments that have one endpoint on each line.
- They are the trees whose square is a Hamiltonian graph. That is, in a caterpillar, there exists a cyclic sequence of all the vertices in which each adjacent pair of vertices in the sequence is at distance one or two from each other, and trees that are not caterpillars do not have such a sequence. A cycle of this type may be obtained by drawing the caterpillar on two parallel lines and concatenating the sequence of vertices on one line with the reverse of the sequence on the other line.
- They are the trees whose line graphs contain a Hamiltonian path; such a path may be obtained by the ordering of the edges in a two-line drawing of the tree. More generally the number of edges that need to be added to the line graph of an arbitrary tree so that it contains a Hamiltonian path (the size of its Hamiltonian completion) equals the minimum number of edge-disjoint caterpillars that the edges of the tree can be decomposed into.
- They are the connected graphs of path width one.
- They are the connected triangle-free interval graphs.
Caterpillar trees are known for their use in chemical graph theory where they represent the structure of benzenoid hydrocarbon molecules. In this representation, one forms a caterpillar where each edge corresponds to a 6-carbon ring in the molecular structure, and two edges are incident at a vertex whenever the corresponding rings belong to a sequence of rings connected end-to-end in the structure.
Maze Solving Algorithms
A number of various maze solving algorithms have been developed to automate the process of solving mazes. Mazes without any loops are known as standard or perfect mazes, and can be categorized as a tree according to the graph theory. Therefore most of the maze solving algorithms are very closely related to graph theory. Some of the maze solving algorithms are briefly explained here:1. Random mouse algorithm
A very simple yet quite slow algorithm where a simple root is directed to follow a straight line until it finds an obstruction. It then has to make a random decision either to turn left or right and move on. The robot ultimately is able to complete the maze, however, the method is quite slow and inefficient.2. Wall Follower
The wall follower is the best known algorithm to solve maze problems. If all the walls of maze are simply connected together, then by holding one hand against one wall of the maze, the player does not get lost and ultimately reaches a different exit. If there isn’t any exit available, the player will return back to the starting point (i.e. the entrance).3. Shortest path algorithm
When a maze can be solved through multiple choices, the need to find the shortest path to solve the maze, becomes inevitable to enhance efficiency. There are several algorithms to estimate the shortest path, and most of them are provided by the graph theory.Other algorithms include:
- Pledge algorithm
- Trémaux's algorithm
- Dead-end filling
- Recursive Algorithm
The random mouse, wall follower, Pledge, and Trémaux algorithms are designed to work around and solve the maze problem being inside the maze by a traveler without having any knowledge about the maze, whereas the dead-end filling and shortest path algorithms are designed to be used by a person or computer program that can have an overview of the whole maze at once and estimate the shortest path.
Some algorithms you may also find interesting:
a framework for sketching an objects outline from 2D images.
an algorithm for dynamic web search of web-pages.