You are on page 1of 6

BT 0080

Fundamentals of Algorithms
Contents
Unit 1
Elementary Algorithms 1
Unit 2
Mathematical Functions and Notations 30
Unit 3
Divide and Conquer 79
Unit 4
Greedy Method 97
Unit 5
Dynamic Programming 113
Unit 6
Backtracking 123
Unit 7
Branch and Bound 138
Unit 8
Additional Features 148
Unit 9
Graphs 163
Unit 10
Trees and Algorithms 177
Edition: Spring 2009
th
BKID B1092 9 Oct. 2009
Unit 11
Traversability 206
Unit 12
Representation of Graphs 216
Unit 13
Directed Graphs 231
Unit 14
Complexity of Algorithms 250
Acknowledgement, References and Suggested Readings 266
Director & Dean
Directorate of Distance Education
Sikkim Manipal University of Health, Medical & Technological Sciences (SMU-DDE)
Board of Studies
Dr. U. B. Pavanaja (Chairman) Mr. Nirmal Kumar Nigam
General Manager Academics HOP IT
Manipal Universal Learning Pvt. Ltd. SMU-DDE, Manipal.
Bangalore.
Prof. Bhushan Patwardhan Dr. A. Kumaran
Chief Academics Research Manager (Multilingual)
Manipal Education Microsoft Research Labs India
Bangalore. Bangalore.
Dr. Harishchandra Hebbar Mr. Ravindranath P. S.
Director Director (Quality)
Manipal Centre for Info. Sciences, Bangalore Yahoo India, Bangalore
Dr. N. V. Subba Reddy Dr. Ashok Kallarakkal
HOD-CSE Vice President
Manipal Institute of Technology, Manipal IBM India, Bangalore
Dr. Ashok Hegde Mr. H. Hiriyannaiah
Vice President Group Manager
MindTree Consulting Ltd., Bangalore EDS Mphasis, Bangalore
Dr. Ramprasad Varadachar
Director, Computer Studies
Dayanand Sagar College of Engg., Bangalore.
Content Preparation Team
Content Writing Content Editing
Mr. Deepak Shetty Mr. Vinayak G Pai
Assistant Professor Mathematics Assistant Professor, Dept. of IT
SMU-DDE, Manipal. SMU-DDE, Manipal.
Instructional Design Language Editing
Mr. Kulwinder Pal Ms. R. K. Rao
Assistant Professor Education Lecturer - English
SMU-DDE, Manipal. Upendra Pai Memorial College, Udupi.
Edition: Spring 2009
This book is a distance education module comprising a collection of learning
material for our students. All rights reserved. No part of this work may be
reproduced in any form by any means without permission in writing from Sikkim
Manipal University of Health, Medical and Technological Sciences, Gangtok,
Sikkim. Printed and published on behalf of Sikkim Manipal University of Health,
Medical and Technological Sciences, Gangtok, Sikkim by Mr.Rajkumar Mascreen,
GM, Manipal Universal Learning Pvt. Ltd., Manipal 576 104. Printed at Manipal
Press Limited, Manipal.
SUBJECT INTRODUCTION
The subject, Fundamentals of Algorithms(BT 0080), of four credits, contains
the various algorithms and approaches to solve problems in different
techniques. The time complexity for various algorithms is also considered
and explained in a simple manner. The different models for executing
algorithms is explained with well illustrated examples wherever necessary.
This book has been split into 14 units, the overview of which is given below:
Unit 1: Elementary Algorithms
This unit gives the different ways of expressing algorithms, the building
blocks of algorithms and their characteristics is explained in a simple
manner.
Unit 2: Mathematical Functions and Notations
This unit explains in brief the different types of functions and their notations.
The different types of Asymptotic functions and their notations is well
explained with standard examples.
Unit 3: Divide and Conquer
In this unit, we learn the divide and conquer method. Using this method, we
find the Algorithm for Binary Search, Max and Min, Merge Sort, and Quick
Sort.
Unit 4: Greedy Method
In this unit, we use the Greedy Method for Optimistic storage on tapes,
Knapsack Problem, Job Sequencing with dead lines, Optimal Merge Pattern
and Single Source Shortlist Paths.
Unit 5: Dynamic Programming
This unit deals with Dynamic Programming approach to multistage graphs,
All Pair Shortlist Paths and Travelling Salesman Problem.
Unit 6: Backtracking
In this unit, we study about Back Tracking method. In the search for
fundamental principles of algorithm design, backtracking represents one of
the most general techniques. We use Backtracking approach to solve 8-
queen problem, Sum of Subsets problem and Knapsack problem.
Unit 7: Branch and Bound
In this unit, we deal with branch and bound method and use this approach to
solve O/I Knapsack problem and Travelling Salesman problem. The Branch
and Bound refers to all state space search methods in which all children of
the E-node are generated before any other live node can become the E-
node.
Unit 8: Additional Features
In this unit, we discuss the lower boundary theory and its implications. The
concept of NP Hard and NP Complete is briefly discussed here. The
different types of Approximate Algorithms for NP Hard Problems are studied
here.
Unit 9: Graphs
In this unit, we study the Preliminary definitions of graphs. The different
Notations used in graphs are also discussed here. The concept of trees is
explained in a simple manner.
Unit 10: Trees and Algorithms
In this unit, we study the Characterization of Trees. The Rooted Trees and
its applications is discussed here with simple examples. Spanning Trees
and the algorithms is briefly discussed here with necessary steps.
Unit 11: Traversability
In this unit, we study the concept of Eulerian Graphs with application to
Hamiltonian Paths and circuits. The travelling salesman problem is briefly
discussed with application to traversability.
Unit 12: Representations of Graphs
In this unit, we discuss the concept of Adjacency and Incidence Matrix. The
application of the above concepts to Circuit Matrix and Path Matrix is
illustrated here.
Unit 13: Directed Graphs
In this unit, we study different types of Directed Graph. The concept of
Eulers Digraphs and Matrix Representation of digraphs is illustrated with
some simple examples.
Unit 14: Complexity of Algorithms
In this unit, we discuss the Notations for the Growth Rates of Functions. We
study here the different methods of establishing NP-Completeness of
Problems.

Objectives of studying the subject:


After studying this subject you should be able to:
write the procedures in a simple manner
use a number of Mathematical Notations like , , , , mod, log, e etc
apply divide and conquer strategy to practical problems
define the Job Sequencing problem using Greedy Method
apply Dynamic Programming in Multistage graphs
analyze the 8-queen problem
solve the O/I Knapsack Problem
apply the Lower Boundary theory
use the definition of trees and properties of trees
apply the concept of trees in real life situations
identify an Euler graph
write the matrix representations of a given graph
apply the properties to flows, network and traffic problem
define a number of problems which are known to be NP-Complete
problems.
The different examples for the algorithms given in this book will be given in
the Edunxt Portal.