2. PROJECT GUIDE:-
ARINDAM SINHA RAY
SUBMITTED BY:-
AVAY MINNI
DEBADITYA SARKAR
RASHMI SAHA
RAJESH KUMAR MAHTO
3. CONTENTS
INTRODUCTION
GENETIC ALGORITHM
RESOURCE CONSTRAINTS
WHY GENETIC ALGORITHM?
CASE STUDY
ALGORITHM
OUTPUT
CONCLUSION & FUTURE WORK
REFERENCE
4. INTRODUCTION
A genetic algorithm (or GA) is a search technique
used in computing to find true or approximate
solutions to optimization and search problems.
Genetic algorithms are categorized as global
search heuristics.
Genetic algorithms are a particular class of
evolutionary algorithms that use techniques
inspired by evolutionary biology such as
inheritance, mutation, selection, and crossover
(also called recombination).
5. The basic genetic algorithm is as follows:
• [start] Genetic random population of n chromosomes (suitable
solutions for the problem)
• [Fitness] Evaluate the fitness f(x) of each chromosome x in the
population
• New population] Create a new population by repeating following steps
until the New population is complete
- [selection] select two parent chromosomes from a population
according to
their fitness ( the better fitness, the bigger chance to get selected).
- [crossover] With a crossover probability, cross over the parents to
form new offspring ( children). If no crossover was
performed, offspring is the exact copy of parents.
- [Mutation] With a mutation probability, mutate new offspring at each
locus (position in chromosome)
- [Accepting] Place new offspring in the new population.
• [Replace] Use new generated population for a further sum of the
algorithm.
• [Test] If the end condition is satisfied, stop, and return the best solution
in current population.
• [Loop] Go to step2 for fitness evaluation.
6. RESOURCE CONSTRAINTS
A resource constraint is a limit on what can be done because of
limitations on what is available to do it.
Resource abundance = shorter project duration and vice versa.
First identify peaks of resource requirements.
In practical, resources are finite . So , impractical for peak
resource needs.
Ideally there should be even demand of resource for entire
project.
This process of refining the plan to effectively manage and
schedule resources is called resource modeling .
-Resource Definition - Resource Allocation
-Resource Aggregation -Resource Leveling
7. WHY TO USE GENETIC ALGORITHM
Liability
Easy to discover global optimum.
GA uses fitness function for evolution rather than
derivatives.
Almost all conventional optimization technique
search from a single point but GAs always operate
on a whole population of points(strings).
Easily modified for different problems.
They perform very well for large scale optimization
problems.
Can be employed for a wide variety of optimization
problems.
8. THE RESOURCE-CONSTRAINED PROJECT
SCHEDULING PROBLEM:-
The RCPSP is one of the most complex scheduling problems. It
is considered as a generalization of many standard scheduling
problems.
A RCPSP considers resources of limited availability and activities
of known durations and resources request. The problem consists
of finding a schedule of minimal duration by assigning a start time
to each activity such that precedence relation and the resource
availabilities are respected.
The RCPSP can be defined as a combinational optimization
problem aims at finding a feasible solution by the help of a tuple
(V,p,E,R,B,b).
---- Activities consisting the project are identified by set
V={A0,….,An+1}. The set of non-dummy activities is identified by
Ai={A1,…...An}.
Durations are represented by vector p.
Precedence relation are given by E, such that Ai precedes
activity Aj.
9. ---Availabilities of resources are represented by a vector B.
such that Bk denotes the availability of Rk.
R is called unary or disjunctive resource.
Demands of activities for resources are abstracted by b.
A schedule is a point S such that Si represents the strat time
of activity of Ai.
A solution S is feasible if it is compatible with the precedence
constraints and resource constraints. Expressed as below
---- Sj-Si >= pi , for all (Ai,Aj) belongs to E (I)
Sum of bik <= Bk , for all Rk belongs to R and t >= 0. (II)
The SCPSP is the problem of finding a non-preemptive
schedule S to precedence constraints (I) and resources
constraints (II).
Problem:
A RCPSP instance is given with n=8 real activities and |R|=1
resources with availabilities B = 5.
13. FIVE AUXILIARY FUNCTIONS USED:-
function e=vr(m,i)
%The i-th co-ordinate vector e in the Euclidean Space
Create a matrix e of (m*1) where all the elements are Zero.
Fill the i-th position of matrix e, with 1.
function d=delcols(d)
%here delete the duplicate column of the matrix d.
Delete the repeated rows from the matrix d and return the
sorted one.
Store the no. of columns of matrix d in n.
14. Create an empty Matrix j.
for k=1 to n
Assign column wise elements of Matrix d into c.
for l=k+1 to n
if(Maximum value from column subtraction for(lth-cth)column
<= 100*eps)
copy the lth column into j matrix.
end if
end for
end for
if j is not empty
Sort each column of j matrix in ascending order.
Delete all the columns except 1st one of matrix d.
end if
15. function [row,mi]=MRT(a,b)
%The Minimum Ratio Test(MRT) performed on vector a & b.
%Output Parameters are:-
%row=index of the pivot row.
%mi=value of the smallest ratio.
Store the length of the vector a into m.
Create a Matrix C with elements 1 to m.
Combine all the column into one column of Matrix a.
Combine all the column into one column of Matrix b.
If b>0,then assign the value of c into l.
Array right division of lth column of a & b.
Now, find the minimum from the Quotient matrix.
Store the min. value in mi & the index no. in row matrix.
Store the value of row-th index of l matrix into row.
16. function col=MRTD(a,b)
%The Maximum Ratio Test performed on vectors a and b.
%This function is called form within the function dsimplex.
%Output Parameter-:-
%col-index of the pivot column.
Store the length of vector a into m.
Create a Matrix C with elements 1 to m.
Combine all columns into one column of matrix a.
Combine all columns into one column of matrix b.
If b<0,then assign the value of c into l.
Array right division of l-th column of a & b.
Now find the Max from quotient matrix.
Store the max value in mi and index no. in column.
Store the value of col-th index of l-th matrix into col.
17. function[m,j]=Br(d)
%Implementation of the Bland's rule applied to the array d.
%This function is called from the following functions:-
%Simplex2p,dsimplex,addconstr,simplex and cpa.
%Output parameters:-
%m=first negative no. in the array D.
%j=index of entry m.
Find any less than zero elements in d and shows their index in
vector matrix.
if ind is not empty
Store the index no. of first negative no. in j.
Store the first negative no. of matrix d in m.
else
create an empty matrix m.
create an empty matrix j.
end else-if
18. function vert=feassol(A,B)
%Basic feasible solution vert to the System of
constraints
%Ax=b, x>=0
%They are stored in column of matrix vert.
Store the value of row and column of matrix A into
m & n respectively.
Stop the warning by Matlab.
Combine all the columns of b in one column.
Declare an empty matrix vert.
if (n>=m)//here column>=row
Create a matrix t with all possible combination from
the range 1 to n taking m columns at a time.
19. nv=n!/(n-m)!m!
for i=1 to nv
a)Create zero matrix of row n and column 1.
b)(i)Choose the number from t-th column and
i-th row of matrix A.
(ii)Divide the chosen element b & store the
quotient into x.
if all(n>=0 &(n !=inf & n !=-inf))
a)Assign n to the i-th row of t.
b)copy the y matrix into vert matrix.
end if
end for
else
show error message.
end else if
20. if vert is not empty
Delete the duplicate columns of vert matrix by
calling delcols function
else
create an empty matrix vert.
end else if
21. Function vert = extrpts(A,rel,b)
%extreme points vert of the polyhedral set
%x=(x:Ax<=b or Ax>=b, x>=0)
%Inequality signs are =stored in the string rel e.g.
rel=‘<<>’ stands for <=,<= & >= respectively.
o Store the value of row & column of matrix A into m& n
respectively.
o Store the value of n in nlv
o For i=1 to m
o if rel =‘>’
o assign -1 to the i-th position of m*I mtrix by
calling vr function.
o copy the above matrix into A.
o Else
o assign 1 to the ith position of m*I matrix by calling
vr function.
o End else if
22. if b(i)<0
assign negative to all the ith row elements of A.
assign negative to i-th position of b.
end if
end for
Stop the warning by Matlab.
Combine all the columns of b in one column.
Declare an empty matrix vert.
if (n>=m)//here column>=row
Create a matrix t with all possible c combination
from the range 1 to n taking m columns at a time.
23. nv=n!/(n-m)!m!
for i=1 to nv
a)Create zero matrix of row n and column 1.
b)(i)Choose the number from t-th column and
i-th row of matrix A.
(ii)Divide the chosen element b & store the
quotient into x.
if all(n>=0 &(n !=inf & n !=-inf))
a)Assign n to the i-th row of t.
b)copy the y matrix into vert matrix.
end if
end for
else
show error message
end else if
24. Delete the duplicate columns of vert matrix by
calling delcols function.
30. CONCLUSION & FUTURE WORK
We have taken a resource constraint problem and
deduce it mathematically and formulate into linear
programming problem(LPP).
We have found the basic feasible solutions and
extreme point from the LPP .
Now we will assign fitness function to the feasible
solution and by using
SELECTION, REPRODUCTION, EVALUATION
and REPLACEMENT we have to create offspring.
And from the offspring population by using best fit
,we will reach the optimal solution.
31. REFERENCES
Introduction to Genetic Algorithm by
S.N.Shivanandam & S.N.Deepa.