Presentation is loading. Please wait.

Presentation is loading. Please wait.

SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 1 Hardware/Software Codesign of Embedded Systems OPTIMIZATION II Voicu Groza SITE Hall, Room.

Similar presentations


Presentation on theme: "SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 1 Hardware/Software Codesign of Embedded Systems OPTIMIZATION II Voicu Groza SITE Hall, Room."— Presentation transcript:

1

2 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 1 Hardware/Software Codesign of Embedded Systems OPTIMIZATION II Voicu Groza SITE Hall, Room 5017 562 5800 ext. 2159 Groza@SITE.uOttawa.ca

3 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 2 Hill Climbing Simulated Annealing Tabu search

4 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 3 Hill Climbing (Gradient Descent) 3.Choose the neighbour with the best quality and move to that state. 4.Repeat 2 through 4 until all the neighbouring states are of lower quality. 5.Return the current state as the solution state. Trying to maximize a function 1.Pick a random point in the search space. 2.Consider all the neighbours of the current state. http://www.ndsu.nodak.edu/instruct/juell/vp/cs724s00/hill_climbing/ hill_climbing.html

5 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 4 Hill Climbing Algorithm Function HILL-CLIMBING(Problem) returns a solution state Inputs: Problem, problem Local variables: Current, a node Next, a node Current = MAKE-NODE(INITIAL-STATE[Problem]) Loop do Next = a highest-valued successor of Current If VALUE[Next] < VALUE[Current] then return Current Current = Next End (Russell, 1995)

6 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 5 Problems in Hill Climbing Foothills are potential traps for the algorithm. A plateau is a flat area of the search space in which a whole set of neighbouring states have the same value. On a plateau, it is not possible to determine the best direction in which to move by making local comparisons. Possible solutions: Try several runs, multi-start hill-climb: each starting at a random point in the search space. Increase the size of the neighbourhood There is no guarantee to find a global optimum. Tendency to get stuck at foothills, a plateau or a ridge. If the algorithm reaches any of them, it will fail to find a solution. Local maxima = states that are better than all its neighbours but are not better than some other states farther away. http://www.cs.nott.ac.uk/~gxk/courses/g5baim/Hill% 20Climbing/Hill02-problems.html

7 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 6 Simulated Annealing  Motivated by the physical annealing process  Material is heated and slowly cooled into a uniform structure  Simulated annealing mimics this process  The first SA algorithm was developed in 1953 (Metropolis)  Compared to hill climbing the main differences are that  SA allows downwards steps;  a move is selected at random and then decides whether to accept it  In SA better moves are always accepted. Worse moves are not always accepted!? Dr. Graham Kendall, The University of Nottingham, UK

8 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 7 To accept or not to accept - SA? P = exp(-c/t) > r where –c is change in the evaluation function –t the current temperature –r is a random number between 0 and 1 Example The law of thermodynamics states that at temperature t, the probability of an increase in energy of magnitude, δE, is given by P(δE) = exp(-δE /kt) where k is Boltzmann’s constant

9 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 8 To accept or not to accept - SA?  The probability of accepting a worse state is a function of both the temperature of the system and the change in the cost function  As the temperature decreases, the probability of accepting worse moves decreases  If t = 0, no worse moves are accepted (i.e. hill climbing)

10 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 9 SA Algorithm The most common way of implementing an SA algorithm is to implement hill climbing with an accept function and modify it for SA Function SIMULATED-ANNEALING(Problem, Schedule) returns a solution state Inputs: Problem, a problem Schedule, a mapping from time to temperature Local Variables : Current, a node Next, a node T=“temperature” controlling the probability of downward steps Current = MAKE-NODE(INITIAL-STATE[Problem]) Russell/Norvig

11 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 10 SA Algorithm For i = 1 to  do T = Schedule[i] If T = 0 then return Current Next = a randomly selected successor of Current  E = VALUE[Next] – VALUE[Current] if  E > 0 then Current = Next else Current = Next only with probability exp(-  E/T)

12 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 11 SA Algorithm - Observations The cooling schedule is hidden in this algorithm, and important are –Starting Temperature –Final Temperature –Temperature Decrement –Iterations at each temperature The algorithm assumes that annealing will continue until temperature is zero - this is not necessarily the case

