If there are more then one possible way of solving a problem, then one may think of more than one algorithm for the same problem. Hence, it is necessary to know in what domains these algorithms are applicable. Data domain is an important aspect to be known in the field of algorithms. Once we have more than one algorithm for a given problem, how do we choose the best among them? The solution is to devise some data sets and determine a performance profile for each of the algorithms.
A best case data set can be obtained by having all distinct data in the set. But, it is always complex to determine a data set, which exhibits some average behavior. The following sections give a brief idea of the well-known accepted algorithms.
2.1 Numerical Algorithms
Numerical analysis is the theory of constructive methods in mathematical analysis. Constructive method is a procedure used to obtain the solution for a mathematical problem in finite number of steps and to some desired accuracy.
2.1.1 Numerical Iterative Algorithm
An iterative process can be illustrated with the flow chart given in fig 2.1. There are four main blocks in the process viz., initialization, decision, computation, and update. The functions of these four blocks are as follows:
Initialization: all parameters are set to their initial values.
Decision: decision parameter is used to determine when to exit from the loop.
Computation: required computation is performed.
Update: decision parameter is updated and is transformed for next iteration.
Many problems in engineering or science need the solution of simultaneous linear algebraic equations. Every iterative algorithm is infinite step algorithm. One of the iterative algorithms to solve system of simultaneous equations is Guass Siedel. This iteration method requires generally a few iteration. Iterative techniques have less round-off error. For large system of equations, the iteration required may be quite large. But, there is a guarantee of getting the convergent result.
For example: consider the following set of equations,
10x1+2x2+x3= 9
2x1+20x2-2x3= -44
-2x1+3x2+10x3= 22.
To solve the above set of equations using Guass Siedel iteration scheme, start with (x1(1),x2(1),x3(1))=(0,0,0) as initial values and compute the values of we write the system of x1, x2, x3 using the equations given below
x1(k+1)=(b1-a12x2(k+1)-a13x3(k))/a11
x2(k+1)=(b2-a21x1(k+1)-a23x3(k))/a22
x3(k+1)=(b3-a31x1(k+1)-a32x3(k+1))/a33
for k=1,2,3,�
This process is continued upto some desired accuracy. Numerical iterative methods are also applicable for obtaining the roots of the equation of the form f(x)=0. The various iterative methods used for this purpose are,
- Bisection method: xi+2=(xi+xi+1)/2
- Regula- Falsi method: x2=(x0f(x1)+ x1f(x0))/ (f(x1)-f(x0))
- Newton Raphson method: x2= x1-f(x1)/f1(x1)