






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







This document contains Section 1 of Algorithm Concepts, a collection of algorithm concept descriptions in both Web page and print form under devel- opment at Rensselaer Polytechnic Institute by David R. Musser, with the aid of graduate research assistants Brian Osman, Michael LaSpina, and Mayuresh Kulkarni, and with significant participation also of students in the “Adopt an Algorithm” project in CSCI-4020 Computer Algorithms, Spring 2002 and Spring
Computational Method
Algorithm 1.
Input- Specialized 1.
Strategy- Specialized 1.
A computational method is a method for solving a specific type of problem by means of a finite set of steps operating on inputs, which are quantities given to it before execution of the steps begins or during executing, and producing one or more outputs, which have a specified relation to the inputs. The number of steps in the method is required to be not only finite but also independent of the inputs. (The program does not grow or shrink in response to the inputs, but it might have different variations for different types of inputs.) The method is also required to be resource constrained, which means there are requirements on all operations of all steps of the method that constrain the resources (time, space) that can used in executions of the method.
Execution of steps may repeat other steps, so that although the set of steps is finite, executions of them may produce an infinite sequence of steps—finite termi- nation is not a requirement (it is a requirement of the algorithm (§1.2) concept). Some nonterminating computational methods are useful, such as computer op- erating systems or event-driven simulation systems. Even though the execution of such methods does not terminate, we are still generally interested in bound- ing the number of steps taken in producing some partial output (as in proving response-time guarantees for an operating system).
In order to bound the resources—time and space—consumed during an execution of the method, we first need bounds on the resources consumed by individual steps. This motivates the resource-constraint requirement on computational methods.
Effectiveness of a computational method is the property that all operations of all steps of the method “must be sufficiently basic that they can in principle be done exactly and in a finite length of time.” (Knuth [1] adds “by someone using pencil and paper,” but it is a philosophical question whether humans have any computational capability beyond the effectiveness of machines.) As defined here, effectiveness of computational methods follows from their resource-constraint requirement.
Definiteness of a computational method is the property that each step of the method “must be precisely defined; the actions to be carried out must be rigor- ously and unambiguously specified for each case” [1]. This includes the property that it must be unambiguous which step, if any, follows the current step in any
Refinements: Algorithm Specialized by Input (§1.3), Algorithm Specialized by Strategy (§1.4).
Computational Method 1.
Algorithm 1.
Input- Specialized
Strategy- Specialized 1.
Sequence Algorithm 2.
Graph Algorithm 3.
Refinement of: Algorithm (§1.2)
This concept is a narrowing of the algorithm (§1.2) concept by restrictions on the form of input. Subconcepts restrict their input to some particular domain, such as sets, graphs, or linear sequences.
Refinements: Set Algorithm, Sequence Algorithm (§2.1), Polynomial Algo- rithm, Matrix Algorithm, Graph Algorithm (§3.1)
Computational Method 1.
Algorithm 1.
Input- Specialized 1.
Strategy- Specialized
Divide and Conquer 1.
Dynamic Programming 1.6 Greedy 1.7^ Iterative 1.
Refinement of: Algorithm (§1.2)
This concept is a narrowing of the algorithm (§1.2) concept in terms of strategies used in structuring the steps of the algorithm.
Refinements: Divide-and-Conquer Algorithm (§1.5), Dynamic Programming Algorithm (§1.6), Greedy Algorithm (§1.7), Iterative Algorithm (§1.8).
Algorithm 1.
Input- Specialized 1.
Strategy- Specialized 1.
Divide and Conquer 1.
Dynamic Programming Greedy 1.7^ Iterative 1.
Refinement of: Algorithm Specialized by Strategy (§1.4)
A dynamic programming algorithm is an algorithm which solves a given problem by combining solutions to smaller subproblems. The strategy depends on two characteristics of the problem to be solved, optimal substructure and overlapping subproblems.
Optimal substructure: A problem is said to have optimal substructure if the optimal solution to the problem contains within it optimal solutions to the contained subproblems.
Overlapping subproblems: A problem exhibits overlapping subproblems if the total number of subproblems required to assemble and solve the com- plete problem is “small,” generally polynomial in the input size. In other words, a naive recursive (top down) approach to the problem would recom- pute the solution to the subproblems many times.
Taking advantage of the above properties, a dynamic programming algorithm functions in a bottom up fashion. The overall strategy can be descibed as:
(a) Combine the solutions to the subproblems of a given size to compute and store the solutions to the next largest subproblems.
As can be seen, the solutions to the various subproblems are stored for repeated access in computing the solutions to larger subproblems. This storage is often done in some table, and dynamic programming is sometimes referred to as a tabular method.
This concept if one of many known ways of narrowing the algorithm concept in terms of a strategy (§1.4), which gives a specific strategy to the steps of the algorithm.
Algorithm 1.
Input- Specialized 1.
Strategy- Specialized 1.
Divide and Conquer 1.
Dynamic Programming 1.6 Greedy^ Iterative 1.
Refinement of: Algorithm Specialized by Strategy (§1.4)
Algorithm 1.
Input- Specialized 1.
Strategy- Specialized 1.
Divide and Conquer 1.
Dynamic Programming 1.6 Greedy 1.7^ Iterative
Refinement of: Algorithm Specialized by Strategy (§1.4)
An iterative algorithm is an algorithm which, throughout the course of execution, maintains some approximate output. As the name implies, the primary step in the strategy is to recalculate a new approximate output based on the previous approximation. In general, the approximate output grows closer to the final output (or solution) with each iteration, but this condition is not necessary.
Another important note is that an iterative algorithm must include some termina- tion criteria. There are many useful iterative procedures which are not algorithms without a change in their formulation. Without termination, they must be con- sidered iterative computational methods (§1.1).
This concept if one of many known ways of narrowing the algorithm concept in terms of a strategy (§1.4), which gives a specific strategy to the steps of the algorithm.
References
[1] Donald E. Knuth, The Art of Computer Programming, Vol. 1: Fundamental Algorithms, Third Edition, Addison-Wesley, Reading, MA, 1997.