22CS303 Unit 4
22CS303 Unit 4
This document is confidential and intended solely for the educational purpose of
RMK Group of Educational Institutions. If you have received this document
through email in error, please notify the system manager. This document
contains proprietary information and is intended only to the respective group /
learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender
immediately by e-mail if you have received this document by mistake and delete
this document from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in reliance on
the contents of this information is strictly prohibited.
22CS303
Design and Analysis of
Algorithms
Department: AIML
Batch/Year: 2022-2026/II
Created by:
Dr. Sudharson, ASP/AIML
Mrs. Remya Rose S, AP/AIML
Created on: 05.09.23
Table of Contents
Sl. Topics Page
No. No.
1. Contents 5
2. Course Objectives 6
6. CO PO/PSO Mapping 14
Graphs
Searching
& Sorting
Syllabus
Syllabus L T P C
22CS303 DESIGN AND ANALYSIS OF ALGORITHMS
2 0 2 3
Unit I : INTRODUCTION 6+6
Notion of an Algorithm – Fundamentals of Algorithmic Problem Solving – Fundamentals of the
Analysis of Algorithmic Efficiency – Asymptotic Notations and their properties. Analysis
Framework – Empirical analysis - Mathematical analysis for Recursive and Non-recursive
algorithms.
List of Exercise/Experiments:
1.Perform the recursive algorithm analysis.
2.Perform the non-recursive algorithm analysis.
Unit II : BRUTE FORCE AND DIVIDE AND CONQUER 6+6
Brute Force – String Matching – Exhaustive Search - Knapsack Problem. Divide and Conquer
Methodology – Binary Search – Merge sort- Quick sort – Multiplication of Large Integers –
Closest-Pair and Convex Hull Problems -Transform and Conquer Method: Heap Sort
List of Exercise/Experiments:
1.Write a program to search an element using binary search.
2.Write a program to sort the elements using merge sort and find time complexity.
3.Write a program to sort the elements using quick sort and find time complexity.
4.Write a program to sort the elements using heap sort.
Unit III : DYNAMIC PROGRAMMING 6+6
Dynamic programming – Principle of optimality - Floyd‘s algorithm – Multi stage graph - Optimal
Binary Search Trees – Longest common subsequence - Matrix-chain multiplication – Travelling
Salesperson Problem – Knapsack Problem and Memory functions.
List of Exercise/Experiments:
1.Solve Floyd’s algorithm.
2.Write a program to find optimal binary search tree for a given list of keys.
3.Solve the multi-stage graph to find shortest path using backward and forward approach.
4.Write a program to find the longest common subsequence.
Unit IV : GREEDY TECHNIQUE AND ITERATIVE IMPROVEMENT 6+6
Greedy Technique - Prim‘s algorithm and Kruskal’s Algorithm, Huffman Trees. The Maximum-
Flow Problem – Maximum Matching in Bipartite Graphs- The Stable marriage Problem.
List of Exercise/Experiments:
1.Write a program to find minimum spanning tree using Prim’s algorithm.
2.Implement Kruskal’s algorithm to find minimum spanning tree.
3.Write a program to solve maximum flow problem.
Unit V : BACKTRACKING AND BRANCH AND BOUND 6+6
P, NP, NP - Complete and NP Hard Problems. Backtracking – N-Queen problem - Subset Sum
Problem. Branch and Bound – LIFO Search and FIFO search - Assignment problem – Knapsack
Problem - Approximation Algorithms for NP-Hard Problems – Travelling Salesman problem
List of Exercise/Experiments:
1.Write a program to implement sum of subset problem.
2.Write a program to solve N-Queen problem.
3.Solve the assignment problem using branch and bound technique.
4.Solve knapsack problem using branch and bound technique.
Course Outcomes
Course Outcomes
CO# COs K Level
CO4 Solve the problems using greedy technique and iterative improvement
K3
technique for optimization.
CO5 Compute the limitations of algorithmic power and solve the problems
K3
using backtracking and branch and bound technique.
K6 Evaluation
K5 Synthesis
K4 Analysis
K3 Application
K2 Comprehension
K1 Knowledge
CO – PO/PSO Mapping
CO PO PO PO PO PO PO PO PO PO PO PO PO PSO PSO PS0
# 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3
CO1 3 3 2 1 1 - - 2 2 2 - 2 3 2 -
CO2 3 2 2 2 2 - - 2 2 2 - 2 3 2 -
CO3 3 3 2 2 2 - - 2 2 2 - 2 3 2 -
CO4 3 2 2 2 2 - - 2 2 2 - 2 3 3 -
CO5 3 2 2 2 2 - - 2 2 2 - 2 3 2 -
CO6 2 2 1 1 1 - - 2 2 2 - 2 3 2 -
Lecture Plan
Unit IV
Lecture Plan – UNIT 4
GREEDY TECHNIQUE AND ITERATIVE
IMPROVEMENT
Number Actual
Sl. Proposed Taxonomy Mode of
Topic of Lecture CO
No. Date Level Delivery
Periods Date
The Stable
marriage K3 Chalk &
6 CO4
Problem 1 Talk
Activity Based
Learning
Unit IV
Activity Based Learning
https://drive.google.com/file/d/16crrbMPt_LSeK8feZSoh2tUnngQVe
gdc/view?usp=sharing
Lecture Notes
Unit IV
UNIT IV
1 Greedy Technique 22
2 Prim‘s algorithm 23
3 Kruskal’s Algorithm 26
4 Huffman Trees 31
5 Iterative Improvement 34
Spanning tree:
- A spanning tree of a connected graph acyclic subgraph (i.e., a tree) that contains
all the vertices of the graph.
Spanning tree
Unit IV GREEDY TECHNIQUE
- First, the number of spanning trees grows exponentially with the graph
size (at least for dense graphs).
- Second, generating all spanning trees for a given graph is not easy; in
fact, it is more difficult than finding a minimum spanning tree for a
weighted graph by using one of several efficient algorithms available
for this problem.
ALGORITHM Prim(G)
//Prim’s algorithm for constructing a minimum spanning tree
//Input: A weighted connected graph G = {V, E}
//Output: ET, the set of edges composing a minimum spanning tree of G
VT←{v0} //the set of tree vertices can be initialized with any vertex ET←Φ
for i ←1 to |V| − 1 do
find a minimum-weight edge e∗ = (v∗, u∗) among all the edges (v, u) such
that v is in VT and u is in V– VT
VT←VT∪ {u*}
ET←ET∪ {e*}
return ET
Unit IV GREEDY TECHNIQUE
To find the shortest edge connecting the vertex to a tree vertex each vertex that are not
in the current tree adds two labels to a vertex:
Vertices that are not adjacent to any of the tree vertices can be given the ∞ label
indicating their “infinite” distance to the tree vertices and
(Alternatively, split the vertices that are not in the tree into two sets, the “fringe” and
the “unseen.”
The fringe contains only the vertices that are not in the tree but are adjacent to at
least one tree vertex. These are the candidates from which the next tree vertex is
selected.
If a graph is represented by its adjacency lists and the priority queue is implemented as a
min-heap, the running time of the algorithm is O(|E| log |V
The unseen vertices are all the other vertices of the graph, called “unseen” because
they are yet to be affected by the algorithm.)
Rule:
Analysis:
If a graph is represented by its adjacency lists and the priority queue is implemented
as a min-heap, the running time of the algorithm is in O(|E| log |V |). This is because
the algorithm performs |V |− 1 deletions of the smallest element and makes |E|
verifications and, possibly, changes of an element’s priority in a min-heap of size not
exceeding |V |. Each of these operations, as noted earlier, is a O (log |V |) operation.
Hence, the running time of this implementation of Prim’s algorithm is in
(|V |− 1 + |E|) O(log |V |) = O(|E| log |V |)
ALGORITHM Kruskal(G)
//Kruskal’s algorithm for constructing a minimum spanning tree
//Input: A weighted connected graph G = ( V, E )
//Output: ET, the set of edges composing a minimum spanning tree of G
sort E in nondecreasing order of the edge weights
k←0
ET ← Φ; ecounter ← 0
while ecounter < |V| − 1 do
k←k+1
if ET ∪ {eik} is acyclic
ET ← ET ∪ {eik}; ecounter ← ecounter + 1
return ET
Unit IV GREEDY TECHNIQUE
The initial forest consists of |V | trivial trees, each comprising a single vertex of the
graph. The final forest consists of a single tree, which is a minimum spanning tree
of the graph.
On each iteration, the algorithm takes the next edge (u, v) from the sorted
list of the graph’s edges, finds the trees containing the vertices u and v, and, if
these trees are not the same, unites them in a larger tree by adding the edge
(u, v).
A new cycle is created if and only if the new edge connects two vertices
already connected by a path, i.e., if and only if the two vertices belong to the same
connected component (Figure below).
New edge connecting two vertices may (a) or may not (b) create a cycle.
The abstract data type of a collection of disjoint subsets of a finite set contains the
following operations:
Unit IV GREEDY TECHNIQUE
makeset(x) creates a one-element set {x}. It is assumed that this operation can be
applied to each of the elements of set S only once.
find(x) returns a subset containing x.
union(x,y) constructs the union of the disjoint subsets Sx and Sy containing x and y,
respectively, and adds it to the collection to replace Sx and Sy , which are deleted from
it.
For example, let S = {1, 2, 3, 4, 5, 6}. Then makeset(i) creates the set {i} and
applying this operation six times initializes the structure to the collection of six singleton
sets:
{1}, {2}, {3}, {4}, {5}, {6}.
and, if followed by union(4, 5) and then by union(3, 6), we end up with the disjoint
subsets
The quick find, optimizes the time efficiency of the find operation;
The quick find uses an array indexed by the elements of the underlying set S; the
array’s values indicate the representatives of the subsets containing those elements.
Each subset is implemented as a linked list whose header contains the pointers to the
first and last elements of the list along with the number of elements in the list.
representative array)
Append the shorter of the two lists to the longer one with ties broken arbitrarily. The size of
each list is assumed to be available by storing the number of elements in the list’s header.
This modification is called the union by size.
The quick union—the second principal alternative for implementing disjoint subsets—
represents each subset by a rooted tree. The nodes of the tree contain the subset’s
elements (one per node), with the root’s element considered the subset’s representative;
the tree’s edges are directed from children to their parents (Figure below).
To improve the time bound, always perform a union operation by attaching a smaller tree
to the root of a larger one, with ties broken arbitrarily. The size of a tree can be measured
either by the number of nodes (this version is called union by size) or by its height (this
version is called union by rank).
Unit IV GREEDY TECHNIQUE
There are efficient algorithms to check for whether two vertices belong to the same
tree. They are called union- find algorithms. The running time of Kruskal’s algorithm
will be dominated by the time needed for sorting the edge weights of a given graph.
Hence, with an efficient sorting algorithm, the time efficiency of Kruskal’s algorithm will
be in O (|E| log E|).
Huffmann’s Algorithm constructs a tree that assigns shorter bit strings to high-frequency
symbols and longer ones to low-frequency symbols.
Step 1 Initialize n one-node trees and label them with the symbols of the
alphabet given. Record the frequency of each symbol in its tree’s root to
indicate the tree’s weight. (More generally, the weight of a tree will be equal to the
sum of the frequencies in the tree’s leaves.)
Step 2 Repeat the following operation until a single tree is obtained. Find two trees
with the smallest weight (ties can be broken arbitrarily, but see Problem 2 in this
section’s exercises). Make them the left and right subtree of a new tree and
record the sum of their weights in the root of the new tree as its weight.
A tree constructed by the above algorithm is called a Huffman tree. It defines in the
manner described above is called a Huffman code.
To encode a text that comprises symbols (from some n-symbol alphabet) by assigning to
each of the text’s symbols some sequence of bits (called the codeword), fixed-length
encoding is used.
Unit IV GREEDY TECHNIQUE
Fixed-length encoding assigns to each symbol a bit string of the same
length m (m ≥ log2 n).
To find how many bits of an encoded text represent the first (or, more
generally, the ith) symbol, prefix-free (or simply prefix) codes are used.
Steps:
scan a bit string until the first group of bits that is a codeword for some
symbol is found,
replace these bits by this symbol, and
repeat this operation until the bit string’s end is reached
To create a binary prefix code for some alphabet, associate the alphabet’s
symbols with leaves of a binary tree in which
symbol A B C D _
frequency 0.35 0.1 0.2 0.2 0.15
FIGURE: Example of constructing a Huffman coding tree. The resulting codewords are as follows:
symbol A B C D _
frequency 0.35 0.1 0.2 0.2 0.15
codeword 11 100 00 01 101
Finding an initial solution may require as much effort as solving the problem after
a feasible solution has been identified.
It is not always clear what changes should be allowed in a feasible solution so that we
can check efficiently whether the current solution is locally optimal and, if not, replace
it with a better one.
Unit IV ITERATIVE IMPROVEMENT
Contains exactly one vertex with no entering edges, called the source (numbered 1)
Contains exactly one vertex with no leaving edges, called the sink (numbered n)
Has positive integer weight uij on each directed edge (i.j), called the edge capacity,
indicating the upper bound on the amount of the material that can be sent from i to j
through this edge.
network.
Example:
Definition of a Flow:
A flow is an assignment of real numbers xij to edges (i,j) of a given network that satisfy
the following:
Flow-conservation requirements:
The total amount of material entering an intermediate vertex must be equal to the total
amount of the material leaving the vertex.
Unit IV ITERATIVE IMPROVEMENT
capacity constraints:
0 ≤ xij ≤ uij for every edge (i,j) € E
Flow value and Maximum Flow Problem:
Since no material can be lost or added to by going through intermediate vertices of the
network, the total amount of the material leaving the source must end up at the sink:
The value of the flow is defined as the total outflow from the source (= the total inflow
into the sink). The maximum flow problem is to find a flow of the largest value
(maximum flow) for a given network.
Maximum value is bounded by the sum of the capacities of the edges leaving the source;
hence the augmenting-path method has to stop after a finite number of iterations
The final flow is always maximum, its value doesn’t depend on a sequence of
augmenting paths used
Selecting a bad sequence of augmenting paths could impact the method’s efficiency
EXAMPLE
Increase the flow along this path by a maximum of 2 units, which is the smallest unused
capacity of its edges. The new flow is shown below.
Unit IV ITERATIVE IMPROVEMENT
The above flow values can still be increased along the path 1→4→3←2→5→6 by
increasing the flow by 1 on edges (1, 4), (4, 3), (2, 5), and (5, 6) and decreasing it by 1 on
edge (2, 3).
second label – indicates the vertex from which the vertex being labeled was
reached, with “+” or “–” added to the second label to indicate whether the vertex
was reached via a forward or backward edge
Vertex labelling:
The source is always labeled with ∞, -
All other vertices are labeled as follows:
If unlabeled vertex j is connected to the front vertex i of the traversal queue by a
directed edge from i to j with positive unused capacity rij = uij –xij (forward edge),
vertex j is labeled with lj,i+, where lj = min{li, rij}
Unit IV ITERATIVE IMPROVEMENT
If unlabeled vertex j is connected to the front vertex i of the traversal queue y a
directed edge from j to i with positive flow xji, then vertex j is labeled with lj, i− ,
where lj = min{li, xji}.
If the sink ends up being labeled, the current flow can be augmented by the amount
indicated by the sink’s first label.
The augmentation of the current flow is performed along the augmenting path traced by
following the vertex second labels from sink to source; the current flow quantities are
increased on the forward edges and decreased on the backward edges of this path.
If the sink remains unlabeled after the traversal queue becomes empty, the algorithm
returns the current flow as maximum and stops.
ALGORITHM ShortestAugmentingPath(G)
//Implements the shortest-augmenting-path algorithm
//Input: A network with single source 1, single sink n, and
// positive integer capacities uij on its edges (i, j )
//Output: A maximum flow x
assign xij = 0 to every edge (i, j ) in the network
label the source with∞, − and add the source to the empty queue Q
while not Empty(Q) do
i ←Front(Q); Dequeue(Q)
for every edge from i to j do //forward edges
if j is unlabeled
rij ←uij − xij
if rij > 0
lj ←min{li, rij }; label j with lj, i +
Enqueue(Q, j )
for every edge from j to i do //backward edges
if j is unlabeled
if xji > 0
lj ←min{li, xji }; label j with lj, i −
Enqueue(Q, j )
Unit IV ITERATIVE IMPROVEMENT
if the sink has been labeled
//augment along the augmenting path found
j ←n //start at the sink and move backwards using second labels
while j ≠ 1 //the source hasn’t been reached
if the second label of vertex j is i +
xij ←xij + ln
else //the second label of vertex j is i −
xji ←xji − ln
j ←i; i ←the vertex indicated by i’s second label
erase all vertex labels except the ones of the source
reinitialize Q with the source
return x //the current flow is maximum
Example
the source and . X, the complement of X, containing the sink is the set of all the edges
with a tail in X and a head in .X .We denote a cut C(X, . X) or simply C. For example, for the
network in the previous examples are:
if X = {1} and hence .X = {2, 3, 4, 5, 6}, C(X, . X) = {(1, 2), (1, 4)};
if X = {1, 2, 3, 4, 5} and hence .X = {6}, C(X, . X) = {(3, 6), (5, 6)};
if X = {1, 2, 4} and hence .X = {3, 5, 6}, C(X, . X) = {(2, 3), (2, 5), (4, 3)}.
The name “cut” stems from the following property: if all the edges of a cut were deleted
from the network, there would be no directed path from source to sink.
The value of maximum flow in a network is equal to the capacity of its minimum cut
The shortest augmenting path algorithm yields both a maximum flow and a minimum
cut:
Maximum flow is the final flow produced by the algorithm
Minimum cut is formed by all the edges from the labeled vertices to unlabeled
vertices on the last iteration of the algorithm.
All the edges from the labeled to unlabeled vertices are full, i.e., their flow amounts
are equal to the edge capacities, while all the edges from the unlabeled to labeled
vertices, if any, have zero flow amounts on them.
Time Efficiency:
Since the time required to find shortest augmenting path by breadth-first search is in
O(n+m)=O(m) for networks represented by their adjacency lists, the time efficiency of
the shortest-augmenting-path algorithm is in O(nm2) for this representation.
More efficient algorithms have been found that can run in close to O(nm) time, but these
algorithms don’t fall into the iterative-improvement paradigm.
Unit IV ITERATIVE IMPROVEMENT
Bipartite Graphs:
Bipartite graph: a graph whose vertices can be partitioned into two disjoint sets V and U,
not necessarily of the same size, so that every edge connects a vertex in V to a vertex in U.
A graph is bipartite if its vertices can be colored in two colors so that every edge has its
vertices colored in different colors; such graphs are also said to be 2-colorable
Example
For a given matching M, a vertex is called free (or unmatched) if it is not an end point of
any edge in M; otherwise, a vertex is said to be matched
If every vertex is matched, then M is a maximum matching
If there are unmatched or free vertices, then M may be able to be improved
We can immediately increase a matching by adding an edge
connecting two free vertices (e.g., (1,6) above)
An augmenting path for a matching M is a path from a free vertex in V to a free vertex in U
whose edges alternate between edges not in M and edges in M The length of an
augmenting path is always odd
Adding to M the odd numbered path edges and deleting from it the even numbered path
edges increases the matching size by 1 (augmentation)
One-edge path between two free vertices is special case of augmenting path
Case 2 (the front vertex w is in U) In this case, w must be matched and we label its
mate in V with w.
Unit IV ITERATIVE IMPROVEMENT
ALGORITHM MaximumBipartiteMatching(G)
//Finds a maximum matching in a bipartite graph by a BFS-like traversal
//Input: A bipartite graph G = V, U, E
//Output: A maximum-cardinality matching M in the input graph
initialize set M of edges with some valid matching (e.g., the empty set)
initialize queue Q with all the free vertices in V (in any order)
There is a set Y = {m1,…, mn} of n men and a set X = {w1,…, wn} of n women.
Each man has a ranking list of the women, and each woman has a ranking list of the
men (with no ties in these lists).
A marriage matching M is a set of n (m, w) pairs whose members are selected from
disjoint n-element sets Y and X in a one-one fashion, i.e., each man m from Y is
paired with exactly one woman w from X and vice versa.
A marriage matching M is called stable if there is no blocking pair for it; otherwise,
M is called unstable.
The stable marriage problem is to find a stable marriage matching for men’s and
women’s given preferences.
Stable marriage algorithm or Gale shaple Algorithm
Input: A set of n men and a set of n women along with rankings of the women
by each man and rankings of the men by each woman with no ties allowed in the
rankings
Output: A stable marriage matching
Step 0 Start with all the men and women being free.
Step 1 While there are free men, arbitrarily select one of them and do the
following:
Proposal: The selected free man m proposes to w, the next woman on his
preference list (who is the highest-ranked woman who has not rejected him before).
Unit IV ITERATIVE IMPROVEMENT
The stable matching produced by the algorithm is always man-optimal: each man
gets the highest rank woman on his list under any stable marriage. One can obtain
the woman- optimal matching by making women propose to men.
The stable marriage problem has practical applications such as matching medical-
school graduates with hospitals for residency training.
Stable Marriage
Assignment
ASSIGNMENT
Preferences of α, β, γ and δ
Preferences of A, B, C and D
ASSIGNMENT
13. What are the problems solved by iterative improvement? (CO4, K1)
Important problems that can be solved exactly by iterative- improvement
algorithms include linear programming, maximizing the flow in a network, and
matching the maximum possible number of vertices in a graph.
If all the vertices in the v set is matched with vertices in the u set with one-to-one
mapping, then it is called as perfect matching.
Part - A
16. What is Ford-Fulkerson method and shortest augmenting-path method?
(CO4, K1)
The Ford-Fulkerson method is a classic template for solving the maximum flow
problem by the iterative-improvement approach.
A flow is an assignment of real numbers xij to edges (i,j) of a given network that
satisfy the following:
18. What do you mean by the value of the flow in max flow problem?
(K1,CO4)
The total outflow from the source is equivalent to the total inflow into the sink is
A vertex with no entering edges is called the source and a vertex with no leaving
edges is called the sink.
The value of maximum flow in a network is equal to the capacity of its minimum
cut.
Part - A
21. What is cut and min cut? (CO4, K1)
Let X be a set of vertices in a network that includes its source but does not include its
sink, and let X, the complement of X, be the rest of the vertices including the sink.
The cut induced by this partition of the vertices is the set of all the edges with a tail
in X and a head in X.
Pre flow is a flow that satisfies the capacity constraints but not the flow-
conservation requirement.
A graph whose vertices can be partitioned into two disjoint sets V and U, not
necessarily of the same size, so that every edge connects a vertex in V to a vertex in
U. A graph is bipartite if and only if it does not have a cycle of an odd length .
24. What is matching and maximum matching in bipartite graph? (CO4, K1)
A matching in a graph is a subset of its edges with the property that no two
edges share a vertex.
A maximum cardinality matching is the largest subset of edges in a graph such that
no two edges share the same vertex.
Adding to M the odd numbered path edges and deleting from it the even
numbered path edges increases the matching size by 1 (augmentation).
Part - A
One-edge path between two free vertices is special case of augmenting path.
A graph is bipartite if its vertices can be colored in two colors so that every edge
has its vertices colored in different colors; such graphs are also said to be 2-
colorable.
The stable marriage problem is to find a stable matching for elements of two n
element sets (men’s and women’s) based on given matching preferences. This
problem always has a solution that can be found by the Gale-Shapley algorithm.
(or) The stable marriage problem is to find a stable marriage matching for men’s
and women’s given preferences.
29. What do you mean by stable and unstable matching? (CO4, K1)
4. (i).Define Huffman tree? List the types of Encoding in Huffman tree? (CO4, K4)
(ii).Write the procedure to compute Huffman code.
5. Write the Huffman’s Algorithm. Construct the Huffman’s tree for the (CO4, K4)
following data and obtain its Huffman’s Code.
a)
b)
Part - B Questions
7. Apply the maximum-matching algorithm to the following bipartite graph. (K3,CO4)
For each of its marriage matching's, indicate whether it is stable or not. (K3,CO4)
In 2009 Netflix gave a $1Million prize to the group that was best able to
predict how much someone would enjoy a movie based on their preferences. This
can be viewed, and in the submissions often was, as a bipartite graph problem. The
viewers are the vertices U and the movies the vertices V and there is an edge from
u to v if u viewed v. In this case the edges are weighted by the rating the viewer
gave. The winner was algorithm called “BellKor’s Pragmatic Chaos”. In the real
problem they also had temporal information about when a person made a rating, and
this turned out to help.
In low density parity check (LDPC) codes the vertices U are bits of
information that need to be preserved and corrected if corrupted, and the vertices V
are parity checks. By using the parity checks errors can be corrected if some of the
bits are corrupted. LDPC codes are used in satellite TV transmission, the relatively
new 10G Ethernet standard, and part of the WiFi 802.11 standard.
Linear Programming:
Generates a sequence of adjacent points of the problem’s feasible region with improving
values of the objective function until no further improvement is possible.
Variables u and v, transforming inequality constraints into equality constrains, are called
slack variables
A basic solution is called feasible if all its (basic) variables are nonnegative.
The simplex method progresses through a series of adjacent extreme points
(basic feasible solutions) with increasing values of the objective function. Each such point can
be represented by a simplex tableau, a table storing the information about the basic feasible
solution corresponding to the extreme point.
The last row of a simplex tableau is called the objective row. It is initialized by
the coefficients of the objective function with their signs reversed (in the first n columns)
and the value of the objective function at the initial point.
CONTENT BEYOND SYLLABUS
For example, the simplex tableau for (0, 0, 4, 6) of the above problem is presented
below:
Simplex tableau 1:
Entering Variable:
A new basic variable is called the entering variable(choose the one which
has most negative value in the objective row), while its column is referred to as the
pivot column; we mark the pivot column by ↑.
Departing variable :
For each positive entry in the pivot column, compute the θ-ratio by
dividing the row’s last entry by the entry in the pivot column. For the example of
tableau (1), these θ-ratios are
The row with the smallest θ-ratio determines the departing variable and mark the
row of the departing variable, called the pivot row, by←−
Pivoting:
The transformation of a current tableau into the next simplex tableau is
called pivoting.
•First, divide all the entries of the pivot row by the pivot, its entry in the pivot
column, to obtain rownew.
Unit IV ITERATIVE IMPROVEMENT
Then, replace each of the other rows, including the objective row, by the difference
Simplex tableau 2:
Since objective function is not met, construct the next simplex tableau by using the same
procedure discussed earlier.
Simplex tableau 3:
Since all the entries in the objective row are positive , the
algorithm terminates.
Solution:
x=3, y=1 and maximum value of 14.
Assessment
Schedule
(Proposed Date &
Actual Date)
Assessment Schedule
Given the standings in a sports league at some point during the season,
determine which teams have been mathematically eliminated from winning their
division. In the baseball elimination problem, there is a league consisting of N
teams. At some point during the season, team i has w[i] wins and g[i][j] games
left to play against team j. A team is eliminated if it cannot possibly finish the
season in first place or tied for first place. The goal is to determine exactly which
teams are eliminated. Design and implement the above problem and find the
efficiency of the same.
Warehouses Store
Thank you
Disclaimer:
This document is confidential and intended solely for the educational purpose of RMK Group of
Educational Institutions. If you have received this document through email in error, please notify the
system manager. This document contains proprietary information and is intended only to the
respective group / learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender immediately by e-mail if you
have received this document by mistake and delete this document from your system. If you are not
the intended recipient you are notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.