Sequential, Parallel and Distributed Algorithms
Sequential, Parallel and Distributed Algorithms
AND DISTRIBUTED
ALGORITHMS
1
What is an Algorithm?
-An algorithm is a sequence of steps that take inputs
from the user and after some computation, produces an
output.
-An algorithm is a sequence of instructions followed
to solve a problem. While designing an algorithm, we
should consider the architecture of computer on which
the algorithm will be executed.
Here, each processor has its own control unit and they
share a common memory unit. All the processors get
instructions individually from their own control unit
and they operate on a single stream of data as per the
instructions they have received from their respective
control units. This processor operates simultaneously.
12
MIMD Computers (Multiple Instruction stream,
Multiple Data stream)
MIMD computers have multiple control units,
multiple processing units, and a shared memory or
interconnection network.
Note!Moststandardcomputeralgorithmsaresequentialalgorithms,
andnotspecificallyidentifiedassuch,assequentialnessis a
backgroundassumption.
OTHER ALGORITHM:
Distributed Algorithm
A distributed algorithm is an algorithm designed to
run on computer hardware constructed from
interconnected processors. Distributed algorithms are
used in many varied application areas of distributed
computing, such as telecommunications,scientific
computing, distributed information processing, and
real-time process control. Standard problems solved
by distributed algorithms include leader
election, consensus, distributed search, spanning
tree generation,mutual exclusion, and resource
allocation.
The choice of an appropriate distributed algorithm to
solve a given problem depends on both the
characteristics of the problem, and characteristics of
the system the algorithm will run on such as the type
and probability of processor or link failures, the kind of
inter-process communication that can be performed, and
the level of timing synchronization between separate
processes.
When to know if algorithm is parallel?
An algorithm is parallel if there are several
processes (tasks, threads, processors) working
on it at the same time. Often the tasks run in the
same address space, and can
communicate/reference results by others freely
(low cost).
When to know if algorithm is distributed?