SlideShare a Scribd company logo
Branch & Bound Algorithms
Briana B. Morrison
With thanks to Dr. Hung
2
Topics
 Define branch & bound
 0-1 Knapsack problem
– Breadth-First Search
– Best-First Search
 Assignment Problem
 Traveling Salesperson
3
Introduction
 The branch-and-bound design strategy is very similar to
backtracking in that a state space tree is used to solve a
problem.
 The differences are that the branch-and-bound method
1) does not limit us to any particular way of traversing
the tree, and 2) is used only for optimization problems.
 A branch-and-bound algorithm computes a number
(bound) at a node to determine whether the node is
promising.
4
Introduction …
 The number is a bound on the value of the solution
that could be obtained by expanding beyond the
node.
 If that bound is no better than the value of the best
solution found so far, the node is nonpromising.
Otherwise, it is promising.
 The backtracking algorithm for the 0-1 Knapsack
problem is actually a branch-and-bound algorithm.
 A backtracking algorithm, however, does not exploit
the real advantage of using branch-and-bound.
5
Introduction …
 Besides using the bound to determine whether a
node is promising, we can compare the bounds of
promising nodes and visit the children of the one
with the best bound.
 This approach is called best-first search with
branch-and-bound pruning. The implementation of
this approach is a modification of the breadth-first
search with branch-and-bound pruning.
6
Branch and Bound
 An enhancement of backtracking
 Applicable to optimization problems
 Uses a lower bound for the value of the
objective function for each node (partial
solution) so as to:
– guide the search through state-space
– rule out certain branches as
“unpromising”
7
0-1 Knapsack
 To learn about branch-and-bound, first we look at
breadth-first search using the knapsack problem
 Then we will improve it by using best-first search.
 Remember the default strategy for the 0-1 knapsack
problem was to use a depth-first strategy, not
expanding nodes that were not an improvement on
the previously found solution.
8
BackTracking (depth-first)
8
17 10 8
14 11
13
12
20
17
9
Breadth-first Search
 We can implement this search using a queue.
 All child nodes are placed in the queue for later
processing if they are promising.
 Calculate an integer value for each node that
represents the maximum possible profit if we pick
that node.
 If the maximum possible profit is not greater than
the best total so far, don’t expand the branch.
10
Breadth-first Search
 The breadth-first search strategy has no advantage
over a depth-first search (backtracking).
 However, we can improve our search by using our
bound to do more than just determine whether a
node is promising.
11
Branch and Bound (breadth-first)
8
17 10 8
14 11
13
12
20
17
12
0-1 Knapsack
 0-1 Knapsack using the branch and bound.
 Now look at all promising, unexpanded nodes and
expand beyond the one with the best bound.
 We often arrive at an optimal solution more quickly
than if we simply proceeded blindly in a
predetermined order.
13
Best-first Search
 Best-first search expands the node with the
best bounds next.
 How would you implement a best-first search?
– Depth-first is a stack
– Breadth-first is a queue
– Best-first is a ???
14
Branch and Bound (best first)
8
17 10 8
14 11
13
12
20
17
15
0-1 Knapsack
 Capacity W is 10
 Upper bound is $100 (use fractional value)
Item Weight Value Value / weight
1 4 $40 10
2 7 $42 6
3 5 $25 5
4 3 $12 4
16
Computing Upper Bound
 To compute the upper bound, use
– ub = v + (W – w)(vi+1/wi+1)
 So the maximum upper bound is
– pick no items, take maximum profit item
– ub = (10 – 0)*($10) = $100
 After we pick item 1, we calculate the upper bound as
– all of item 1 (4, $40) + partial of item 2 (7, $42)
– $40 + (10-4)*6 = $76
 If we don’t pick item 1:
– ub = (10 – 0) * ($6) = $60
17
State Space Tree
w = 0, v = 0
ub = 100
w = 4, v = 40
ub = 76 w = 0, v = 0
ub = 60
w = 11 w = 4, v = 40
ub = 70
w = 9, v = 65
ub = 69 w = 4, v = 40
ub = 64
w = 12 w = 9, v = 65
ub = 65
0
1
3
2
4
with 1 without 1
with 2 without 2
without 3
with 3
with 4 without 4
5
6
7 8
inferior to
node 8
not feasible
not feasible
inferior to
node 8
optimal solution
18
Bounding
 A bound on a node is a guarantee that any solution
