Presentation is loading. Please wait.

Presentation is loading. Please wait.

Add Heuristic a b C D E Switch Cost

Similar presentations


Presentation on theme: "Add Heuristic a b C D E Switch Cost"β€” Presentation transcript:

1 Add Heuristic a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost
𝜹 π’Š, 𝒋 = 𝟏 π’Šπ’‡ 𝒖𝒔𝒆𝒓 π’Š 𝒄𝒐𝒏𝒏𝒆𝒄𝒕𝒆𝒅 𝒕𝒐 π’”π’˜π’Šπ’•π’„π’‰ 𝒋 𝟎 π‘Άπ’•π’‰π’†π’“π’˜π’Šπ’”π’† 𝜢 𝒋 = 𝟏 π’Šπ’‡ π’”π’˜π’Šπ’•π’„π’‰ 𝒋 π’Šπ’” π’Šπ’π’”π’•π’‚π’π’π’†π’… 𝟎 𝑢𝑾 ∁ 𝒋 =𝒄𝒐𝒔𝒕 𝒐𝒇 π’Šπ’π’”π’•π’‚π’π’π’Šπ’π’ˆ π’”π’˜π’Šπ’•π’„π’‰ 𝒋 𝜷 π’Š, 𝒋 = cost of connecting user I to switch j 𝑲 𝒋 = maximum number of users connected switch j (13 in this case for all switches) π‘΄π’Šπ’ π’Š 𝒋 𝜷 π’Š, 𝒋 𝜹 π’Š, 𝒋 + 𝒋 ∁ 𝒋 𝜢 𝒋 𝒔𝒕 π’Š 𝜹 π’Š, 𝒋 ≀ 𝑲 𝒋 𝜢 𝒋 𝒋 𝜹 π’Š, 𝒋 =𝟏 βˆ€π’Š

2 1st Iteration S = {a} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total Cost = Cost of installing switch a + cost of connecting all users to switch a = 51

3 2nd Iteration S = {a, b} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total Cost = 51 – 2 – 2 – 6 – 4 – = 41 < 51

4 2nd Iteration S = {a, c} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total cost = 51 – 1 – 5 – 1 – 1 – 6 – = 40 < 51

5 2nd Iteration S = {a, d} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total cost = 51 – 3 – 3 – 1 – 5 – 2 – 1 – = 37< 51

6 2nd Iteration S = {a, e} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total cost = 51 – 4 – 5 – 2 – 1 – 7 – = 29 < 51 Cost of {a, b} = 41 Cost of {a, c} = 40 Cost of {a, d} = 37 Cost of {a, e} = 29 (highest reduction)

7 3rd Iteration S = {a, e, b} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total cost = 29 – 1 – = 34> 29 (Rejected)

8 3rd Iteration S = {a, e, c} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total cost = 29 – 1 – = 31 > 29 (Rejected)

9 3rd Iteration S = {a, e, d} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total cost = 29 – = 28 < 29 (Accepted)

10 4th Iteration S = {a, e, d, b} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total cost = 28 – = 35 > 28 (Rejected)

11 4th Iteration S = {a, e, d, c} a b C D E 1 5 3 7 2 9 4 6 8 10 11 12 13 Switch Cost Total cost = 28 – = 33 > 28 (Rejected) The best solution is installing switches a, e and d

12 Genetics Algorithm

13 Genetics Algorithm Consider the following channel allocation problem shown in the figure on the right. The objective of the problem is to allocate 4 channels to 2 users. Each user on the left hand side can transmit on any of the channels indicated on the right hand side. If a user π’Š uses channel 𝒋 he/she will be able to transmit at a rate equal to 𝒄 π’Š, 𝒋 . The values of 𝒄 π’Š, 𝒋 are shown on the arrows connecting each user to the channel. It is required to allocate channels to users such as to maximize the total data rate while satisfying the following conditions: Each user can be allocated a maximum of three channels and minimum of 1 channel Each channel can be allocated to a maximum of one user. Write the objective function and the constrains Generate a population of 2 solutions and apply genetic algorithm

