Professional Documents
Culture Documents
Useful Combinatorial Optimization Algorithms
Useful Combinatorial Optimization Algorithms
Professor Chien-Mo James Li Graduate Institute of Electronics Engineering National Taiwan University
Algorithms NTUEE
Outline
Introduction Exponential time Algorithms
Exhaustive search / Branch and Bound Mathematical Programming Randomized Algorithms Simulated annealing Genetic algorithm Heuristic Tseng and Siewiorek Algorithm (minimum clique partition) Quine-McCluskey Algorithm (minimum set covering)
Algorithms
NTUEE
Combinatorial Optimization
Combinatorial Optimization
Find an optimal solution from a finite set of objects instances and solutions are discrete exhaustive search is often not feasible Continuous optimization Input instance and the solution set can be continuous
Algorithms
Algorithms
NTUEE
Algorithms
NTUEE
[Wikipedia]
Guarantee to be a fixed percentage away from the optimum Exponential algorithms Branch and Bound/Exhaustive search (Feasible only when the problem size is small) Mathematical programming: Integer Linear programming , 0/1 ILP Local search: Simulated annealing (hill climbing), genetic algorithms, etc Randomized algorithms: Make use of a randomizer for operation Heuristics: No formal guarantee of performance
Others: Pseudo-polynomial time algorithms: e.g. Dynamic programming for 0-1 Knapsack problem Probabilistic algorithms: Assume some probabilistic distribution of the instances. Restriction: Work on some special cases of the original problem.
Algorithms
NTUEE
Outline
Introduction Exponential time Algorithms
Exhaustive search / Branch and Bound Mathematical Programming Randomized Algorithms Simulated annealing Genetic algorithm Heuristic
Algorithms
NTUEE
Exhaustive search
General principle
Systematically assign values to unspecified variables until a single point in search space is identified , or An implicit constraints makes it impossible to continue backtracking Example: TSP X means backtracking
Algorithms
NTUEE
Algorithms
NTUEE
exhaustive: 72 nodes!
10
Finding lower bound is not easy all the time Still too many branches when problem is large
Algorithms
NTUEE
11
11
Outline
Introduction Exponential time Algorithms
Exhaustive search / Branch and Bound Mathematical Programming Randomized Algorithms Simulated annealing Genetic algorithm Heuristic
Algorithms
NTUEE
12
Linear Programming
General principle
Convert problems into a mathematical LP problem Canonical form of LP AXb X0 Integer Linear Programming (ILP) Variables are restricted to integers 0-1 ILP Solutions are restricted to 0,1 Why ILP useful for optimization? Problem independent ILP solvers are widely available Runs fast in most cases (although worst case not polynomial)
Algorithms
NTUEE
13
13
Subject to constraints
w(e ) x
i i =1
12
Algorithms
14
14
{v1, v 2, v 3}{v 4, v 5, v 6} : x 3 + x 4 + x 6 + x 7 + x 8 + x 9 2 {v1, v 3, v 5}{v 2, v 4, v 6} : x1 + x 4 + x 5 + x 9 + x10 + x12 2 {v1, v 2, v 4}{v 3, v 5, v 6} : x 2 + x 3 + x 5 + x 6 + x10 + x11 2
Algorithms NTUEE
15
15
Type I&II: number of constraints grows exponentially with n Type III: add aux variables ui = (2, 3, ...n)
Number of constraints: n2
NTUEE
Algorithms
16
Outline
Introduction Exponential time Algorithms
Exhaustive search / Branch and Bound Mathematical Programming Randomized Algorithms Simulated annealing Genetic algorithm Heuristic Quine-McCluskey for SOP minimization
Algorithms
NTUEE
17
Local Search
General principle
Search only the neighbors of the current solution Move to the neighbor with lower cost than the current solution Problem Can be trapped in local minimum
Algorithms
NTUEE
18
Algorithms
NTUEE
19
Pseudo Code of SA
Algorithms
NTUEE
20
Tabu Search
General Principle: avoid staying in the taboo solutions
Keep a list of visited solutions : taboo list Always move to a new solution other than the taboo list even the new solution is poor than the current solution
Algorithms
NTUEE
21
Survival of the fittest (s) Keep a group of feasible solutions population Parent population generates the child population Keep only the best children
Algorithms
NTUEE
22
Important steps in GA
Cross over: Two feasible solutions generate their child by switching
chromosomes
Algorithms
NTUEE
23
Pseudo Code of GA
Algorithms
NTUEE
24
Outline
Introduction Exponential time Algorithms
Exhaustive search / Branch and Bound Mathematical Programming Randomized Algorithms Simulated annealing Genetic algorithm Heuristic Tseng and Siewiorek Algorithm (minimum clique partition) Quine-McCluskey Algorithm (minimum set covering)
* Heuristic refers to experience-based techniques for problem solving, where the exhaustive search is impractical. [Wikipedia]
Algorithms
NTUEE
25
26
Compatibility Graph
Compatibility graph G(V, E)
vertex vi represents a test cube ti edge eij between vi and vj means two test cubes are compatible test cubes in a clique can be merged into one test cube Example
t0 t1 t2 t3 t4 t5 t6 0xx10 0xx1x 0x01x 01xx0 x0xx0 1xxxx x1x00 11xx0
t7
NP-hard
Algorithms
NTUEE
27
28
T & S Example
combine vertices step by step select two vertices of maximum common neighbors supervertices is a set of vertices
t0,1,2,3 t4 t5, 6, 7
Algorithms NTUEE
29
Outline
Introduction Exponential time Algorithms
Exhaustive search / Branch and Bound Mathematical Programming Randomized Algorithms Simulated annealing Genetic algorithm Heuristic Tseng and Siewiorek Algorithm (maximum clique ) Quine-McCluskey Algorithm (minimum set covering)
Algorithms
NTUEE
30
Set-Covering Problem
Given a finite set X, and a family F of subsets of X subset S F covers its elements
X=U S
SF
Optimization problem
minimum size of C Decision problem exist a covering C size k? exercise: prove set covering is NPC (Hint: use vertex covering) Applications of Set-Covering find minimum of people (C) that perform all tasks (X) minimum 2-level combinational circuit design
NTUEE
Algorithms
31
Greedy-Set-Cover
Each iteration chooses the subset that covers most elements
Algorithms
32
Algorithms
NTUEE
33
Quine-McCluskey Algorithm
Invented in 1956, one of the earliest EDA algorithms Two-step process
1. Generate all Prime Implicants (PI) PI = product term that cannot be combined with other terms 2. Select minimum number of PI
set-covering
Algorithms
NTUEE
34
at least ONE of the following terms must be covered abcd + abcd + abcd + abcd + abcd + abcd + abcd called On-set abcd+abcd+abcd may or may not be covered ab a called Dont-care set cd 00 01 11 10 None of the others can be covered called Off-set 00 0 X 1 1
01
0 0 0
1 X 1 b
1 X 0
1 d 0 1
11
c
10
Algorithms
NTUEE
35
zero 1 one 1
two 1
three 1 four 1
Algorithms
36
| |
1111 |
Algorithms
37
0000 | 0100 | 1000 | 0101 | 0110 | 1001 | 1010 | 0111 | 1101 | 1111 |
Algorithms
0-00 * -000 *
01-- * -1-1 *
010- | 01-0 | 100- * 10-0 * 01-1 | -101 | 011- | 1-01 * -111 | 11-1 |
NTUEE
7 Prime Implicants: 0-00 = a'c'd' 100- = ab'c' 1-01 = ac'd -1-1 = bd -000 = b'c'd' 10-0 = ab'd' 01- - = a'b
38
Karnaugh Map
PI on Karnaugh map
a
10
X 0 0 0
1 1 X 1 b
0 1 X 0
1 1 d 0 1
01
11
c
10
7 Prime Implicants : 0-00 = a'c'd' 100- = ab'c' 1-01 = ac'd -1-1 = bd -000 = b'c'd' 10-0 = ab'd' 01-- = a'b
Algorithms
NTUEE
39
PI Table
4 0,4 (0-00) 0,8 (-000) 8,9 (100-) 8,10 (10-0) 9,13 (1-01) 4,5,6,7 (01- -) 5,7,13,15 (-1-1) 5 6 8 9 10 13
rows = prime implicants columns = ON-set elements X" means ON-set element is covered by the prime implicant
Algorithms NTUEE
40
essential rows
5,7,13,15 (-1-1)
If column has a single X, it is distinguished. The implicant associated with the row is essential. Essential rows must appear in the minimum cover .
Algorithms NTUEE
distinguished columns 41
Algorithms
NTUEE
42
Final Result
4 0,4 (0-00) 0,8 (-000) 8,9 (100-) 8,10 (10-0) 9,13 (1-01) 4,5,6,7 (01- -) 5,7,13,15 (-1-1) 5 6 8 9 10 13
Find minimum set of rows that cover the remaining columns f = ab'd' + ac'd + a'b
Algorithms NTUEE
43
FFT
Can Quine-McCluskey find optimal solution for all cases?
obviously not ... set-covering is NPC Give an example where PI table has neither essential rows nor distinguished columns Quine-McCluskey has trouble finding optimal solution
Algorithms
NTUEE
44