13 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 12 SA Cooling Schedule - Starting Temperature Must be hot enough to allow moves to almost neighbourhood state (else we are in danger of implementing hill climbing) Must not be so hot that we conduct a random search for a period of time Problem is finding a suitable starting temperature

14 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 13 SA Cooling Schedule – Starting Temperature Starting Temperature - Choosing –If we know the maximum change in the cost function we can use this to estimate –Start high, reduce quickly until about 60% of worse moves are accepted. Use this as the starting temperature –Heat rapidly until a certain percentage are accepted the start cooling

15 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 14 SA Cooling Schedule - Final Temperature It is usual to let the temperature decrease until it reaches zero However, this can make the algorithm run for a lot longer, especially when a geometric cooling schedule is being used In practice, it is not necessary to let the temperature reach zero because the chances of accepting a worse move are almost the same as the temperature being equal to zero => the stopping criteria can either be a suitably low temperature or when the system is “frozen” at the current temperature (i.e. no better or worse moves are being accepted)

16 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 15 SA Cooling Schedule - Temperature Decrement Theory states that: should allow enough iterations at each temperature so that the system stabilises at that temperature the number of iterations at each temperature to achieve this might be exponential to the problem size => compromise: –doing a large number of iterations at a few temperatures, or –a small number of iterations at many temperatures or –a balance between the two

17 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 16 SA Cooling Schedule - Temperature Decrement Linear –temp = temp - x Geometric –temp = temp * α –Experience has shown that α should be between 0.8 and 0.99, with better results being found in the higher end of the range. Of course, the higher the value of α, the longer it will take to decrement the temperature to the stopping criterion

18 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 17 SA Cooling Schedule - Iterations POSSIBLE APPROACHES: 1.A constant number of iterations at each temperature 2.Lundy, 1986: do only one iteration at each temperature, but to decrease the temperature very slowly t = t/(1 + βt) where β is a suitably small value 3.Dynamically change the number of iterations as the algorithm progresses: –at lower temperatures a large number of iterations are done so that the local optimum can be fully explored –at higher temperatures, the number of iterations can be less

19 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 18 Problem Specific Decisions The cooling schedule is all about SA but there are other decisions which we need to make about the problem These decisions are not just related to SA

20 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 19 Problem Specific Decisions - Cost Function The evaluation function is calculated at every iteration Often the cost function is the most expensive part of the algorithm =>Need to evaluate the cost function as efficiently as possible –Use Delta Evaluation –Use Partial Evaluation The cost function should be designed to lead the search –Avoid cost functions where many states return the same value. This can be seen as representing a plateau in the search space which the search has no knowledge about which way it should proceed

21 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 20 Problem Specific Decisions - Cost Function Many cost functions cater for the fact that some solutions are illegal. This is achieved using constraints Hard Constraints : these constraints cannot be violated in a feasible solution Soft Constraints : these constraints should, ideally, not be violated but, if they are, the solution is still feasible –Hard constraints are given a large weighting. The solutions which violate those constraints have a high cost function –Soft constraints are weighted depending on their importance –Weights can be dynamically changed as the algorithm progresses. This allows hard constraints to be accepted at the start of the algorithm but rejected later

22 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 21 Problem Specific Decisions - Neighbourhood How do you move from one state to another? When you are in a certain state, what other states are reachable? Some results have shown that the neighbourhood structure should be symmetric. That is, if you move from state i to state j then it must be possible to move from state j to state i However, a weaker condition can hold in order to ensure convergence. Every state must be reachable from every other. Therefore, it is important, when thinking about your problem to ensure that this condition is met

23 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 22 Problem Specific Decisions - Performance What is performance? –Quality of the solution returned –Time taken by the algorithm We already have the problem of finding suitable SA parameters (cooling schedule)

24 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 23 Problem Specific Decisions - Initialisation –Start with a random solution and let the annealing process improve on that. –Might be better to start with a solution that has been heuristically built (e.g. for the TSP problem, start with a greedy search)

25 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 24 Problem Specific Decisions - Hybridisation … or mimetic algorithms: Combine two search algorithms –Often a population based search strategy is used as the primary search mechanism, and a local search mechanism is applied to move each individual to a local optimum –It may be possible to apply some heuristic to a solution in order to improve it

26 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 25 Example: VLSI Floorplanning with Simulated Annealing Modules are displayed as yellow rectangles; terminals are marked by small black rectangles. Connections between modules are displayed using red lines. This display of nets is sometimes known as a "rat's nest" diagram. On the left, it displays a diagram of a floorplan and its estimated cost. On the right, it displays annealing status information, controls, and a plot of maximum (red), average (black), and minimum (green) accepted configuration costs at each temperature. http://foghorn.cadlab.lafayette.edu/cadapplets/fp/fpApplet.html

27 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 26 SA Modifications – Acceptance Probability The probability of accepting a worse move is normally based on the physical analogy (based on the Boltzmann distribution) Is there any reason why a different function will not perform better for all, or at least certain, problems? Why should we use a different acceptance criteria? –The one proposed does not work. Or we suspect we might be able to produce better solutions –The exponential calculation is computationally expensive. –(Johnson, 1991) found that the acceptance calculation took about one third of the computation time

28 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 27 SA Modifications – Acceptance Probability Johnson experimented with P(δ) = 1 – δ/t This approximates the exponential A better approach was found by building a look-up table of a set of values over the range δ/t During the course of the algorithm δ/t was rounded to the nearest integer and this value was used to access the look-up table This method was found to speed up the algorithm by about a third with no significant effect on solution quality

29 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 28 SA Modifications - Cooling If you plot a typical cooling schedule you are likely to find that at high temperatures many solutions are accepted If you start at a too higher temperature a random search is emulated and until the temperature cools sufficiently any solution can be reached and could have been used as a starting position At lower temperatures, a plot of the cooling schedule, is likely to show that very few worse moves are accepted; almost making simulated annealing emulate hill climbing Taking this one stage further, we can say that simulated annealing does most of its work during the middle stages of the cooling schedule

30 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 29 SA Modifications - Cooling Connolly suggested annealing at a constant temperature! But what temperature? It must be high enough to allow movement but not so low that the system is frozen But, the optimum temperature will vary from one type of problem to another and also from one instance of a problem to another instance of the same problem One solution to this problem is to spend some time searching for the optimum temperature and than stay at that temperature for the remainder of the algorithm The final temperature is chosen as the temperature that returns the best cost function during the search phase

31 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 30 SA Modifications - Neighbourhood The neighbourhood of any move is normally the same throughout the algorithm but… The neighbourhood could be changed as the algorithm progresses For example, a cost function based on penalty values can be used to restrict the neighbourhood if the weights associated with the penalties are adjusted as the algorithm progresses

32 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 31 SA Modifications – Cost Function The cost function is calculated at every iteration of the algorithm Various researchers (e.g. Burke,1999) have shown that the cost function can be responsible for a large proportion of the execution time of the algorithm Some techniques have been suggested which aim to alleviate this problem: (Rana, 1996) - Coors Brewery –GA but could be applied to SA –The evaluation function is approximated (one tenth of a second) –Potentially good solution are fully evaluated (three minutes)

33 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 32 SA Modifications – Cost Function (Ross, 1994) uses delta evaluation on the timetabling problem –Instead of evaluating every timetable as only small changes are being made between one timetable and the next, it is possible to evaluate just the changes and update the previous cost function using the result of that calculation (Burke, 1999) uses a cache –The cache stores cost functions (partial and complete) that have already been evaluated –They can be retrieved from the cache rather than having to go through the evaluation function again

