An algorithm is a procedure for carrying out a task which, given an initial state, will terminate in a clearly defined end-state. It can be thought of as a recipe, or a step-by-step method, so that in following the steps of the algorithm one is guaranteed to find the solution or the answer. One commentator describes it as:[1]
“ | a finite procedure, written in a fixed symbolic vocabulary, governed by precise instructions, moving in discrete Steps 1, 2, 3, ..., whose execution requires no insight, cleverness, intuition, intelligence, or perspicuity, and that sooner or later comes to an end. | ” |
The name is derived from a corruption of Al-Khwārizmī, the Persian astronomer and mathematician who wrote a treatise in Arabic in 825 AD entitled: On Calculation with Hindu Numerals. This was translated into Latin in the 12th century as Algoritmi de numero Indorum. The title translates as "Al-Khwārizmī on the numbers of the Indians", with Algoritmi being the translator's rendition of the original author's name in Arabic. Later writers misunderstood the title, and treated Algoritmi as a Latin plural of the neologism Algoritmus or Algorithmus, and took its meaning to be 'calculation method'. In the Middle Ages there were many variations of this, such as alkorisms, algorisms, algorhythms etc.
There are two main current usages:
All algorithms must adhere to two rules -
There is a second type of algorithm - whereas most algorithms provably evaluate the most desirable end-state (for example, it is possible to mathematically prove that Dijkstra's algorithm gives the shortest route from one point to another) - others known as 'heuristic algorithms' cannot provably give the best solution (although they do give a fairly good result). While this may seem inferior, some problems are very difficult or even impossible to map out using normal algorithms, so heuristic ones are superior in these cases.
One aspect of algorithms implemented in computer programs is that of computational complexity, which denotes how efficient (fast) they are. Asymptotic Notation is the formal means of describing the running time of an algorithm and the size of its inputs.[2] The most commonly used notation is called "Big O", which is used to give an upper bound on the computational complexity of the routine. Some examples:
Algorithms can be categorized several ways.
Pathfinding algorithms are commonly used. For instance, route finding apps on cell phones use pathfinding to determine the quickest route between two points. A-Star and Dijkstra's algorithm are examples of pathfinding algorithms.
Algorithms which find local optimizations instead of global optimizations are referred to as greedy. Although they may not return an optimal result, they tend to execute much faster than non-greedy algorithms.
Sorting algorithms are used to order data.
Search algorithms find data matching a certain criteria, using some form of pattern matching, within a larger set of data.
Pattern matching algorithms are used to match different data. Regular Expressions are a way of describing a pattern and are commonly used for pattern matching algorithms.
An Evolutionary algorithm is a type of stochastic numerical analysis.
Numerical algorithms deal directly with numbers. They can be arithmetical (such as performing division), or seminumerical (such as generating random values). Note: Donald Knuth believed this was a more proper term for all numerical algorithms[3]
Dijkstra's algorithm finds the shortest path through a network, from one point to another.
The planarity algorithm is used to determine whether a given shape is 2-dimensional or not. It has found particular use in road and circuit board design to avoid cross-overs.
Critical path analysis is used to determine the fastest/most efficient way of completing a series of tasks, which often depend upon each other.
Kruskal's algorithm is used to find the minimum spanning tree in an network that you can see all of.
Prim's algorithm is used to find the minimum spanning tree when only some of a network is visible.
The Bellman-Ford algorithm is used to find the shortest path in a graph with negative weighted edges.
The Krim-Jacob algorithm is used to determine if a problem can be solved with abstract time and memory.
The Bin filling algorithm is used to find the most efficient way of combining several differently sized objects into a space(s) with a certain size. An example would be the problem of packing objects into the boot of a car; the bin-filling algorithm is in fact a mathematically formulated version of the rule of thumb 'put the big things in first'; but in can be used for many other problems - loading cars onto ferries, sending messages via routers on the internet, etc. It is a heuristic algorithm, as it does not give a provably maximal solution (the only way to do this, until Vijay Vazirani invented a new form of approximation algorithm, was to arrange the objects in every conceivable order).
Categories: [Mathematics]