obtained from expanding the node will be:
– Greater than some number (lower bound)
– Or less than some number (upper bound)
 If we are looking for a maximal optimal (knapsack),
then we need an upper bound
– For example, if the best solution we have found so far has a
profit of 12 and the upper bound on a node is 10 then there
is no point in expanding the node
 The node cannot lead to anything better than a 10
19
Bounding
 Recall that we could either perform a depth-first or a
breadth-first search
– Without bounding, it didn’t matter which one we used
because we had to expand the entire tree to find the optimal
solution
– Does it matter with bounding?
 Hint: think about when you can prune via bounding
20
Bounding
 We prune (via bounding) when:
(currentBestSolutionCost >= nodeBound)
 This tells us that we get more pruning if:
– The currentBestSolution is high
– And the nodeBound is low
 So we want to find a high solution quickly and we want
the highest possible upper bound
– One has to factor in the extra computation cost of computing
higher upper bounds vs. the expected pruning savings
21
Enumeration in a search tree
 each node is a partial solution, i.e. a part of the solution
space
...
...
root node
child nodes
child nodes
Level 0
Level 1
Level 2
22
The assignment problem
 We want to assign n people to n jobs so that
the total cost of the assignment is as small as
possible (lower bound)
23
Select one element in each row of the cost matrix C so that:
• no two selected elements are in the same column; and
• the sum is minimized
For example:
Job 1 Job 2 Job 3 Job 4
Person a 9 2 7 8
Person b 6 4 3 7
Person c 5 8 1 8
Person d 7 6 9 4
Lower bound: Any solution to this problem will have
total cost of at least:
Example: The assignment problem
sum of the smallest element in each row =
10
24
Assignment problem: lower bounds
25
State-space levels 0, 1, 2
26
Complete state-space
27
Traveling Salesman Problem
 Can apply branch & bound if we come up with a
reasonable lower bound on tour lengths.
 Simple lower bound = finding smallest element in the
intercity distance matrix D and multiplying it by
number of cities n
 Alternate solution:
– For each city i, find the sum si of the distances from city i to
the two nearest cities;
– compute the sum s of these n numbers;
– divide the result by 2
– and if all the distances are integers, round up the result to
the nearest integer;
28
Traveling salesman
example:
lb = [(1+3)+(3+6)+(1+2)+(3+4)+(2+3)]/2 = 14
29
Summary: Branch and bound
– Feasible solution
– Optimal solution
– Breadth-First Search
– Best-First Search (with branch-and-bound pruning)
30
Summary: Branch and bound
 Branch and Bound is:
– a general search method.
– minimize a function f(x), where x is restricted to some
feasible region.
 To apply branch and bound, one must have:
– a means of computing a lower bound on an instance of the
optimization problem.
– a means of dividing the feasible region of a problem to
create smaller subproblems.
– a way to compute an upper bound (feasible solution) for at
least some instances.
31
Summary: Branch and bound
 The method starts by:
– considering the original problem with the complete feasible
region (called the root problem).
– The lower-bounding and upper-bounding procedures are
applied to the root problem.
– If the bounds match, then an optimal solution has been found.
Otherwise, the feasible region is divided into two or more
regions, which together cover the whole feasible region.
– These subproblems become children of the root search node.
– The algorithm is applied recursively to the subproblems,
generating a tree of subproblems.
32
Summary: Branch and bound
 If an optimal solution is found to a subproblem,
– it is a feasible solution to the full problem, but not
necessarily globally optimal.
– Since it is feasible, it can be used to prune the rest of the
tree:
 if the lower bound for a node exceeds the best known feasible
solution, no globally optimal solution can exist in the subspace
of the feasible region represented by the node.
 Therefore, the node can be removed from consideration.
– The search proceeds until all nodes have been solved or
pruned, or until some specified threshold is meet between
the best solution found and the lower bounds on all unsolved
subproblems.
Ad

More Related Content

What's hot (20)

Greedy method by Dr. B. J. Mohite
Greedy method by Dr. B. J. MohiteGreedy method by Dr. B. J. Mohite
Greedy method by Dr. B. J. Mohite
Zeal Education Society, Pune
 
State Space Search in ai
State Space Search in aiState Space Search in ai
State Space Search in ai
vikas dhakane
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
hodcsencet
 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
Madhu Bala
 
Moore Mealy Machine Conversion
Moore Mealy Machine Conversion Moore Mealy Machine Conversion
Moore Mealy Machine Conversion
Aiman Hafeez
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Acad
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
finding Min and max element from given array using divide & conquer
finding Min and max element from given array using  divide & conquer finding Min and max element from given array using  divide & conquer
finding Min and max element from given array using divide & conquer
Swati Kulkarni Jaipurkar
 
UNIT-V.pdf daa unit material 5 th unit ppt
UNIT-V.pdf daa unit material 5 th unit pptUNIT-V.pdf daa unit material 5 th unit ppt
UNIT-V.pdf daa unit material 5 th unit ppt
JyoReddy9
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
Waqar Akram
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen Problem
Sukrit Gupta
 
AI_ppt.pptx
AI_ppt.pptxAI_ppt.pptx
AI_ppt.pptx
SnehaTiwari84
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
Drishti Bhalla
 
lecture 26
lecture 26lecture 26
lecture 26
sajinsc
 
Solution of N Queens Problem genetic algorithm
Solution of N Queens Problem genetic algorithm  Solution of N Queens Problem genetic algorithm
Solution of N Queens Problem genetic algorithm
MohammedAlKazal
 
Hill climbing
Hill climbingHill climbing
Hill climbing
Mohammad Faizan
 
Activation functions and Training Algorithms for Deep Neural network
Activation functions and Training Algorithms for Deep Neural networkActivation functions and Training Algorithms for Deep Neural network
Activation functions and Training Algorithms for Deep Neural network
Gayatri Khanvilkar
 
Job sequencing with Deadlines
Job sequencing with DeadlinesJob sequencing with Deadlines
Job sequencing with Deadlines
YashiUpadhyay3
 
State Space Search in ai
State Space Search in aiState Space Search in ai
State Space Search in ai
vikas dhakane
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
hodcsencet
 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
Madhu Bala
 
Moore Mealy Machine Conversion
Moore Mealy Machine Conversion Moore Mealy Machine Conversion
Moore Mealy Machine Conversion
Aiman Hafeez
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Acad
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
finding Min and max element from given array using divide & conquer
finding Min and max element from given array using  divide & conquer finding Min and max element from given array using  divide & conquer
finding Min and max element from given array using divide & conquer
Swati Kulkarni Jaipurkar
 
UNIT-V.pdf daa unit material 5 th unit ppt
UNIT-V.pdf daa unit material 5 th unit pptUNIT-V.pdf daa unit material 5 th unit ppt
UNIT-V.pdf daa unit material 5 th unit ppt
JyoReddy9
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
Waqar Akram
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen Problem
Sukrit Gupta
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
Drishti Bhalla
 
lecture 26
lecture 26lecture 26
lecture 26
sajinsc
 
Solution of N Queens Problem genetic algorithm
Solution of N Queens Problem genetic algorithm  Solution of N Queens Problem genetic algorithm
Solution of N Queens Problem genetic algorithm
MohammedAlKazal
 
Activation functions and Training Algorithms for Deep Neural network
Activation functions and Training Algorithms for Deep Neural networkActivation functions and Training Algorithms for Deep Neural network
Activation functions and Training Algorithms for Deep Neural network
Gayatri Khanvilkar
 
Job sequencing with Deadlines
Job sequencing with DeadlinesJob sequencing with Deadlines
Job sequencing with Deadlines
YashiUpadhyay3
 

Similar to fdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.ppt (20)

Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
Amrinder Arora
 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
dakccse
 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
AmitBhola17
 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
ZeelGoyani
 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
BinayakMukherjee4
 
Optimization problems
Optimization problemsOptimization problems
Optimization problems
Ruchika Sinha
 
Backtracking
BacktrackingBacktracking
Backtracking
Vikas Sharma
 
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptxbcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
B.T.L.I.T
 
Divide and Conquer / Greedy Techniques
Divide and Conquer / Greedy TechniquesDivide and Conquer / Greedy Techniques
Divide and Conquer / Greedy Techniques
Nirmalavenkatachalam
 
ETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptxETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptx
RahulSingh190790
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
22bcs058
 
Unit-2 Branch & Bound Design of Algorithms.ppt
Unit-2 Branch & Bound Design of Algorithms.pptUnit-2 Branch & Bound Design of Algorithms.ppt
Unit-2 Branch & Bound Design of Algorithms.ppt
HarjotDhillon8
 
Backtracking algorithm with examples N-queens
Backtracking algorithm with examples N-queensBacktracking algorithm with examples N-queens
Backtracking algorithm with examples N-queens
ssuser746d32
 
Module 3_DAA (2).pptx
Module 3_DAA (2).pptxModule 3_DAA (2).pptx
Module 3_DAA (2).pptx
AnkitaVerma776806
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design Patterns
Ashwin Shiv
 
Support Vector Machines is the the the the the the the the the
Support Vector Machines is the the the the the the the the theSupport Vector Machines is the the the the the the the the the
Support Vector Machines is the the the the the the the the the
sanjaibalajeessn
 
TRAVELING SALESMAN PROBLEM, Divide and Conquer
TRAVELING SALESMAN PROBLEM, Divide and ConquerTRAVELING SALESMAN PROBLEM, Divide and Conquer
TRAVELING SALESMAN PROBLEM, Divide and Conquer
DrSMeenakshiSundaram1
 
DynamicProgramming.pptx
DynamicProgramming.pptxDynamicProgramming.pptx
DynamicProgramming.pptx
SaimaShaheen14
 
5163147.ppt
5163147.ppt5163147.ppt
5163147.ppt
Mayurkumarpatil1
 
Algorithm chapter 11
Algorithm chapter 11Algorithm chapter 11
Algorithm chapter 11
chidabdu
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
Amrinder Arora
 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
dakccse
 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
AmitBhola17
 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
ZeelGoyani
 
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.pptParallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
Parallel_Algorithms_In_Combinatorial_Optimization_Problems.ppt
BinayakMukherjee4
 
Optimization problems
Optimization problemsOptimization problems
Optimization problems
Ruchika Sinha
 
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptxbcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
bcfbedbf-6679-4d5d-b8a5-7d4c9c48dba4.pptx
B.T.L.I.T
 
Divide and Conquer / Greedy Techniques
Divide and Conquer / Greedy TechniquesDivide and Conquer / Greedy Techniques
Divide and Conquer / Greedy Techniques
Nirmalavenkatachalam
 
ETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptxETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptx
RahulSingh190790
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
22bcs058
 
Unit-2 Branch & Bound Design of Algorithms.ppt
Unit-2 Branch & Bound Design of Algorithms.pptUnit-2 Branch & Bound Design of Algorithms.ppt
Unit-2 Branch & Bound Design of Algorithms.ppt
HarjotDhillon8
 
Backtracking algorithm with examples N-queens
Backtracking algorithm with examples N-queensBacktracking algorithm with examples N-queens
Backtracking algorithm with examples N-queens
ssuser746d32
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design Patterns
Ashwin Shiv
 
Support Vector Machines is the the the the the the the the the
Support Vector Machines is the the the the the the the the theSupport Vector Machines is the the the the the the the the the
Support Vector Machines is the the the the the the the the the
sanjaibalajeessn
 
TRAVELING SALESMAN PROBLEM, Divide and Conquer
TRAVELING SALESMAN PROBLEM, Divide and ConquerTRAVELING SALESMAN PROBLEM, Divide and Conquer
TRAVELING SALESMAN PROBLEM, Divide and Conquer
DrSMeenakshiSundaram1
 
DynamicProgramming.pptx
DynamicProgramming.pptxDynamicProgramming.pptx
DynamicProgramming.pptx
SaimaShaheen14
 
Algorithm chapter 11
Algorithm chapter 11Algorithm chapter 11
Algorithm chapter 11
chidabdu
 
Ad

Recently uploaded (20)

Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Artificial hand using embedded system.pptx
Artificial hand using embedded system.pptxArtificial hand using embedded system.pptx
Artificial hand using embedded system.pptx
bhoomigowda12345
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??
Web Designer
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studiesTroubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Tier1 app
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by AjathMobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Ajath Infotech Technologies LLC
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Artificial hand using embedded system.pptx
Artificial hand using embedded system.pptxArtificial hand using embedded system.pptx
Artificial hand using embedded system.pptx
bhoomigowda12345
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??
Web Designer
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studiesTroubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Tier1 app
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by AjathMobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Ajath Infotech Technologies LLC
 
Ad

fdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.ppt

  • 1. Branch & Bound Algorithms Briana B. Morrison With thanks to Dr. Hung
  • 2. 2 Topics  Define branch & bound  0-1 Knapsack problem – Breadth-First Search – Best-First Search  Assignment Problem  Traveling Salesperson
  • 3. 3 Introduction  The branch-and-bound design strategy is very similar to backtracking in that a state space tree is used to solve a problem.  The differences are that the branch-and-bound method 1) does not limit us to any particular way of traversing the tree, and 2) is used only for optimization problems.  A branch-and-bound algorithm computes a number (bound) at a node to determine whether the node is promising.
  • 4. 4 Introduction …  The number is a bound on the value of the solution that could be obtained by expanding beyond the node.  If that bound is no better than the value of the best solution found so far, the node is nonpromising. Otherwise, it is promising.  The backtracking algorithm for the 0-1 Knapsack problem is actually a branch-and-bound algorithm.  A backtracking algorithm, however, does not exploit the real advantage of using branch-and-bound.
  • 5. 5 Introduction …  Besides using the bound to determine whether a node is promising, we can compare the bounds of promising nodes and visit the children of the one with the best bound.  This approach is called best-first search with branch-and-bound pruning. The implementation of this approach is a modification of the breadth-first search with branch-and-bound pruning.
  • 6. 6 Branch and Bound  An enhancement of backtracking  Applicable to optimization problems  Uses a lower bound for the value of the objective function for each node (partial solution) so as to: – guide the search through state-space – rule out certain branches as “unpromising”
  • 7. 7 0-1 Knapsack  To learn about branch-and-bound, first we look at breadth-first search using the knapsack problem  Then we will improve it by using best-first search.  Remember the default strategy for the 0-1 knapsack problem was to use a depth-first strategy, not expanding nodes that were not an improvement on the previously found solution.
  • 9. 9 Breadth-first Search  We can implement this search using a queue.  All child nodes are placed in the queue for later processing if they are promising.  Calculate an integer value for each node that represents the maximum possible profit if we pick that node.  If the maximum possible profit is not greater than the best total so far, don’t expand the branch.
  • 10. 10 Breadth-first Search  The breadth-first search strategy has no advantage over a depth-first search (backtracking).  However, we can improve our search by using our bound to do more than just determine whether a node is promising.
  • 11. 11 Branch and Bound (breadth-first) 8 17 10 8 14 11 13 12 20 17
  • 12. 12 0-1 Knapsack  0-1 Knapsack using the branch and bound.  Now look at all promising, unexpanded nodes and expand beyond the one with the best bound.  We often arrive at an optimal solution more quickly than if we simply proceeded blindly in a predetermined order.
  • 13. 13 Best-first Search  Best-first search expands the node with the best bounds next.  How would you implement a best-first search? – Depth-first is a stack – Breadth-first is a queue – Best-first is a ???
  • 14. 14 Branch and Bound (best first) 8 17 10 8 14 11 13 12 20 17
  • 15. 15 0-1 Knapsack  Capacity W is 10  Upper bound is $100 (use fractional value) Item Weight Value Value / weight 1 4 $40 10 2 7 $42 6 3 5 $25 5 4 3 $12 4
  • 16. 16 Computing Upper Bound  To compute the upper bound, use – ub = v + (W – w)(vi+1/wi+1)  So the maximum upper bound is – pick no items, take maximum profit item – ub = (10 – 0)*($10) = $100  After we pick item 1, we calculate the upper bound as – all of item 1 (4, $40) + partial of item 2 (7, $42) – $40 + (10-4)*6 = $76  If we don’t pick item 1: – ub = (10 – 0) * ($6) = $60
  • 17. 17 State Space Tree w = 0, v = 0 ub = 100 w = 4, v = 40 ub = 76 w = 0, v = 0 ub = 60 w = 11 w = 4, v = 40 ub = 70 w = 9, v = 65 ub = 69 w = 4, v = 40 ub = 64 w = 12 w = 9, v = 65 ub = 65 0 1 3 2 4 with 1 without 1 with 2 without 2 without 3 with 3 with 4 without 4 5 6 7 8 inferior to node 8 not feasible not feasible inferior to node 8 optimal solution
  • 18. 18 Bounding  A bound on a node is a guarantee that any solution obtained from expanding the node will be: – Greater than some number (lower bound) – Or less than some number (upper bound)  If we are looking for a maximal optimal (knapsack), then we need an upper bound – For example, if the best solution we have found so far has a profit of 12 and the upper bound on a node is 10 then there is no point in expanding the node  The node cannot lead to anything better than a 10
  • 19. 19 Bounding  Recall that we could either perform a depth-first or a breadth-first search – Without bounding, it didn’t matter which one we used because we had to expand the entire tree to find the optimal solution – Does it matter with bounding?  Hint: think about when you can prune via bounding
  • 20. 20 Bounding  We prune (via bounding) when: (currentBestSolutionCost >= nodeBound)  This tells us that we get more pruning if: – The currentBestSolution is high – And the nodeBound is low  So we want to find a high solution quickly and we want the highest possible upper bound – One has to factor in the extra computation cost of computing higher upper bounds vs. the expected pruning savings
  • 21. 21 Enumeration in a search tree  each node is a partial solution, i.e. a part of the solution space ... ... root node child nodes child nodes Level 0 Level 1 Level 2
  • 22. 22 The assignment problem  We want to assign n people to n jobs so that the total cost of the assignment is as small as possible (lower bound)
  • 23. 23 Select one element in each row of the cost matrix C so that: • no two selected elements are in the same column; and • the sum is minimized For example: Job 1 Job 2 Job 3 Job 4 Person a 9 2 7 8 Person b 6 4 3 7 Person c 5 8 1 8 Person d 7 6 9 4 Lower bound: Any solution to this problem will have total cost of at least: Example: The assignment problem sum of the smallest element in each row = 10
  • 27. 27 Traveling Salesman Problem  Can apply branch & bound if we come up with a reasonable lower bound on tour lengths.  Simple lower bound = finding smallest element in the intercity distance matrix D and multiplying it by number of cities n  Alternate solution: – For each city i, find the sum si of the distances from city i to the two nearest cities; – compute the sum s of these n numbers; – divide the result by 2 – and if all the distances are integers, round up the result to the nearest integer;
  • 28. 28 Traveling salesman example: lb = [(1+3)+(3+6)+(1+2)+(3+4)+(2+3)]/2 = 14
  • 29. 29 Summary: Branch and bound – Feasible solution – Optimal solution – Breadth-First Search – Best-First Search (with branch-and-bound pruning)
  • 30. 30 Summary: Branch and bound  Branch and Bound is: – a general search method. – minimize a function f(x), where x is restricted to some feasible region.  To apply branch and bound, one must have: – a means of computing a lower bound on an instance of the optimization problem. – a means of dividing the feasible region of a problem to create smaller subproblems. – a way to compute an upper bound (feasible solution) for at least some instances.
  • 31. 31 Summary: Branch and bound  The method starts by: – considering the original problem with the complete feasible region (called the root problem). – The lower-bounding and upper-bounding procedures are applied to the root problem. – If the bounds match, then an optimal solution has been found. Otherwise, the feasible region is divided into two or more regions, which together cover the whole feasible region. – These subproblems become children of the root search node. – The algorithm is applied recursively to the subproblems, generating a tree of subproblems.
  • 32. 32 Summary: Branch and bound  If an optimal solution is found to a subproblem, – it is a feasible solution to the full problem, but not necessarily globally optimal. – Since it is feasible, it can be used to prune the rest of the tree:  if the lower bound for a node exceeds the best known feasible solution, no globally optimal solution can exist in the subspace of the feasible region represented by the node.  Therefore, the node can be removed from consideration. – The search proceeds until all nodes have been solved or pruned, or until some specified threshold is meet between the best solution found and the lower bounds on all unsolved subproblems.
  翻译: