SlideShare una empresa de Scribd logo
1 de 28
Analysis and
Design of
Algorithms
BREADTH FIRST SEARCH,
BRANCHING AND BOUNDING
 Instructor
Prof. Amrinder Arora
amrinder@gwu.edu
Please copy TA on emails
Please feel free to call as well

 Available for study sessions
Science and Engineering Hall
GWU
Algorithms Graph Traversal Techniques, Branch & Bound 2
LOGISTICS
Algorithms
Analysis
Asymptotic
NP-
Completeness
Design
D&C
Greedy
DP
Graph
B&B
Applications
Algorithms Graph Traversal Techniques, Branch & Bound 3
WHERE WE ARE
 Done
 Done
 DFS, BFS
 Done
 Done
Knowing that an object exists within a certain
distance from us, in an infinite maze, how can we
find it?
Algorithms Graph Traversal Techniques, Branch & Bound 4
INFINITE MAZE
1. Select an unvisited node s, visit it, have it be the
root in a BFS tree being formed. Its level is called
the current level.
2. From each node x in the current level, in the order
in which the level nodes were visited, visit all the
unvisited neighbors of x. The newly visited nodes
from this level form a new level that becomes the
next current level.
3. Repeat the previous step until no more nodes can
be visited.
4. If there are still unvisited nodes, repeat from Step
1.
Algorithms Graph Traversal Techniques, Branch & Bound 5
BREADTH FIRST SEARCH (BFS)
 http://commons.wikimedia.org/wiki/File:Breadth-
First-Search-Algorithm.gif
 http://www.cs.sunysb.edu/~skiena/combinatorica/a
nimations/anim/bfs.gif
Algorithms Graph Traversal Techniques, Branch & Bound 6
BFS EXAMPLE
 Observations: The first node visited in each level is
the first node from which to proceed to visit new
nodes.
 This suggests that a queue is the proper data
structure to remember the order of the steps.
Algorithms Graph Traversal Techniques, Branch & Bound 7
BFS IMPLEMENTATION
Procedure BFS(input: graph G)
Queue Q; Integer s, x
while (G has an unvisited node) do
s := an unvisited node
visit(s)
Enqueue(s,Q)
While (Q is not empty) do
x := Dequeue(Q)
For (unvisited neighbor y of x) do
visit(y)
Enqueue(y,Q)
Algorithms Graph Traversal Techniques, Branch & Bound 8
BFS PSEUDOCODE
 Robotics
 Optimization problems using Branch and Bound
Algorithms Graph Traversal Techniques, Branch & Bound 9
BFS APPLICATIONS
 Hamiltonian Cycle
 K-clique
 K-coloring
Algorithms Graph Traversal Techniques, Branch & Bound 10
OTHER GRAPH PROBLEMS
Algorithms
Analysis
Asymptotic
NP-
Completeness
Design
D&C
Greedy
DP
Graph
B&B
Applications
Algorithms Graph Traversal Techniques, Branch & Bound 11
WHERE WE ARE
 Done
 Done
 Starting today..
 Done
 Done
 Done
 A systematic method for solving optimization problems
 A general optimization technique that applies where the
greedy method and dynamic programming fail.
 Much slower – often leads to exponential time
complexities in the worst case. If applied carefully, can
lead to algorithms that run reasonably fast on average.
 General idea of B&B is a BFS-like search for the optimal
solution, but not all nodes get expanded.
 Carefully selected criterion determines which node to expand and
when
 Another criterion tells the algorithm when an optimal solution has
been found.
Algorithms Graph Traversal Techniques, Branch & Bound 12
BRANCH AND BOUND
 Given jobs, resources, and cost matrix (cost if resource i
does job j), how to assign jobs to resources, such that
each job is done by a different resource, and the overall
cost is minimum?
 What is the right D&C strategy?
 What is the right BFS strategy?
