Академический Документы
Профессиональный Документы
Культура Документы
I Introduction d i
Virendra Singh g Indian Institute of Science g Bangalore
virendra@computer.org
Acknowledgement
z z
z z z z z
Prof. S.K. Nandy, SERC Prof. Kewal K. Saluja, Univ. of WisconsinMadison, USA Prof. Hideo Fujiwara, NAIST, Japan Prof. Vishwani Agrawal, Auburn University, USA Prof. Samiha Mourad, Santa Clara Univ., USA Prof. Erik Larsson, Linkoping Univ., Sweden Mr. Raj Singh, CEERI, PIlani
Aug 10, 2010 E0-285@SERC 2
Design of VLSI Systems Complex p system y Need systematic methodology Algorithms Can be automated Sh ld h Should handle dl very l large d designs i
E0-285@SERC
St t l D Structural Domain i
Processors ALU, RAM, .. Gates, FFs, .. Transistors Transistor Layout Cell Layout Module Layout Floorplan Physical Partitions
Physical Domain
Aug 10, 2010 E0-285@SERC
Algorithms
z z z z z z z
Mostly M l i intractable bl problems bl Exact Algorithms Approximate algorithms Branch and Bound Dynamic y Programming g g Greedy Algorithms Soft computing techniques
E0-285@SERC
Linear programming Li i (LP) is i a mathematical th ti l method for selecting the best solution from the available solutions of a problem. Method:
will be determined. Develop a linear programming model:
Types of LPs
z z z
LP all variables are real. ILP all variables are integers. g MILP some variables are integers, others are real. A reference:
E0-285@SERC
A Single-Variable Si l V i bl P Problem bl
z z
Consider variable x Problem: find the maximum value of x subject to constraint, 0 x 15. Solution: x = 15.
Constraint satisfied 0 15 Solution x = 15
Aug 10, 2010 E0-285@SERC 8
x0 5x 75 6x 30 x 10
5
( ) (3)
10
15
(2) (4)
x
(1)
A Two-Variable Problem
z
Material: 400 boards of wood Labor: 450 man-hours man hours Chair: $45 Table: $80 Chair
Profit:
Resources needed:
Table
Problem: How many y chairs and how many y tables should be manufactured to maximize the total profit?
Aug 10, 2010 E0-285@SERC 10
Manufacture x1 chairs and x2 tables to maximize profit: P = 45x1 + 80x2 dollars Subject to given resource constraints:
E0-285@SERC
11
Tables, x2 T
Best solution: 24 chairs, 14 tables P fit = 4524 + 8014 = 2200 dollars Profit d ll (24, 14) (3)
(1) 20
10 0 0 10
(4)
20 30
Chairs, x1
40
50
60
70
80
90
(2) decresing
increasing
E0-285@SERC
12
Manufacture x1 chairs and x2 tables to maximize profit: P = 64x1 + 80x2 dollars Subject to given resource constraints:
E0-285@SERC
Tables, x2 T
Best solution: 45 chairs, 0 tables P fit = 6445 + 800 = 2880 dollars Profit d ll
(1) 20
10
0 0
Chairs, x1
40
50
60
(2)
70
80
90
increasing g decresing 14
E0-285@SERC
AD Dual lP Problem bl
z
z
Explore an alternative.
Questions: Should we make tables and chairs? Or, auction off the available resources? To answer this question we need to know: What is the minimum price for the resources that will p provide us with same amount of revenue as the profits from tables and chairs? This is the dual of the original problem.
Aug 10, 2010 E0-285@SERC 15
z z
E0-285@SERC
16
If the primal has a finite optimal solution, so does the dual, and the optimum values of the objective functions are equal.
E0-285@SERC
17
Primal-Dual Problems
z
Primal problem
Dual Problem
Variables:
Variables:
z z
Solution:
Solution:
w1 = $1, $1 w2 = $4 value = $2200
18
E0-285@SERC
LP for f n Variables V i bl
minimize
cj xj
Objective function
j =1
subject to
aij xj
j =1 n
bi,
i = 1, 2, . . ., m
j =1
cij xj
= di,
i = 1, 2, . . ., p
Simplex method
G. B. Dantzig, Linear Programming and Extension, Princeton, New Jersey, Princeton University Press, 1963. L. G. Khachiyan, A Polynomial Algorithm for Linear Programming, Soviet Math. Dokl., vol. 20, pp. 191-194, 1984. N. K. Karmarkar, A New Polynomial-Time Algorithm for Linear Programming, Combinatorica, vol. 4, pp. 373-395, 1984.
Ellipsoid method
Interior-point method
E0-285@SERC
20
Extreme points
Constraints
Objective f function ti
C Constraints i
Objective f function
Interior-point methods: Successively iterate with interior spaces of analytic convex boundaries.
21
E0-285@SERC
Convert all variables to real real, preserve ranges ranges. LP solution provides guidance. Rounding LP solution can provide a non-optimal non optimal
solution.
E0-285@SERC
22
j=1 0 18 10 12 27
j=2 18 0 5 12 20
j=3 10 5 0 15 19
j=4 12 12 15 0 6
j=5 27 20 19 6 0
23
E0-285@SERC
Five-city problem: 4 3 2 1 = 24 tours Nine-city Nine city problem: 362 362,880 880 tours 14-city problem: 87,178,291,200 tours 50-city problem: 49! = 6.0810 6 081062 tours
Time for enumerative search assuming 1 s per tour evaluation = 1.931055 years y
E0-285@SERC
24
j=1 0 18 10 12 27
j=2 18 0 5 12 20
j=3 10 5 0 15 19
j=4 12 12 15 0 6
j=5 27 20 19 6 0
25
Integer variables: xij = 1, travel i to j xij = 0, do not travel i to j Real variables: dij = distance from i to j
x13 [0,1] d13 = 10 3 x12 + x13 + x14 + x15 = 2 f four other th similar i il equations ti
Aug 10, 2010
E0-285@SERC
26
xij = 2 ji
for all i
27
ILP Solution
d54 = 6
4 1 5
d21 = 18 d13 = 10
3 2
d45 = 6
d32 = 5
E0-285@SERC
28
Following constraints prevent split tours. For any subset S of cities, the tour must enter and exit that subset:
xij 2 for all S, |S| < 5 iS jS Remaining set At least two arrows must cross this boundary.
Any subset
Aug 10, 2010 E0-285@SERC 29
ILP Solution
d41 = 12
1 4
d54 = 6
5
d25 = 20 d13 = 10
3 2
d32 = 5
Total length = 53
E0-285@SERC
30
Characteristics of ILP
z z
Worst-case complexity is exponential in number of variables. Li Linear programming i (LP) relaxation, l ti where h i integer t variables are treated as real, gives a lower bound on the objective j function. Recursive rounding of relaxed LP solution to nearest integers gives an approximate solution to th ILP problem. the bl
E0-285@SERC
31
Algorithms
z
A Graph G(V, E) is a pair (V, E), where V is a set and E is a relation on V Directed Graph - the edges are ordered pairs of vertices Undirected Graph p edges g are unordered p pairs
E0-285@SERC
32
*
3
*
7
*
dx y
*
+
yl
8
xl
+ <
c
10
a
*
4
11
ul
E0-285@SERC 34
Graph Representation
1 d 4 a e c 3
1
2 b
2 1 0 0 0
3 1 1 0 0
4 1 0 1 0
1 2 3 4
0 0 0 0
E0-285@SERC
35
Graph Representation
1 d 4 a e c 3 2 b 2 3 4 1
2
3 4
E0-285@SERC
36
Graph Algorithms
Shortest h Path h Algorithms l h
Longest g Path Algorithms g Traveling Salesman Problem Maximal M i l Cliques Cli Graph Colouring Vertex Covering Minimum Spanning Tree
Aug 10, 2010 E0-285@SERC 37
Graph Algorithms
z z z z z z
Mostly intractable problems Approximate algorithms B Branch h and dB Bound d Dynamic Programming Greedy Algorithms Soft computing techniques
E0-285@SERC
38
Graph Algorithms
z z
10
1
30 10
100
Greedy algorithm Make local decision g greedily y Gives shortest path from a
source node
5
60
20
E0-285@SERC
39
Dijkstras Algorithms
10
1
30 10
Iter. S 100
V-S
w 2 4 3 5
D[2] 10 10 10 10 10
Init {1} {2 {2,3,4,5} 3 4 5} 1 2 3 4 {1,2} {3,4,5} {1,2,4} {3,5} {1,2,4,3} {5} {1,2,4,3,5}
2
50
5
60
20
E0-285@SERC
40
Dijkstras Algorithms
z z z
10
1
30 10
100
2 3
5
60
D[i] = C [1,i] initialize Choose a vertex w in V-S s.t. D[w] is minimum Add w to S F each For h vertex t v in i V-S V S do d
20
end
Aug 10, 2010 E0-285@SERC 41
Floyds Algorithms
z z
Make local decision and refine it later Gives shortest p path for all p pairs
2 8
2
5
E0-285@SERC
42
Floyds Algorithms
2 8
2
5
1 2 1 0 8 2 3 3 0 2 A0[i,j]
Aug 10, 2010
3 5 0
1 1 0 2 3 3
2 8 0
3 5 8 0
A1[i,j]
E0-285@SERC 43
Floyds Algorithms
2 8
2
5
1 2 1 0 8 2 3 3 5 A2[i,j]
Aug 10, 2010
3 5 8 0
1 1 0 2 3 3 5 A3[i,j]
E0-285@SERC
2 7 0 2
3 5 8 0
0 2
44
Floyds Algorithms
z z z
For j = 1 to n do
2
5
For I = 1 to n do
A[I i] = 0 A[I,i]
For i = 1 to n do
For j = 1 to n do
end
Aug 10, 2010 E0-285@SERC 45
Spanning Tree
z z z z
Free three F th that th t connects t all ll the th vertices ti Cost of a spanning tree is sum of edges Minimum Spanning Tree (MST) Prims Algorithm
Greedy algoritthm Start from an intial node U = {1} Grows G ST, ST one edge d at t a time ti At each step, it finds a shortest edge (u,v) that connects U and V V-U U and adds v to V V-U U from U
Aug 10, 2010 E0-285@SERC 46
Prims Algorithm
6
1
5 6 1
5 5 4
1 4
2
2
3
3
6
2
3
4
4 2
E0-285@SERC
47
Prims Algorithm
2
3 6 5 6
1
1
5 5 4
1 4 6 2 5 1 3 4 6 4
3
6 1
4 6
2
2 5
1 3
1 4 4 6 2 5 2 5 1 3 4 4 6
E0-285@SERC
1 2 3 5
48
2 5
1 3
1 3 4 4 6 2
Kruskals Algorithm
z z z
Start with a graph t = (V,) only vertices Each vertex is connected component in itself As algorithm progresses, To build progressively larger connected component
Have collection of connected components For each component select an edge for ST
Examine edges for E in order of increasing cost If the edge connects two vertices in two different connected component, tthen add edge to T
E0-285@SERC 49
Kruskals Algorithm
2
3 6 5 6
1
1
5 5 4
3
6 1
4 6
2
2 5
1 3 6
2 5
1 1 3 6
4 2
1 1 4 2 6 2 3 5 3 4 4 6
E0-285@SERC
1 2 3 5
50
2 3 5
1 3
1 3 4 4 6 2
Vertex Covering of an undirected graph G is a subset of the vertices s.t. each edge in E has h at t least l t one edge d in i th that t subset b t Heuristic
Select vertex with largest degree Deletion of a vertex corresponds to the removal
of f vertex itself i lf and d all ll edges d i incident id to i it
E0-285@SERC
51
3 1
Aug 10, 2010
4 2
3 1
E0-285@SERC
4 2
52
z z
Graph G h colouring l i problem bl of f an undirected di t d graph G is a labeling of vertices such that no edge in E has two end end-points points with the same label Search for a vertex colouring with minimum number of colours Most algorithms are based on sequential scan of vertex set where vertices are coloured one at a time
Aug 10, 2010 E0-285@SERC 53
THANK YOU
Aug 10, 2010 E0-285@SERC 54