Download presentation
Presentation is loading. Please wait.
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 π ,π ,π ,π ,π ,π ,π , π π + π + π + π = ππ
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.