Algorithms Graph Traversal Techniques, Branch & Bound 13
B&B FOR JOB ASSIGNMENT
J1 J2 J3 J4 J5
R1 2 4 5 3 11
R2 3 5 6 4 8
R3 4 3 5 7 9
R4 3 4 3 8 12
R5 4 2 6 4 9
What is the lower bound?
[In other words, how much will it cost at
minimum to do the job assignment?]
Each job must be done – so if we add minimum cost
per job, then that must be minimum cost
Each person must do a job – so if we add minimum
cost per resource, then that must be minimum cost
Taking the maximum of these two minimums, is a
good “lower bound”.
Algorithms Graph Traversal Techniques, Branch & Bound 14
LOWER BOUND
 Any random assignment can be an upper bound
 Or, we can use a greedy algorithm for upper bound.
 In the context of a minimization problem, upper
bound means: “Here is a solution that I have already
found. We are not interested in solutions that are
more expensive than this.” So, in other words, this
solution now defines the highest cost (the upper
bound on cost) that we are willing to pay.
 If we find an even better solution, then we will
decrease our upper bound.
Algorithms Graph Traversal Techniques, Branch & Bound 15
UPPER BOUND
 Assigning a job to a resource can be a node in the
BFS tree
 We need to think about the solution space as a tree,
and define what a node in the tree means with
respect to our problem (job assignment)
Algorithms Graph Traversal Techniques, Branch & Bound 16
BRANCHING
 B&B is a general algorithm for finding optimal
solutions of various optimization problems,
especially in discrete and combinatorial
optimization.
 2 main steps
 Branching
 Bounding
 (If bounding allows, then) Node Elimination
Algorithms Graph Traversal Techniques, Branch & Bound 17
MORE.. (FROM WIKIPEDIA)
 We can consider a maximization problem just as
easily in B&B as well.
 In case of a maximization problem, the “lower
bound” comes from a known solution. The “upper
bound” comes from a theoretical/analytical solution
that typically relaxes some constraint.
 Lower bound signifies: A solution we already know exists
 Upper bound signifies: Maximum value we could obtain, even if
some constraints were relaxed.
 An example of a maximization problem is a 0/1
knapsack problem.
Algorithms Graph Traversal Techniques, Branch & Bound 18
B&B FOR MAXIMIZATION PROBLEMS
 Given a set of items, each with a weight and a value,
determine which items to include in a collection so
that the total weight is less than a given limit and
the total value is as large as possible.
 Different from fractional knapsack, can only take or
not take an item.
 No easy solution – greedy solution may not be
optimal.
Algorithms Graph Traversal Techniques, Branch & Bound 19
0/1 KNAPSACK PROBLEM
 3 Items. Knapsack can hold 50 lbs.
 Item 1 weighs 10 lbs, worth 60$
 Item 2 weighs 20 lbs, worth 100$
 Item 3 weighs 30 lbs, worth 120$
 Greedy solution: Item 1 + Item 2, worth = $160
 Optimal solution: Item 3 + Item 2, worth = $220
Algorithms Graph Traversal Techniques, Branch & Bound 20
0/1 KNAPSACK EXAMPLE
 Given a complete graph with n vertices, the
salesperson wishes to make a tour, visiting each city
exactly once and finishing at the city he starts from.
Cost of going from city i to city j = c(i,j).
Algorithms Graph Traversal Techniques, Branch & Bound 21
TRAVELING SALESPERSON PROBLEM (TSP)
 Input: n jobs, n employees, and an n x n matrix A
where Aij be the cost if person i performs job j.
 Problem: Find a one-to-one matching of the n
employees to the n jobs so that the total cost is
minimized.
 Formally, find a permutation f such that C(f), where
C(f)=A1f(1) + A2f(2) + ... + Anf(n) is minimized.
Algorithms Graph Traversal Techniques, Branch & Bound 22
JOB ASSIGNMENT PROBLEM
 Do a Breadth First Search
 Evaluate each node for upper and lower bounds
 Branch into the “best” node
 Terminate if solution meets performance parameters
Algorithms Graph Traversal Techniques, Branch & Bound 23
BRANCH AND BOUND TEMPLATE
 Branch and Bound depends upon being able to
“bound” each node in the search tree, so that we can
evaluate whether or not to expand it.
 Lower bound and upper bound depend on the
problem
Algorithms Graph Traversal Techniques, Branch & Bound 24
BRANCH AND BOUND TEMPLATE (CONT.)
 Using a mixture of upper and lower bounds, we can
find when might be a right time to terminate the
search.
Algorithms Graph Traversal Techniques, Branch & Bound 25
TERMINATION CRITERIA
 B&B is an interesting technique that uses BFS and
bounding to eliminate the nodes in the search tree.
 Can solve problems that are intrinsically harder.
 Time complexity may not be polynomial, but may be
practical.
 We can return an approximate, usable solution with
some bound on performance.
 Developing interesting bounds depends upon the
problem and uses problem specific insights.
Algorithms Graph Traversal Techniques, Branch & Bound 26
SUMMARY
Algorithms
Analysis
Asymptotic
NP-
Completeness
Design
D&C
Greedy
DP
Graph
B&B
Applications
Algorithms Graph Traversal Techniques, Branch & Bound 27
WHERE WE ARE
 Done
 Done
 Done
 Done
 Done
 Done
 Job Assignment problem, Branch and Bound
 Review slides again – Be ready to discuss lower
bound and upper bounds
 http://en.wikipedia.org/wiki/Branch_and_bound
 “An Automatic Method of Solving Discrete
Programming Problems”
 http://rjlipton.wordpress.com/2012/12/19/branch-
and-bound-why-does-it-work/
 Preview: NP completeness and lower bound for coins
problem.
Algorithms Graph Traversal Techniques, Branch & Bound 28
READING ASSIGNMENT/PREVIEW

Más contenido relacionado

La actualidad más candente

Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisAmrinder Arora
 
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsDivide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsAmrinder Arora
 
Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and boundVipul Chauhan
 
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Amrinder Arora
 
01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysisOnkar Nath Sharma
 
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUSQUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUSJAMBIKA
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyappasami
 
design and analysis of algorithm
design and analysis of algorithmdesign and analysis of algorithm
design and analysis of algorithmMuhammad Arish
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithmsGanesh Solanke
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of AlgorithmsArvind Krishnaa
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingSkiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingzukun
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of AlgorithmsSwapnil Agrawal
 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsRajendran
 
Comparitive Analysis of Algorithm strategies
Comparitive Analysis of Algorithm strategiesComparitive Analysis of Algorithm strategies
Comparitive Analysis of Algorithm strategiesTalha Shaikh
 

La actualidad más candente (20)

Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
 
Lecture26
Lecture26Lecture26
Lecture26
 
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of PointsDivide and Conquer - Part II - Quickselect and Closest Pair of Points
Divide and Conquer - Part II - Quickselect and Closest Pair of Points
 
Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and bound
 
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
 
01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis
 
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUSQUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
QUESTION BANK FOR ANNA UNNIVERISTY SYLLABUS
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
 
design and analysis of algorithm
design and analysis of algorithmdesign and analysis of algorithm
design and analysis of algorithm
 
Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Greedy Algorithms
Greedy AlgorithmsGreedy Algorithms
Greedy Algorithms
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithms
 
DP
DPDP
DP
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingSkiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programming
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notations
 
Comparitive Analysis of Algorithm strategies
Comparitive Analysis of Algorithm strategiesComparitive Analysis of Algorithm strategies
Comparitive Analysis of Algorithm strategies
 

Similar a Graph Traversal Algorithms - Breadth First Search

Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design PatternsAshwin Shiv
 
fdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.ppt
fdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.pptfdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.ppt
fdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.pptKartikGupta711
 
ETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptxETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptxRahulSingh190790
 
