Вы находитесь на странице: 1из 11

Branch and Bound

• Introduction to Scheduling
• Complexity
• Solving NP-Hard in the Strong Sense Problem
• Objective Function
• B&B
• Bounding VS Objective Function
• B&B in Search Tree
• B&B in general
• B&B Algorithm and Components
• Bounding Function
• Strategy to find next subproblem
• Example
• Conclusion
• References
Presented by Chaiyut Thanukaew 1

Introduction to Scheduling

What is a scheduling?
Scheduling*: a plan of work to be done in a specified order and by specified times

What is a scheduling problem?

Constraints Time
Tasks
Resources
(Jobs)
(Machines)

Objective(s)

Scheduling problems;
-Allocation of scarce resources to tasks over time
-Decision problem with one or more objective

*Encarta World English Dictionary 1999 2

1
Complexity

The complexity will determine running time of an algorithm used to solve such
the scheduling problem.

Easy problem (polynomial time complexity): There is an algorithm that


optimally solves the problem with time complexity O((n log(max( pj)) k) for
some fixed k.

NP-hard in the ordinary sense (pseudo polynomial time complexity): The


problem cannot be optimally solved by an algorithm with polynomial time
complexity but with an algorithm of time complexity O((n max pj) k).

NP-hard in the strong sense: The problem cannot be optimally solved by the
algorithm with pseudo polynomial complexity.
So, how to solve
(P) -Deterministic Polynomial Time Algorithm NP-hard?
(NP) –Non-deterministic Polynomial Time Algorithm

Solving NP-hard in the strong sense

There are usually 2 approaches;

• Heuristic Approach
=> yields satisfied solution in much faster time

• Branch and Bound Approach (B&B)


=> enumeration approach in Tree Topology
=> yields the best/ exact solution

When B&B?
- Scheduling problem in NP-hard
- Need an optimal solution
- With Tree Structure, the bound can help to eliminate infeasible solutions

2
Objective Function

In scheduling problem, we have to minimize* the objective function;

Where;
f : Objective function
X : Variable of (x1, x2,…,xn)
S : Region of feasible solutions (determined by general conditions on the variables)
*In case of maximization problems, it can be dealt with similarity.

Examples for NP-Hard problem


• 1 | rj | Lmax => Single machine, release and due dates, maximum lateness as the
objective
• Traveling Salesman Problem (TSP) => A goal is to find the shortest route that
starts at one city and visit each of a list of other cities exactly once before
returning to the first city
5

B&B -Bounding VS Objective Function

=> The basic idea of B&B is to enumerate the problem into Tree Topology then to
use the calculated bound for elimination of infeasible solutions.

f
Where;
g
f : Objective function
g : Bounding function
S S: Region of feasible solutions
P: Region of potential solutions
P

Bounding function

A function g(x) is defined on S (or P) with a property that g(x) <= f(x)
for all x in S (resp. in P).
6

3
B&B in Search Tree

Enumeration in the search tree


• Guaranteed for a feasible solution but exponential growth in computation time

root node Level 0


Original problem

child nodes Level 1


Subproblem with bounding function g
by adding 1 more constraint

child nodes
... Level 2
Subproblem with bounding function g
by adding 1 more constraint

leaves Level n
Value of feasible solutions
–upper bound

Each node is a partial solution, i.e. a part of the solution space. 7

B&B in General

• Solution of B&B is described as a search through a search tree


• Root node corresponds to the original problem
• Successor nodes correspond to subproblems deriving from predecessor nodes
with adding a single new constraint
• To each node in the tree, bounding function g associates a real number called
the bound for the node
• For leaves, the bound equals the value of feasible solutions –upper bound (UB),
whereas for internal nodes the value is the lower bound (LB) for the value of any
solution in the subspace corresponding to the node
• g is required to satisfy 3 conditions;
1. g (Pi) <= f (Pi) for all nodes Pi in the tree
2. g (Pi) = f (Pi) for all leaves in the tree
3. g (Pi) >= f (Pj) if Pj is the father of Pi
• These state that g is a bounding function, which for any leaf agrees with the
objective function, and which provides closer and closer bounds
8

4
B&B Algorithm and Components

B&B algorithms
1. Solve a lower bound for current node
If solution exceeds UB, the node is terminated –since g (Pi) <= f (Pi)
If not, branching this node.
2. Create branching to get subproblems by adding 1 new constraint (usually)
3. Repeat until no branch remains, return optimal solution consist with original
constraint. Note that at the leaves, g (Pi) = f (Pi)

B&B consists of 3 main components;


1. Bounding function
=> providing for a given subspace of the solution space
2. Strategy for selecting next subproblem
3. Branching rule
=>to be applied if a subspace after investigation can not be discarded

Bounding Function

Bounding function

• The key component of B&B algorithm


• Ideally, value of bounding function should equal the value of the best feasible
solution
• May use heuristic approach to find the value of the bound in case no optimal
algorithm exists
• Strong BF: closed to the optimal value
=> Hard to calculate but consume less time to find solution
• Weak BF: far from the optimal value
=> Easy to calculate but consume much time to find solution
• 2 approaches to convert NP-Hard problem to P-problem, then we can
determine a lower bound for the objective function;
- Relaxation –leave out some constraints of the original problem
- To maintain the feasible region but modify the objective function

10

5
Strategy for selecting next subproblem

Strategy for selecting next subproblem

• The best first search strategy (BeFS): selecting one among the live
subproblems those with the lowest bound

2. Breath first search strategy (BFS): all nodes at the same level of the search
tree are processed before any node any node at a higher level

3. Depth first search strategy (DFS): a live node with the largest level in the
search tree is explored firstly

11

Strategy for selecting next subproblem

The best first search strategy (BeFS):

How?
f =1, g = 0
1
1. Find f and then g
f =1, g = 0.5 f =2, g = 0.5
2. When g < f, branching
2 3
3. At any leaf, g = f
f=g=1 f = 3, g = 2.5 4. Ordering acc.to the
lowest bound
4 6 5 9
f=g=2 f=g=4

7 8
f=g=3 f=g=4

12

6
Strategy for selecting next subproblem

BFS and SFS can be done in similar manner.

f =1, g = 0 f =1, g = 0
1 1

f =1, g = 0.5 f =2, g = 0.5 f =1, g = 0.5 f =2, g = 0.5

2 3 2 7

f=g=1 f = 3, g = 2.5 f=g=1 f = 3, g = 2.5

4 5 6 7 3 4 8 9
f=g=2 f=g=4 f=g=2 f=g=4

8 9 5 6
f=g=3 f=g=4 f=g=3 f=g=4

Breadth First Search (BFS) Depth First Search (DFS)

13

Strategy for selecting next subproblem

Problem?
We may somehow need to calculate to find f and g of the live nodes till
the largest level.
Hmm…too tough!!!

Idea
To explore only the node with the small lower bound first hopefully leads to a
good feasible solution.

Solution
DFS combined with BeFS

14

7
B&B Example (1)

1 | rj | Lmax : Single machine, maximum lateness, release and due dates

Jobs 1 2 3 4
EDD rule (Earliest Due Date) is
p(j) 4 2 6 5
optimal algorithm to solve Lmax
r(j) 0 1 3 5 problem!
d(j) 8 12 11 10

(?,?,?,?) Level 0

Lower bound: EDD + preemption

(1,?,?,?) (2,?,?,?) (3,?,?,?) (4,?,?,?) Level 1

15

B&B Example (1)

Lower bound for: (1,?,?,?)


Jobs 1 2 3 4
=>EDD rule + preemption
p(j) 4 2 6 5
r(j) 0 1 3 5
r(2) r(3) r(4)
d(j) 8 12 11 10

1 3 4 3 2
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
t

d(4)<d(3) d(3)<d(2)

Lower bound: Lmax = max(0,17-12,15-11,0) = 5

EDD: Earliest Due Date first (optimal algorithm for Lmax problem)
Preemption: The processing of a job can be interrupted and later resumed (on the same or another machine)
Lateness of job j: Lj= Cj–dj
Maximum lateness: Lmax=max (L1,..., Ln) 16

8
B&B Example (1)

Jobs 1 2 3 4
p(j) 4 2 6 5 (?,?,?,?) Level 0
r(j) 0 1 3 5
d(j) 8 LB=5
12 11 10 LB=5, UB=6 LB=7=UB

(1,?,?,?) (2,?,?,?) (3,?,?,?) (4,?,?,?) Level 1

Can be canceled because within


LB=5=UB (1,3,4,2) LB=6=UB release date of job 3 and 4, job 1
and 2 could be finished
LB=6=UB (1,4,3,2) beforehand. That means we can
(1,2,?,?) (1,3,?,?) (1,4,?,?) Level 2
(1,2,4,3) not get the best objective value if
we begin the schedule with job 3
and 4.

(1,2,4,3) (1,3,4,2) (1,4,3,2) Level 3

Optimal sequence 17

B&B Example (1)

What do we get from the example?

• We can eliminate some nodes due to constraint of the original problem without
calculation.
• We have EDD rule to optimally solve Lmax problem at hand and preemptive
EDD to find the minimal bound.
⇒What about other problems without algorithm to solve optimally or very
tough problems e.g. TSP?
• In this problem, we use Relaxation to find value of the lower bound. We can
say the resulting value of the lower bound is a solution to an “easier” problem.
• We also use DFS combining with BeFS Strategy for selecting next
subproblem.
• To solve B&B efficiently and quickly may demand personal experiences even
to program software to solve it.

18

9
B&B Example (2)

Traveling Salesman Problem (TSP)


=> A goal is to find the shortest route that starts at one city and visit each of a list
of other cities exactly once before returning to the first city

Cities and distance between each city


19

Conclusion

• B&B is employed to solve NP-hard problem.


• The basic idea of B&B is to enumerate the problem into Tree Topology
then to use the calculated bound for elimination of infeasible solutions.
• Bounding value is the key of B&B but may not easy to calculate. Improper
bound could make us using much effort to get the optimal solution.
• Suitable strategy to select next subproblem can help us to find the solution
faster.
• To solve B&B efficiently and quickly may demand personal experiences and
depends on questions we are solving if there exist available algorithm or
not.

Thank You!

20

10
References

[1] Jens Clausen, Branch and Bound Algorithms –Principles and Examples

[2] E. L. Lawer and D. E. Wood, Branch-and-bound Methods: A Survey, The


University of Michigan

[3] Michael Pinedo, Scheduling –Theory, Algorithms, and Systems, 2nd edition,
2002, Prentice-Hall Inc. Pearson Education

21

11

Вам также может понравиться