0% found this document useful (0 votes)
253 views

DAA Unit-2: Fundamental Algorithmic Strategies

There are several fundamental algorithmic strategies discussed in the document: 1. Brute force algorithms try every possible solution through brute computational force. 2. Recursive algorithms break problems into subproblems that call on themselves to solve the overall problem. 3. Divide and conquer algorithms divide problems into smaller subproblems, solve the subproblems independently, and then combine the results.

Uploaded by

mhghtgxdfhhjkjl
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
253 views

DAA Unit-2: Fundamental Algorithmic Strategies

There are several fundamental algorithmic strategies discussed in the document: 1. Brute force algorithms try every possible solution through brute computational force. 2. Recursive algorithms break problems into subproblems that call on themselves to solve the overall problem. 3. Divide and conquer algorithms divide problems into smaller subproblems, solve the subproblems independently, and then combine the results.

Uploaded by

mhghtgxdfhhjkjl
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

DAA unit-2

FUNDAMENTAL ALGORITHMIC STRATEGIES:


Most important type of Algorithm :
Algorithm: 
An algorithm is a step-by-step procedure to solve a problem. A good algorithm should be optimized
in terms of time and space. Different types of problems require different types of algorithmic-
techniques to be solved in the most optimized manner. There are many types of algorithms but the
most important and the fundamental algorithms that you must know will be discussed in this article.
1.Brute Force Algorithm: 
This is the most basic and simplest type of algorithm. A Brute Force Algorithm is the straightforward
approach to a problem i.e., the first approach that comes to our mind on seeing the problem. More
technically it is just like iterating every possibility available to solve that problem.
For Example: If there is a lock of 4-digit PIN. The digits to be chosen from 0-9 then the brute force
will be trying all possible combinations one by one like 0001, 0002, 0003, 0004, and so on until we
get the right PIN. In the worst case, it will take 10,000 tries to find the right combination.
2.Recursive Algorithm:
This type of algorithm is based on recursion. In recursion, a problem is solved by breaking it into
subproblems of the same type and calling own self again and again until the problem is solved with
the help of a base condition.
Some common problem that is solved using recursive algorithms are Factorial of a Number, Fibonacci
Series, Tower of Hanoi, DFS for Graph, etc.
3.Divide and Conquer Algorithm:
In Divide and Conquer algorithms, the idea is to solve the problem in two sections, the first section
divides the problem into subproblems of the same type. The second section is to solve the smaller
problem independently and then add the combined result to produce the final answer to the problem.
Some common problem that is solved using Divide and Conquers Algorithms are Binary
Search, Merge Sort, Quick Sort, Strassen’s Matrix Multiplication, etc.
4.Dynamic Programming Algorithms:
This type of algorithm is also known as the memoization technique because in this the idea is to store
the previously calculated result to avoid calculating it again and again. In Dynamic Programming,
divide the complex problem into smaller overlapping subproblems and storing the result for future
use.
The following problems can be solved using Dynamic Programming algorithm Knapsack
Problem, Weighted Job Scheduling, Floyd Warshall Algorithm, Dijkstra Shortest Path Algorithm, etc.
5.Greedy Algorithm:
In the Greedy Algorithm, the solution is built part by part. The decision to choose the next part is done
on the basis that it gives the immediate benefit. It never considers the choices that had taken
previously.
Some common problems that can be solved through the Greedy Algorithm are Prim’s
Algorithm, Kruskal’s Algorithm, Huffman Coding, etc.
6.Backtracking Algorithm: 
In Backtracking Algorithm, the problem is solved in an incremental way i.e. it is an algorithmic-
technique for solving problems recursively by trying to build a solution incrementally, one piece at a
time, removing those solutions that fail to satisfy the constraints of the problem at any point of time.
7.BRANCH AND BOUND:
Branch and bound algorithms are used to find the optimal solution for combinatory,
discrete, and general mathematical optimization problems. In general, given an NP-
Hard problem, a branch and bound algorithm explores the entire search space of possible
solutions and provides an optimal solution.
A branch and bound algorithm consist of stepwise enumeration of possible candidate
solutions by exploring the entire search space. With all the possible solutions, we first build a
rooted decision tree. The root node represents the entire search space:

Here, each child node is a partial solution and part of the solution set. Before constructing
the rooted decision tree, we set an upper and lower bound for a given problem based on the
optimal solution. At each level, we need to make a decision about which node to include in
the solution set. At each level, we explore the node with the best bound. In this way, we can
find the best and optimal solution fast.
Now it is crucial to find a good upper and lower bound in such cases. We can find an upper
bound by using any local optimization method or by picking any point in the search space.
On the other hand, we can obtain a lower bound from convex relaxation or duality.
In general, we want to partition the solution set into smaller subsets of solution. Then we
construct a rooted decision tree, and finally, we choose the best possible subset (node) at
each level to find the best possible solution set.
When Branch and Bound Is a Good Choice?
We already mentioned some problems where a branch and bound can be an efficient choice
over the other algorithms. In this section, we’ll list all such cases where a branch and bound
algorithm is a good choice.