14 Genetics Algorithm 𝜹 π’Š, 𝒋 = 𝟏 π’Šπ’‡ 𝒖𝒔𝒆𝒓 π’Š 𝒄𝒐𝒏𝒏𝒆𝒄𝒕𝒆𝒅 𝒕𝒐 𝒄𝒉𝒂𝒏𝒏𝒆𝒍 𝒋 𝟎 π‘Άπ’•π’‰π’†π’“π’˜π’Šπ’”π’† 𝑴𝒂𝒙 π’Š 𝒋 𝒄 π’Š, 𝒋 𝜹 π’Š, 𝒋 𝒔𝒕 π’Š=𝟏 π’Š=𝟐 𝜹 π’Š, 𝒋 β‰€πŸ βˆ€π’‹βˆˆ 𝟏, …, πŸ’ πŸβ‰€ 𝒋=𝟏 𝒋=πŸ’ 𝜹 π’Š, 𝒋 β‰€πŸ‘ βˆ€π’Šβˆˆ 𝟏, 𝟐

15 Genetics Algorithm (Generating random valid solutions)
𝜹 𝟏, 𝟏 , 𝜹 𝟏, 𝟐 , 𝜹 𝟏, πŸ‘ , 𝜹 𝟏, πŸ’ , 𝜹 𝟐, 𝟏 , 𝜹 𝟐, 𝟐 , 𝜹 𝟐, πŸ‘ , 𝜹 𝟐, πŸ’ π’Š 𝒋 𝒄 π’Š, 𝒋 𝜹 π’Š, 𝒋 Sol 1 𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ• +πŸ‘ +πŸ‘ =πŸπŸ‘ Sol 2 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ” + πŸ‘ =πŸ— 𝜹 π’Š, 𝒋 = 𝟏 π’Šπ’‡ 𝒖𝒔𝒆𝒓 π’Š 𝒄𝒐𝒏𝒏𝒆𝒄𝒕𝒆𝒅 𝒕𝒐 𝒄𝒉𝒂𝒏𝒏𝒆𝒍 𝒋 𝟎 π‘Άπ’•π’‰π’†π’“π’˜π’Šπ’”π’† 𝑴𝒂𝒙 π’Š 𝒋 𝒄 π’Š, 𝒋 𝜹 π’Š, 𝒋 𝒔𝒕 π’Š=𝟏 π’Š=𝟐 𝜹 π’Š, 𝒋 β‰€πŸ βˆ€π’‹βˆˆ 𝟏, …, πŸ’ πŸβ‰€ 𝒋=𝟏 𝒋=πŸ’ 𝜹 π’Š, 𝒋 β‰€πŸ‘ βˆ€π’Šβˆˆ 𝟏, 𝟐

16 Genetics Algorithm (Crossover)
𝜹 𝟏, 𝟏 , 𝜹 𝟏, 𝟐 , 𝜹 𝟏, πŸ‘ , 𝜹 𝟏, πŸ’ , 𝜹 𝟐, 𝟏 , 𝜹 𝟐, 𝟐 , 𝜹 𝟐, πŸ‘ , 𝜹 𝟐, πŸ’ π’Š 𝒋 𝒄 π’Š, 𝒋 𝜹 π’Š, 𝒋 Sol 1 𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ• +πŸ‘ +πŸ‘ =πŸπŸ‘ Sol 2 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ” + πŸ‘ =πŸ— Sol 3 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟏 ,𝟎, 𝟏 πŸ” + πŸ‘ + πŸ‘ =𝟏𝟐 Sol 4 𝟏 , 𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ• + πŸ‘ = 𝟏𝟎