Sienna 13 limitations
Sienna 13 limitationsSienna 13 limitations
Sienna 13 limitationschidabdu
 
Analysis and Design of Algorithms notes
Analysis and Design of Algorithms  notesAnalysis and Design of Algorithms  notes
Analysis and Design of Algorithms notesProf. Dr. K. Adisesha
 
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.pptdakccse
 
Optimization problems
Optimization problemsOptimization problems
Optimization problemsRuchika Sinha
 
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.pptBinayakMukherjee4
 
Algorithm review
Algorithm reviewAlgorithm review
Algorithm reviewchidabdu
 
Introduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationMasahiro Sakai
 
Dynamic programmng2
Dynamic programmng2Dynamic programmng2
Dynamic programmng2debolina13
 
Meetup Luglio - Operations Research.pdf
Meetup Luglio - Operations Research.pdfMeetup Luglio - Operations Research.pdf
Meetup Luglio - Operations Research.pdfDeep Learning Italia
 
hanoosh-tictactoeqqqqqqqaaaaaaaaaaaa.ppt
hanoosh-tictactoeqqqqqqqaaaaaaaaaaaa.ppthanoosh-tictactoeqqqqqqqaaaaaaaaaaaa.ppt
hanoosh-tictactoeqqqqqqqaaaaaaaaaaaa.pptssuser148ae0
 
Divide and Conquer / Greedy Techniques
Divide and Conquer / Greedy TechniquesDivide and Conquer / Greedy Techniques
Divide and Conquer / Greedy TechniquesNirmalavenkatachalam
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Zihui Li
 

Similar a Graph Traversal Algorithms - Breadth First Search (20)

Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design Patterns
 
fdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.ppt
fdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.pptfdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.ppt
fdocuments.in_branch-and-bound-design-and-analysis-of-alogorithm.ppt
 
ETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptxETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptx
 
Sienna 13 limitations
Sienna 13 limitationsSienna 13 limitations
Sienna 13 limitations
 
Analysis and Design of Algorithms notes
Analysis and Design of Algorithms  notesAnalysis and Design of Algorithms  notes
Analysis and Design of Algorithms notes
 
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
 
Optimization problems
Optimization problemsOptimization problems
Optimization problems
 
Approximation algorithms
Approximation  algorithms Approximation  algorithms
Approximation algorithms
 
DAA UNIT 3
DAA UNIT 3DAA UNIT 3
DAA UNIT 3
 
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
 
Algorithm review
Algorithm reviewAlgorithm review
Algorithm review
 
Introduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT Evaluation
 
Dynamic programmng2
Dynamic programmng2Dynamic programmng2
Dynamic programmng2
 
Meetup Luglio - Operations Research.pdf
Meetup Luglio - Operations Research.pdfMeetup Luglio - Operations Research.pdf
Meetup Luglio - Operations Research.pdf
 
DAA-Module-5.pptx
DAA-Module-5.pptxDAA-Module-5.pptx
DAA-Module-5.pptx
 
hanoosh-tictactoeqqqqqqqaaaaaaaaaaaa.ppt
hanoosh-tictactoeqqqqqqqaaaaaaaaaaaa.ppthanoosh-tictactoeqqqqqqqaaaaaaaaaaaa.ppt
hanoosh-tictactoeqqqqqqqaaaaaaaaaaaa.ppt
 
Divide and Conquer / Greedy Techniques
Divide and Conquer / Greedy TechniquesDivide and Conquer / Greedy Techniques
Divide and Conquer / Greedy Techniques
 
Adsa u2 ver 1.0.
Adsa u2 ver 1.0.Adsa u2 ver 1.0.
Adsa u2 ver 1.0.
 
Greedymethod
GreedymethodGreedymethod
Greedymethod
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)
 

Más de Amrinder Arora

Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...
Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...
Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...Amrinder Arora
 
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaArima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaAmrinder Arora
 
Stopping Rule for Secretory Problem - Presentation by Haoyang Tian, Wesam Als...
Stopping Rule for Secretory Problem - Presentation by Haoyang Tian, Wesam Als...Stopping Rule for Secretory Problem - Presentation by Haoyang Tian, Wesam Als...
Stopping Rule for Secretory Problem - Presentation by Haoyang Tian, Wesam Als...Amrinder Arora
 
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...Amrinder Arora
 
Proof of Cook Levin Theorem (Presentation by Xiechuan, Song and Shuo)
Proof of Cook Levin Theorem (Presentation by Xiechuan, Song and Shuo)Proof of Cook Levin Theorem (Presentation by Xiechuan, Song and Shuo)
Proof of Cook Levin Theorem (Presentation by Xiechuan, Song and Shuo)Amrinder Arora
 
Online algorithms in Machine Learning
Online algorithms in Machine LearningOnline algorithms in Machine Learning
Online algorithms in Machine LearningAmrinder Arora
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1Amrinder Arora
 
Set Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom FiltersSet Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom FiltersAmrinder Arora
 
Binomial Heaps and Fibonacci Heaps
Binomial Heaps and Fibonacci HeapsBinomial Heaps and Fibonacci Heaps
Binomial Heaps and Fibonacci HeapsAmrinder Arora
 
R-Trees and Geospatial Data Structures
R-Trees and Geospatial Data StructuresR-Trees and Geospatial Data Structures
R-Trees and Geospatial Data StructuresAmrinder Arora
 
Tries - Tree Based Structures for Strings
Tries - Tree Based Structures for StringsTries - Tree Based Structures for Strings
Tries - Tree Based Structures for StringsAmrinder Arora
 
Splay Trees and Self Organizing Data Structures
Splay Trees and Self Organizing Data StructuresSplay Trees and Self Organizing Data Structures
Splay Trees and Self Organizing Data StructuresAmrinder Arora
 
BTrees - Great alternative to Red Black, AVL and other BSTs
BTrees - Great alternative to Red Black, AVL and other BSTsBTrees - Great alternative to Red Black, AVL and other BSTs
BTrees - Great alternative to Red Black, AVL and other BSTsAmrinder Arora
 
Binary Search Trees - AVL and Red Black
Binary Search Trees - AVL and Red BlackBinary Search Trees - AVL and Red Black
Binary Search Trees - AVL and Red BlackAmrinder Arora
 
Graphs, Trees, Paths and Their Representations
Graphs, Trees, Paths and Their RepresentationsGraphs, Trees, Paths and Their Representations
Graphs, Trees, Paths and Their RepresentationsAmrinder Arora
 
Stacks, Queues, Binary Search Trees - Lecture 1 - Advanced Data Structures
Stacks, Queues, Binary Search Trees -  Lecture 1 - Advanced Data StructuresStacks, Queues, Binary Search Trees -  Lecture 1 - Advanced Data Structures
Stacks, Queues, Binary Search Trees - Lecture 1 - Advanced Data StructuresAmrinder Arora
 
Online Algorithms - An Introduction
Online Algorithms - An IntroductionOnline Algorithms - An Introduction
Online Algorithms - An IntroductionAmrinder Arora
 

Más de Amrinder Arora (20)

Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...
Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...
Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...
 
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaArima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
 