If the given problem is a discrete optimization problem, a branch and bound is a good
choice. Discrete optimization is a subsection of optimization where the variables in the
problem should belong to the discrete set. Examples of such problems are 0-1 Integer
Programming or Network Flow problem.
Branch and bound work efficiently on the combinatory optimization problems. Given
an objective function for an optimization problem, combinatory optimization is a process to
find the maxima or minima for the objective function. The domain of the objective function
should be discrete and large. Boolean Satisfiability, Integer Linear Programming are
examples of the combinatory optimization problems.
Advantages:
In a branch and bound algorithm, we don’t explore all the nodes in the tree. That’s why the
time complexity of the branch and bound algorithm is less when compared with other
algorithms.
If the problem is not large and if we can do the branching in a reasonable amount of time, it
finds an optimal solution for a given problem.
The branch and bound algorithm find a minimal path to reach the optimal solution for a given
problem. It doesn’t repeat nodes while exploring the tree.
Disadvantages:
The branch and bound algorithm are time-consuming. Depending on the size of the
given problem, the number of nodes in the tree can be too large in the worst case.
Also, parallelization is extremely difficult in the branch and bound algorithm.
Bin Packing Explained
 The fundamental aim of bin packing is to pack a collection of objects into well defined
regions called bins, so that they do not overlap. In the real world, the critical issue is
to make efficient use of time and/or space. A bin for example, need not necessarily
be a container, but could represent a space in time or a surface area.
The One-Dimensional Bin Packing Problem:
 Mathematically, the one-dimensionalbin packing problem can be described as
follows:
Given a bin capacity C>0 and a list of objects {p1, p2,...., pn}, what is the smallest number of
bins needed to accommodate all of the objects? ( Each pi has size si, such that 0<=si<=C.
i.e. none of the objects too big to fit in a bin)
Four easily recognisable one-dimensional bin packing problems are detailed below:
 A material such as piping or cable is supplied in quantities of a standard length C.
The demands for pieces of the material are for varying lengths that do not exceed C.
The idea is to use the least number of standard lengths of the material in producing a
given set of required pieces. Hence minimising the wastage.
 Advertisments of arbitrary lengths, must be assigned to commersial break time slots
on television. Each break must last no longer than three minutes.
 Removal lorries with set weight limits are to be packed with furniture. The aim is to
use as few lorries as possible to pack all the items, without exceeding the maximum
weight in any lorry.
 A set of tasks with known, arbitrary execution times, need to be executed on some
identical processors by a given deadline. The problem is to schedule all of the tasks
onto the least number of machines so that the deadline is met.
In the last example, it is time that is the critical resource. It is a scheduling problem; the
processors are the bins, the deadline is the common bin capacity, and the individual
execution times of the tasks are the objects (pi) in the list.
The Two-Dimensional Bin Packing Problem:
 This problem is concerned with packing different sized objects (most commonly
rectangles) into fixed sized, two-dimensional bins, using as few of the bins as
possible. Applications of this type of problem are often found in stock cutting
examples, where quantities of material such as glass or metal, are produced in
standard sized, rectangular sheets. Demands for pieces of the material are for
rectangles of arbitrary sizes, no bigger than the sheet itself. The problem is to use the
minimum number of standard sized sheets in accommodating a given list of required
pieces.
 A variation on the two-dimensional bin packing problem is the strip packing problem
and this is the area that I shall be concentrating on most.

Heuristic :
The need for Heuristic Evaluation :
Heuristic Evaluation is the process of thorough evaluation/assessment where the experts in a
particular domain, used to measure the usability of the user interface. Usability can be defined as how
easily a specific user can use a particular design or say interface without facing any problem. In
general, we can say the Heuristic Evaluation is performed to detect the issues in the design of a
product. It also identifies the ways to resolve those issues present in design and meet the user
expectations.
Heuristic Evaluation is an in-depth usability test that is performed by the experts. As it is also well
known to everyone that better usability, higher the number of users will interact with the product.
Jakob Nielsen and Rolf Molich are web usability pioneers who published the article in 1990, which
contains a set of heuristics. A heuristic can be defined as the fast and practical way to approach a
problem and make effective decisions to solve those problems. Experts use the heuristics approach to
systematically evaluate the user experience (UX) design.
When to conduct Heuristic Evaluation :
There is no such rule when to perform the Heuristics Evaluation, but it can be performed at any stage
of the design process. Most of the time the heuristic evaluation is performed after the paper
prototyping and usability test. As Heuristics Evaluation helps to optimize the design of the user-
interface it becomes very important to be performed to evaluate the final design.
How to conduct Heuristic Evaluation :
Define the Scope of Evaluation – 
Mentioning the budget and deadline becomes very important at the time of evaluation. One should
also define the different parameters where they want to conduct the usability test.  
Know the End-User – 
As we know, different groups of people have different expectations from a product. So it becomes
very important to know the end-user and their interest.
Choose your Set of Heuristics – 
Without a proper heuristic, the Heuristics Evaluation will produce unreliable and useless results if all
the evaluators are not going to use the same guidelines.
Setting-up an Evaluation System and Identifying Issues –
Decide the different categories in which a problem should be categories like a critical issue, minor
issue, etc. Evaluators must follow the guidelines of system evaluation.
Analyze and Summarize the Results –
It becomes very necessary to analyze the issue present in the design of user interface and solve those
issues before the deadline.
Advantages :  
 Reveals many hidden usability problems.
 It helps to determine the overall user experience.
 Heuristics evaluation can be combined with usability testing.
 Better Heuristics Evaluation helps to engage more users.
 It is cheaper and faster than conducting full-blown usability testing.
Disadvantages :  
 Sometimes it is a bit hard for even experts to figure out some problems.
 It becomes hard to find experts to conduct the Heuristics Evaluation.
 We will need few expert evaluators, so that it will become easier for us to stick with
usability testing.
 Flaws in design will affect the engagement of users in the product.
 Heuristics testing depends on the expertise level of only a few experts.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy