Professional Documents
Culture Documents
15 - Combinatorial-Search-and-Optimizations PDF
15 - Combinatorial-Search-and-Optimizations PDF
11/10/2012
11/10/2012
CSP: Examples
8-Queens Knapsack (0/1) TSP LCS (Longest Common Subsequence) Edit Distances LIS (Longest Increasing Subsequence) Shortest Paths Matrix Chain Multiplications
Greedy (Ex: Vertex Cover) Dynamic Programming (Ex: TSP) Linear Programming
11/10/2012
Backtracking
Idea: it is often possible to reject a solution by looking at just a small portion of it
Ex: SAT, if (x1 V x2) is a clause, then x1=x2=0 (i.e. false) can be instantly eliminated In other word, of the search space can straight be eliminated
SAT
11/10/2012
SAT
8-Queens
Placing 8 queens on the chessboard such that no two queens do not attack each other
A SOLUTION ?
11/10/2012
Backtracking: 4-Queens
*
* *
* *
This amount of further search can be avoided Further, so we backtrack to other branches
11/10/2012
B&B: TSP
2
10 2 1
10 1
15
1 2 2 15 1 2 3 1
A Solution here is = 7
3
0/1 Knapsack is an optimization problem However, its a maximization problem (NOT MINIMIZATION) So, how to use B&B to prune the search?
The Idea: Convert maximization problem into minimization problem!
11/10/2012
{ }, {2,3,4}, C=8, OF = 20
{ 1,2, 4}, { }, C= 0, OF = 7
Objective Function = the cost of the items rejected so far Hence, (minimize) objective function OF = 7 for this solution
11/10/2012
TSP