Computational Methods: Algorithm Concepts, Study Guides, Projects, Research of Algorithms and Programming

An introduction to computational methods, a type of problem-solving approach using a finite set of steps that operate on inputs and produce outputs. The concept of computational methods, its effectiveness and definiteness, and refinements such as algorithm, algorithm specialized by input, and algorithm specialized by strategy. It also discusses specific types of algorithms like divide-and-conquer, dynamic programming, greedy, and iterative algorithms.

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 08/09/2009

koofers-user-q4x
koofers-user-q4x šŸ‡ŗšŸ‡ø

5

(1)

9 documents

1 / 19

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Algorithm Concepts
David R. Musser Brian Osman
May 16, 2003
Click here for printer-friendly version
This document contains Section 1 of Algorithm Concepts, a collection
of algorithm concept descriptions in both Web page and print form under
development 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 2003.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download Computational Methods: Algorithm Concepts and more Study Guides, Projects, Research Algorithms and Programming in PDF only on Docsity!

Algorithm Concepts

David R. Musser Brian Osman

May 16, 2003

Click here for printer-friendly version

This document contains Section 1 of Algorithm Concepts, a collection of algorithm concept descriptions in both Web page and print form under development 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 2003.

  1. Basic Algorithm Concepts

1.1. Computational Method







  

 

















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

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 rigorously 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 execution of the method.

Again, resource-constraint requirements place some limitations on just how ā€œindefiniteā€ the steps of a method may be.

Refinements: Algorithm (§1.2)

1.2. Algorithm

 



 

 

 

 

 

 



Computational Method 1.

Algorithm

Specialized 1.3^ Input- Specialized 1.4Strategy-

Algorithm 2.1Sequence Algorithm 3.1Graph Conquer 1.5Divide & Programming 1.6Dynamic Greedy 1.

Refinement of: Computational Method (§1.1)

Finiteness of a computational method is the property that the number of steps in any execution of the method must be finite. The finiteness property is also called termination, and the method is said to be ter- minating. Algorithm is a synonym for finite computational method, a computational method (§1.1) with the additional property of finiteness. Every abstraction that belongs to an algorithm concept must have the termination property.

1.3. Algorithm Specialized by Input







  

  































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 Algorithm, Matrix Algorithm, Graph Algorithm (§3.1)

1.5. Divide-and-Conquer Algorithm

 

































 

 

Algorithm 1.

Input- Specialized 1.

Strategy- Specialized 1.

Divide andConquer Programming 1.6^ Dynamic Greedy 1.7 (^) Iterative 1.

A divide-and-conquer algorithm is an algorithm (§1.2) whose steps are structured according to the following strategy:

  1. Construct the output directly and return it, if the input is simple enough. Otherwise:
  2. Divide the input into two or more (a finite number) of smaller inputs.
  3. Recursively apply the algorithm to each of the smaller inputs pro- duced in the first step.
  1. Combine the outputs from the recursive applications to produce the output corresponding to the original input.

This concept is one of many known ways of narrowing the algorithm concept in terms of a strategy (§1.4), which gives a specific structure to the steps of the algorithm.

solutions to the contained subproblems.

Overlapping subproblems: A problem exhibits overlapping subprob- lems if the total number of subproblems required to assemble and solve the complete problem is ā€œsmall,ā€ generally polynomial in the input size. In other words, a naive recursive (top down) approach to the problem would recompute the solution to the subproblems many times.

Taking advantage of the above properties, a dynamic programming al- gorithm functions in a bottom up fashion. The overall strategy can be descibed as:

  1. Compute and store the solutions to all of the simplest subproblems.
  2. Repeat until the full problem has been solved:

(a) Combine the solutions to the subproblems of a given size to compute and store the solutions to the next largest subprob- lems.

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 some- times 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.

cally optimal decisions at every decision point. In other words, the subproblems which would result from various decisions, and their resulting solutions to the whole problem, are irrelevant.

Optimal substructure: A problem is said to have optimal substruc- ture if the optimal solution to the problem contains within it optimal solutions to the contained subproblems.

Having seen this, a greedy algorithm is simply an algorithm which makes a sequence of locally optimal decisions. Generally, the structure of the algorithm follows this pattern:

  1. Repeat until the problem has been reduced to an empty or trivial base case.

(a) Augment the solution in some locally optimal fashion. (b) Apply the local choice made to reduce or contract the problem.

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.

1.8. Iterative Algorithm

 

































 

 

Algorithm 1.

Input- Specialized 1.

Strategy- Specialized 1.

Conquer 1.5Divide and Programming 1.6Dynamic 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.

References

[1] Donald E. Knuth, The Art of Computer Programming, Vol. 1: Fun- damental Algorithms, Third Edition, Addison-Wesley, Reading, MA,