17 Genetics Algorithm (Another Crossover Example)
𝜹 𝟏, 𝟏 , 𝜹 𝟏, 𝟐 , 𝜹 𝟏, πŸ‘ , 𝜹 𝟏, πŸ’ , 𝜹 𝟐, 𝟏 , 𝜹 𝟐, 𝟐 , 𝜹 𝟐, πŸ‘ , 𝜹 𝟐, πŸ’ π’Š 𝒋 𝒄 π’Š, 𝒋 𝜹 π’Š, 𝒋 Sol 1 𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ• +πŸ‘ +πŸ‘ =πŸπŸ‘ Sol 2 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ” + πŸ‘ =πŸ— Sol 3 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟏 ,𝟎, 𝟏 πŸ” + πŸ‘ + πŸ‘ =𝟏𝟐 Sol 4 𝟏 , 𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ• + πŸ‘ = 𝟏𝟎 Sol 5 Sol 6 𝟎 ,𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ” + πŸ‘ + πŸ‘ = 𝟏𝟐

18 Genetics Algorithm (Another Crossover Example)
𝜹 𝟏, 𝟏 , 𝜹 𝟏, 𝟐 , 𝜹 𝟏, πŸ‘ , 𝜹 𝟏, πŸ’ , 𝜹 𝟐, 𝟏 , 𝜹 𝟐, 𝟐 , 𝜹 𝟐, πŸ‘ , 𝜹 𝟐, πŸ’ π’Š 𝒋 𝒄 π’Š, 𝒋 𝜹 π’Š, 𝒋 Sol 1 𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ• +πŸ‘ +πŸ‘ =πŸπŸ‘ Sol 2 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ” + πŸ‘ =πŸ— Sol 3 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟏 ,𝟎, 𝟏 πŸ” + πŸ‘ + πŸ‘ =𝟏𝟐 Sol 4 𝟏 , 𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ• + πŸ‘ = 𝟏𝟎 Sol 5 Sol 6 𝟎 ,𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ” + πŸ‘ + πŸ‘ = 𝟏𝟐 Sol 7 𝟏 , 𝟎 , 𝟎,𝟏 ,𝟎 ,𝟎 ,𝟎, 𝟏 invalid as 4 channel is allocated to more than one user (users 1 and 2) so, this solution is not valid and discarded Sol 8 𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 invalid as there is no channel allocated to user 1 so, this solution is not valid and discarded

19 Genetics Algorithm (mutation example)
𝜹 𝟏, 𝟏 , 𝜹 𝟏, 𝟐 , 𝜹 𝟏, πŸ‘ , 𝜹 𝟏, πŸ’ , 𝜹 𝟐, 𝟏 , 𝜹 𝟐, 𝟐 , 𝜹 𝟐, πŸ‘ , 𝜹 𝟐, πŸ’ π’Š 𝒋 𝒄 π’Š, 𝒋 𝜹 π’Š, 𝒋 Sol 1 𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ• +πŸ‘ +πŸ‘ =πŸπŸ‘ Sol 2 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ” + πŸ‘ =πŸ— Sol 3 𝟎 , 𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟏 ,𝟎, 𝟏 πŸ” + πŸ‘ + πŸ‘ =𝟏𝟐 Sol 4 𝟏 , 𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ• + πŸ‘ = 𝟏𝟎 Sol 5 Sol 6 𝟎 ,𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ” + πŸ‘ + πŸ‘ = 𝟏𝟐 Sol 7 𝟏 , 𝟎 , 𝟎,𝟏 ,𝟎 ,𝟎 ,𝟎, 𝟏 invalid as 4 channel is allocated to more than one user (users 1 and 2) so, this solution is not valid and discarded Sol 8 𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 invalid as there is no channel allocated to user 1 so, this solution is not valid and discarded Sol 9 𝟏 , 𝟏 ,𝟎 ,𝟎 ,𝟎 ,𝟎 ,𝟎, 𝟏 πŸ•+ πŸ“ + πŸ‘ = πŸπŸ“ Sol 10 𝟏 ,𝟎 ,𝟏 ,𝟎 ,𝟎 ,𝟏 ,𝟎 , 𝟏 πŸ• + πŸ” + πŸ‘ + πŸ‘ = πŸπŸ—


Download ppt "Add Heuristic a b C D E Switch Cost"

Similar presentations


Ads by Google