Stopping Rule for Secretory Problem - Presentation by Haoyang Tian, Wesam Als...
Stopping Rule for Secretory Problem - Presentation by Haoyang Tian, Wesam Als...Stopping Rule for Secretory Problem - Presentation by Haoyang Tian, Wesam Als...
Stopping Rule for Secretory Problem - Presentation by Haoyang Tian, Wesam Als...
 
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
Proof of O(log *n) time complexity of Union find (Presentation by Wei Li, Zeh...
 
Proof of Cook Levin Theorem (Presentation by Xiechuan, Song and Shuo)
Proof of Cook Levin Theorem (Presentation by Xiechuan, Song and Shuo)Proof of Cook Levin Theorem (Presentation by Xiechuan, Song and Shuo)
Proof of Cook Levin Theorem (Presentation by Xiechuan, Song and Shuo)
 
Online algorithms in Machine Learning
Online algorithms in Machine LearningOnline algorithms in Machine Learning
Online algorithms in Machine Learning
 
NP completeness
NP completenessNP completeness
NP completeness
 
Algorithmic Puzzles
Algorithmic PuzzlesAlgorithmic Puzzles
Algorithmic Puzzles
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
 
Set Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom FiltersSet Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom Filters
 
Binomial Heaps and Fibonacci Heaps
Binomial Heaps and Fibonacci HeapsBinomial Heaps and Fibonacci Heaps
Binomial Heaps and Fibonacci Heaps
 
R-Trees and Geospatial Data Structures
R-Trees and Geospatial Data StructuresR-Trees and Geospatial Data Structures
R-Trees and Geospatial Data Structures
 
Tries - Tree Based Structures for Strings
Tries - Tree Based Structures for StringsTries - Tree Based Structures for Strings
Tries - Tree Based Structures for Strings
 
Splay Trees and Self Organizing Data Structures
Splay Trees and Self Organizing Data StructuresSplay Trees and Self Organizing Data Structures
Splay Trees and Self Organizing Data Structures
 
BTrees - Great alternative to Red Black, AVL and other BSTs
BTrees - Great alternative to Red Black, AVL and other BSTsBTrees - Great alternative to Red Black, AVL and other BSTs
BTrees - Great alternative to Red Black, AVL and other BSTs
 
Binary Search Trees - AVL and Red Black
Binary Search Trees - AVL and Red BlackBinary Search Trees - AVL and Red Black
Binary Search Trees - AVL and Red Black
 
Graphs, Trees, Paths and Their Representations
Graphs, Trees, Paths and Their RepresentationsGraphs, Trees, Paths and Their Representations
Graphs, Trees, Paths and Their Representations
 
Stacks, Queues, Binary Search Trees - Lecture 1 - Advanced Data Structures
Stacks, Queues, Binary Search Trees -  Lecture 1 - Advanced Data StructuresStacks, Queues, Binary Search Trees -  Lecture 1 - Advanced Data Structures
Stacks, Queues, Binary Search Trees - Lecture 1 - Advanced Data Structures
 
Online Algorithms - An Introduction
Online Algorithms - An IntroductionOnline Algorithms - An Introduction
Online Algorithms - An Introduction
 
Learning to learn
Learning to learnLearning to learn
Learning to learn
 

Último

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Último (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

Graph Traversal Algorithms - Breadth First Search

  • 1. Analysis and Design of Algorithms BREADTH FIRST SEARCH, BRANCHING AND BOUNDING
  • 2.  Instructor Prof. Amrinder Arora amrinder@gwu.edu Please copy TA on emails Please feel free to call as well   Available for study sessions Science and Engineering Hall GWU Algorithms Graph Traversal Techniques, Branch & Bound 2 LOGISTICS
  • 3. Algorithms Analysis Asymptotic NP- Completeness Design D&C Greedy DP Graph B&B Applications Algorithms Graph Traversal Techniques, Branch & Bound 3 WHERE WE ARE  Done  Done  DFS, BFS  Done  Done
  • 4. Knowing that an object exists within a certain distance from us, in an infinite maze, how can we find it? Algorithms Graph Traversal Techniques, Branch & Bound 4 INFINITE MAZE
  • 5. 1. Select an unvisited node s, visit it, have it be the root in a BFS tree being formed. Its level is called the current level. 2. From each node x in the current level, in the order in which the level nodes were visited, visit all the unvisited neighbors of x. The newly visited nodes from this level form a new level that becomes the next current level. 3. Repeat the previous step until no more nodes can be visited. 4. If there are still unvisited nodes, repeat from Step 1. Algorithms Graph Traversal Techniques, Branch & Bound 5 BREADTH FIRST SEARCH (BFS)
  • 7.  Observations: The first node visited in each level is the first node from which to proceed to visit new nodes.  This suggests that a queue is the proper data structure to remember the order of the steps. Algorithms Graph Traversal Techniques, Branch & Bound 7 BFS IMPLEMENTATION
  • 8. Procedure BFS(input: graph G) Queue Q; Integer s, x while (G has an unvisited node) do s := an unvisited node visit(s) Enqueue(s,Q) While (Q is not empty) do x := Dequeue(Q) For (unvisited neighbor y of x) do visit(y) Enqueue(y,Q) Algorithms Graph Traversal Techniques, Branch & Bound 8 BFS PSEUDOCODE
  • 9.  Robotics  Optimization problems using Branch and Bound Algorithms Graph Traversal Techniques, Branch & Bound 9 BFS APPLICATIONS
  • 10.  Hamiltonian Cycle  K-clique  K-coloring Algorithms Graph Traversal Techniques, Branch & Bound 10 OTHER GRAPH PROBLEMS
  • 11. Algorithms Analysis Asymptotic NP- Completeness Design D&C Greedy DP Graph B&B Applications Algorithms Graph Traversal Techniques, Branch & Bound 11 WHERE WE ARE  Done  Done  Starting today..  Done  Done  Done
  • 12.  A systematic method for solving optimization problems  A general optimization technique that applies where the greedy method and dynamic programming fail.  Much slower – often leads to exponential time complexities in the worst case. If applied carefully, can lead to algorithms that run reasonably fast on average.  General idea of B&B is a BFS-like search for the optimal solution, but not all nodes get expanded.  Carefully selected criterion determines which node to expand and when  Another criterion tells the algorithm when an optimal solution has been found. Algorithms Graph Traversal Techniques, Branch & Bound 12 BRANCH AND BOUND
  • 13.  Given jobs, resources, and cost matrix (cost if resource i does job j), how to assign jobs to resources, such that each job is done by a different resource, and the overall cost is minimum?  What is the right D&C strategy?  What is the right BFS strategy? Algorithms Graph Traversal Techniques, Branch & Bound 13 B&B FOR JOB ASSIGNMENT J1 J2 J3 J4 J5 R1 2 4 5 3 11 R2 3 5 6 4 8 R3 4 3 5 7 9 R4 3 4 3 8 12 R5 4 2 6 4 9
  • 14. What is the lower bound? [In other words, how much will it cost at minimum to do the job assignment?] Each job must be done – so if we add minimum cost per job, then that must be minimum cost Each person must do a job – so if we add minimum cost per resource, then that must be minimum cost Taking the maximum of these two minimums, is a good “lower bound”. Algorithms Graph Traversal Techniques, Branch & Bound 14 LOWER BOUND
  • 15.  Any random assignment can be an upper bound  Or, we can use a greedy algorithm for upper bound.  In the context of a minimization problem, upper bound means: “Here is a solution that I have already found. We are not interested in solutions that are more expensive than this.” So, in other words, this solution now defines the highest cost (the upper bound on cost) that we are willing to pay.  If we find an even better solution, then we will decrease our upper bound. Algorithms Graph Traversal Techniques, Branch & Bound 15 UPPER BOUND
  • 16.  Assigning a job to a resource can be a node in the BFS tree  We need to think about the solution space as a tree, and define what a node in the tree means with respect to our problem (job assignment) Algorithms Graph Traversal Techniques, Branch & Bound 16 BRANCHING
  • 17.  B&B is a general algorithm for finding optimal solutions of various optimization problems, especially in discrete and combinatorial optimization.  2 main steps  Branching  Bounding  (If bounding allows, then) Node Elimination Algorithms Graph Traversal Techniques, Branch & Bound 17 MORE.. (FROM WIKIPEDIA)
  • 18.  We can consider a maximization problem just as easily in B&B as well.  In case of a maximization problem, the “lower bound” comes from a known solution. The “upper bound” comes from a theoretical/analytical solution that typically relaxes some constraint.  Lower bound signifies: A solution we already know exists  Upper bound signifies: Maximum value we could obtain, even if some constraints were relaxed.  An example of a maximization problem is a 0/1 knapsack problem. Algorithms Graph Traversal Techniques, Branch & Bound 18 B&B FOR MAXIMIZATION PROBLEMS
  • 19.  Given a set of items, each with a weight and a value, determine which items to include in a collection so that the total weight is less than a given limit and the total value is as large as possible.  Different from fractional knapsack, can only take or not take an item.  No easy solution – greedy solution may not be optimal. Algorithms Graph Traversal Techniques, Branch & Bound 19 0/1 KNAPSACK PROBLEM
  • 20.  3 Items. Knapsack can hold 50 lbs.  Item 1 weighs 10 lbs, worth 60$  Item 2 weighs 20 lbs, worth 100$  Item 3 weighs 30 lbs, worth 120$  Greedy solution: Item 1 + Item 2, worth = $160  Optimal solution: Item 3 + Item 2, worth = $220 Algorithms Graph Traversal Techniques, Branch & Bound 20 0/1 KNAPSACK EXAMPLE
  • 21.  Given a complete graph with n vertices, the salesperson wishes to make a tour, visiting each city exactly once and finishing at the city he starts from. Cost of going from city i to city j = c(i,j). Algorithms Graph Traversal Techniques, Branch & Bound 21 TRAVELING SALESPERSON PROBLEM (TSP)
  • 22.  Input: n jobs, n employees, and an n x n matrix A where Aij be the cost if person i performs job j.  Problem: Find a one-to-one matching of the n employees to the n jobs so that the total cost is minimized.  Formally, find a permutation f such that C(f), where C(f)=A1f(1) + A2f(2) + ... + Anf(n) is minimized. Algorithms Graph Traversal Techniques, Branch & Bound 22 JOB ASSIGNMENT PROBLEM
  • 23.  Do a Breadth First Search  Evaluate each node for upper and lower bounds  Branch into the “best” node  Terminate if solution meets performance parameters Algorithms Graph Traversal Techniques, Branch & Bound 23 BRANCH AND BOUND TEMPLATE
  • 24.  Branch and Bound depends upon being able to “bound” each node in the search tree, so that we can evaluate whether or not to expand it.  Lower bound and upper bound depend on the problem Algorithms Graph Traversal Techniques, Branch & Bound 24 BRANCH AND BOUND TEMPLATE (CONT.)
  • 25.  Using a mixture of upper and lower bounds, we can find when might be a right time to terminate the search. Algorithms Graph Traversal Techniques, Branch & Bound 25 TERMINATION CRITERIA
  • 26.  B&B is an interesting technique that uses BFS and bounding to eliminate the nodes in the search tree.  Can solve problems that are intrinsically harder.  Time complexity may not be polynomial, but may be practical.  We can return an approximate, usable solution with some bound on performance.  Developing interesting bounds depends upon the problem and uses problem specific insights. Algorithms Graph Traversal Techniques, Branch & Bound 26 SUMMARY
  • 27. Algorithms Analysis Asymptotic NP- Completeness Design D&C Greedy DP Graph B&B Applications Algorithms Graph Traversal Techniques, Branch & Bound 27 WHERE WE ARE  Done  Done  Done  Done  Done  Done
  • 28.  Job Assignment problem, Branch and Bound  Review slides again – Be ready to discuss lower bound and upper bounds  http://en.wikipedia.org/wiki/Branch_and_bound  “An Automatic Method of Solving Discrete Programming Problems”  http://rjlipton.wordpress.com/2012/12/19/branch- and-bound-why-does-it-work/  Preview: NP completeness and lower bound for coins problem. Algorithms Graph Traversal Techniques, Branch & Bound 28 READING ASSIGNMENT/PREVIEW