34 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 33 Tabu Search Overview Tabu – socially or culturally proscribed: forbidden to be used, mentioned, or approached because of social or cultural rather than legal prohibitions. ( http://encarta.msn.com/dictionary_1861698691/taboo.html ) http://encarta.msn.com/dictionary_1861698691/taboo.html The Tabu search proceeds according to the supposition that there is no point in accepting a new (poor) solution unless it is to avoid a path already investigated. Tabu search is based on introducing flexible memory structures in conjunction with strategic restrictions (Tabu lists) and aspiration levels as a means for exploiting search spaces.

35 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 34 Characteristics Always performs best move or least non-improving move Employs a memory to diversify or intensify the search Is deterministic (although probabilistic elements may exist) Three main strategies: –Forbidding strategy: control what enters the tabu list –Freeing strategy: control what exits the tabu list and when –Short-term strategy: manage interplay between the forbidding strategy and freeing strategy to select trial solutions

36 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 35 To exploit memory in tabu search => classify a subset of the moves in a neighborhood as forbidden (or tabu)* A neighborhood is constructed to identify adjacent solutions that can be reached from current solution. The classification depends on the history of the search, and particularly on the recency or frequency that certain move or solution components, called attributes, have participated in generating past solutions*. A tabu list records forbidden moves, which are referred to as tabu moves [5]. Tabu restrictions are subject to an important exception. When a tabu move has a sufficiently attractive evaluation where it would result in a solution better than any visited so far, then its tabu classification may be overridden. A condition that allows such an override to occur is called an aspiration criterion*. Basic Ingredients of Tabu Search * Glover, F. and Laguna, M., “Tabu Search.,” Norwell, MA: Kluwer Academic Publishers, 1997

37 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 36 Components of Tabu Search Encoding Initial solution Objective Function Move operator Definition of Neighbourhood Structure of Tabu list(s) Aspiration criteria (optional) Termination criteria procedure tabu search begin initialize Tabu List (TL) = empty generate a (current} solution S let S* = S be the best solution so far repeat select the best point B in the neighbourhood of S: N(S) if(B is not Tabu: B  TL) accept move: S=B update Tabu List: TL = TL  B if(eval(B) > eval(S*)) S* = B else if (eval(B) > eval(S*)) accept move: S = B update best: S* = B end until (acceptable move found) until (halting-criterion)

38 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 37 Components Initial Solution –Random –Constructive Memory Aspects 1.Recency (short term) How recently was I here? 2.Frequency (long term) How often have I been here ? 3.Quality (aspiration) How good is being here? 4.Influence (aspiration) How far away am I from where I have just been ?

39 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 38 Components Tabu List Specifics The main objective of the tabu list is to avoid “cycles”, thus making a global optimizer rather than a local optimizer. Length – fixed or dynamic (generally 7 to 20) Content - “from” attributes, “to” attributes; “move” attributes; the more specific, the less restrictive Frequency - tallying similar solutions through tabu content. Usually used in penalty form rather than strict tabu.

40 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 39 Components Neighbourhood Complete (deterministic) Partial (probabilistic) First improvement Only improving Aspiration criteria specifics Best so far (Global) Best in neighbourhood (Local) Dissimilar to existing solution (diversification) Similar to existing solution (intensification) High influence – degree of change in structure or feasibility

41 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 40 Basic Tabu Search Algorithm Step 1: Choose an initial solution i in S. Set i* = i and k=0. Step 2: Set k=k+1 and generate a subset V* of solution in N(i,k) such that either one of the Tabu conditions is violated or at least one of the aspiration conditions holds. Step 3: Choose a best j in V* and set i=j. Step 4: If f(i) < f(i*) then set i* = i. Step 5: Update Tabu and aspiration conditions. Step 6: If a stopping condition is met then stop. Else go to Step 2.

42 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 41 Tabu Search Stopping Conditions Some immediate stopping conditions could be the following: 1.N(i, K+1) = 0. (no feasible solution in the neighborhood of solution i) 2.K is larger than the maximum number of iterations allowed. 3.The number of iterations since the last improvement of i* is larger than a specified number. 4.Evidence can be given than an optimum solution has been obtained. Hillier and Lieberman outlined the tabu search stopping criterion by, for example, using a fixed number of iterations, a fixed amount of CPU time, or a fixed number of consecutive iterations without an improvement in the best objective function value. Also stop at any iteration where there are no feasible moves into the local neighborhood of the current trial solution.

43 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 42 Flowchart of a Tabu Search Algorithm Initial solution (i in S) Create a candidate list of solutions Evaluate solutions Choose the best admissible solution Stopping conditions satisfied ? Update Tabu & Aspiration Conditions Final solution No Yes

44 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 43 Example : N-Queens Problem Consists of placing n queens on an n  n chessboard in such a way that no two queens capture each other (aspiration criterion) Q QQ Q 3 2 1 1234 4

45 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 44 Encoding The n-queens problem can be represented as a permutation problem. Let the queens be indexed by i Mark queen i with the row’s index i Let  (i) be the index of the column where queen i is placed A configuration is given by the permutation  = {  (1),  (2),…  (n)} Q Q Q Q 3 2 1 1234 4  = {3,1,4,2} Q 1 :  (1) = 3 Q 2 :  (2) = 1 Q 3 :  (3) = 4 Q 4 :  (4) = 2

46 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 45 Neighbourhood Swaps (pair-wise exchanges) can be used to define neighborhoods in permutation problems. 5463172 Current solution 1463572 Swap queens 2 and 6  =  ’ = move operator

47 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 46 Structure of Tabu List To prevent the search from repeating swapping combinations tried in the recent past, we will classify all swaps Tabu for three iterations. 6 5 4 3 2 1 234567 Tabu Memory Each cell contains the # iterations remaining until the corresponding queens are allowed to exchange positions again **

48 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 47 5463172 Current solution 71-2 swap value 42-2 62 65 51 1 Top 5 (of 21) Candidates 6 5 4 3 2 1 234567 Tabu Memory 3 2 1 1234567 7 6 5 4 # collisions = 4 Q Q Q Q Q Q Q Iteration - 0

49 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 48 5263174 Current solution: 42-1 swap value 610 520 211 31 1 Top 5 (of 20) Candidates 3 6 5 4 3 2 1 234567 Tabu Memory # collisions = 2 3 2 1 1234567 7 6 5 4 Q Q Q Q Q Q Q Iteration - 1 5463172 From Iteration 0: Swap Q 1 with Q 7

50 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 49 6253174 Current solution: 310 swap value 711 421 541 76 1 Top 5 (of 19) Candidates 3 2 6 5 4 3 2 1 234567 Tabu Memory Tabu 3 2 1 1234567 7 6 5 4 # collisions = 1 Q Q Q Q Q Q Q Iteration - 2 From Iteration 1: swap Q 2 with Q 4 5263174

51 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 50 6352174 Current solution 310 swap value 710 751 761 21 2 Top 5 (of 18) Candidates 2 31 6 5 4 3 2 1 234567 Tabu Memory 3 2 1 1234567 7 6 5 4 # collisions = 1 Q Q Q Q Q Q Q Tabu Iteration - 3 From Iteration 2: 6253174 swap Q 1 with Q 3

52 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 51 6352147 74 swap value 75 510 520 42 2 Top 5 (of 18) Candidates 1 3 2 6 5 4 3 2 1 234567 Tabu Memory 3 2 1 1234567 7 6 5 4 # collisions = 2 Q Q Q Q Q Q Q Tabu Iteration - 4 6352174 Current solution From Iteration 3: swap Q 5 with Q 7

53 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 52 6372145 31 swap value 610 750 651 71 2 Top 5 (of 18) Candidates 3 2 1 6 5 4 3 2 1 234567 Tabu Memory 3 2 1 1234567 7 6 5 4 # collisions = 1 Q Q Q Q Q Q Q * Tabu Tabu Iteration - 5 Satisfies aspiration criterion!!! 6352147 Current solution From Iteration 4: swap Q 4 with Q 7 *

54 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 53 6273145 2 1 6 5 4 3 2 1 234567 Tabu Memory 3 2 1 1234567 7 6 5 4 # collisions = 0 Q Q Q Q Q Q Q Iteration - 6 Search Terminates 6372145 Current solution From Iteration 5: swap Q 1 with Q 3

55 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 54 Example* –Minimum spanning tree problem with constraints. –Objective: Connects all nodes with minimum costs A B D CE 2030 1540 10 5 25 A B D CE 2030 1540 10 5 25 Costs An optimal solution without considering constraints Constraints 1: Link AD can be included only if link DE also is included. (penalty:100) Constraints 2: At most one of the three links – AD, CD, and AB – can be included. (Penalty of 100 if selected two of the three, 200 if all three are selected.) * Hillier, F.S. and Lieberman, G.J., “Introduction to Operations Research.” New York, NY: McGraw-Hill. 8th Ed., 2005

56 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 55 Example New cost = 75 (iteration 2) ( local optimum) A B D CE 2030 1540 10 5 25 DeleteAdd Iteration 1 Cost=50+200 (constraint penalties) AddDeleteCost BE CE AC AB 75+200=275 70+200=270 60+100=160 CD AD AC 60+100=160 65+300=365 DE CE AC AD 85+100=185 80+100=180 75+0=75 Constraints 1: Link AD can be included only if link DE also is included. (penalty:100) Constraints 2: At most one of the three links – AD, CD, and AB – can be included. (Penalty of 100 if selected two of the three, 200 if all three are selected.) * Hillier, F.S. and Lieberman, G.J., “Introduction to Operations Research.” New York, NY: McGraw-Hill. 8th Ed., 2005

57 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 56 Example * A tabu move will be considered only if it would result in a better solution than the best trial solution found previously (Aspiration Condition) Iteration 3 new cost = 85 Escape local optimum A B D CE 2030 1540 10 5 25 Tabu Delete Add Tabu list: DE Iteration 2 Cost=75 AddDeleteCost AD DE* CE AC Tabu move 85+100=185 80+100=180 BE CE AC AB 100+0=100 95+0=95 85+0=85 CD DE* CE 60+100=160 95+100=195 Constraints 1: Link AD can be included only if link DE also is included. (penalty:100) Constraints 2: At most one of the three links – AD, CD, and AB – can be included. (Penalty of 100 if selected two of the three, 200 if all three are selected.) * Hillier, F.S. and Lieberman, G.J., “Introduction to Operations Research.” New York, NY: McGraw-Hill. 8th Ed., 2005

58 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 57 Add 25 Example * A tabu move will be considered only if it would result in a better solution than the best trial solution found previously (Aspiration Condition) Iteration 4 new cost = 70 Override tabu status A B D CE 2030 1540 10 5 Tabu Delete Tabu list: DE & BE Iteration 3 Cost=85 AddDeleteCost AB BE* CE AC Tabu move 100+0=100 95+0=95 AD DE* CE AC 60+100=160 95+0=95 90+0=90 CD DE* CE 70+0=70 105+0=105 Constraints 1: Link AD can be included only if link DE also is included. (penalty:100) Constraints 2: At most one of the three links – AD, CD, and AB – can be included. (Penalty of 100 if selected two of the three, 200 if all three are selected.) * Hillier, F.S. and Lieberman, G.J., “Introduction to Operations Research.” New York, NY: McGraw-Hill. 8th Ed., 2005

59 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 58 Example Optimal Solution Cost = 70 Additional iterations only find inferior solutions A B D CE 2030 1540 10 5 25 * Hillier, F.S. and Lieberman, G.J., “Introduction to Operations Research.” New York, NY: McGraw-Hill. 8th Ed., 2005

60 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 59 Pros and Cons Pros: –Allows non-improving solution to be accepted in order to escape from a local optimum –The use of Tabu list –Can be applied to both discrete and continuous solution spaces –For larger and more difficult problems (scheduling, quadratic assignment and vehicle routing), tabu search obtains solutions that rival and often surpass the best solutions previously found by other approaches [1]. Cons: –Too many parameters to be determined –Number of iterations could be very large –Global optimum may not be found, depends on parameter settings

61 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 60 Advanced Topics Intensification: penalize solutions far from the current solution Diversification: penalize solutions close to the current solution

62 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 61 Some Convergence Results Memory Tabu Search converges to the global optimum with probability one if randomly generated vectors (x) follows Gaussian or uniform distribution [6]. Convergent Tabu Search converges to the global optimum with probability one [3].


Download ppt "SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 1 Hardware/Software Codesign of Embedded Systems OPTIMIZATION II Voicu Groza SITE Hall, Room."

Similar presentations


Ads by Google