SlideShare a Scribd company logo
1 of 32
PROJECT MANAGEMENT
      THROUGH
 GENETIC ALGORITHM
   PROJECT GUIDE:-


             ARINDAM SINHA RAY




   SUBMITTED BY:-
                      AVAY MINNI
                      DEBADITYA SARKAR
                      RASHMI SAHA
                      RAJESH KUMAR MAHTO
CONTENTS
   INTRODUCTION
     GENETIC ALGORITHM
     RESOURCE CONSTRAINTS
     WHY GENETIC ALGORITHM?

 CASE STUDY
 ALGORITHM

 OUTPUT

 CONCLUSION & FUTURE WORK

 REFERENCE
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).
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.
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
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.
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.
---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.
Ai   A0   A1   A2   A3   A4   A5   A6       A7   A8       A9

pi   0    6    1    1    2    3    5        3    2        0
bi   0    2    1    3    2    1    2        3    1        0
Si   0    1    1    1    7    2    2        8    5        0




          A1             A4            A7



A0        A2             A5                          A9




          A3             A6             A8
Mathematical Deduction:-




Min Z = 12A1+A2+3A3+4A4+3A5+10A6+9A7+3A8
Subject to,
3A3+A2 <= 5
A5+2A6+2A1 <= 5
2A6+2A1 <= 5
A8+2A4 <= 5
3A7 <= 5
FUNCTIONS USED FROM MATLAB LIBRARY
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.
 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
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.
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.
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
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.
 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
 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
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
 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.
 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
   Delete the duplicate columns of vert matrix by
    calling delcols function.
OUTPUT
OUTPUT
OUTPUT
OUTPUT
OUTPUT
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.
REFERENCES

   Introduction to Genetic Algorithm by
    S.N.Shivanandam & S.N.Deepa.
Project management

More Related Content

What's hot

Sienna 8 countingsorts
Sienna 8 countingsortsSienna 8 countingsorts
Sienna 8 countingsorts
chidabdu
 
PartOne
PartOnePartOne
PartOne
?? ?
 
Lesson 8: Determinants III
Lesson 8: Determinants IIILesson 8: Determinants III
Lesson 8: Determinants III
Matthew Leingang
 
Project time series ppt
Project time series pptProject time series ppt
Project time series ppt
amar patil
 

What's hot (20)

Arima model (time series)
Arima model (time series)Arima model (time series)
Arima model (time series)
 
Efficient Solution of Two-Stage Stochastic Linear Programs Using Interior Poi...
Efficient Solution of Two-Stage Stochastic Linear Programs Using Interior Poi...Efficient Solution of Two-Stage Stochastic Linear Programs Using Interior Poi...
Efficient Solution of Two-Stage Stochastic Linear Programs Using Interior Poi...
 
PROJECT
PROJECTPROJECT
PROJECT
 
Lesson 1 functions as models
Lesson 1 functions as modelsLesson 1 functions as models
Lesson 1 functions as models
 
ARIMA
ARIMA ARIMA
ARIMA
 
Sienna 8 countingsorts
Sienna 8 countingsortsSienna 8 countingsorts
Sienna 8 countingsorts
 
Time series modelling arima-arch
Time series modelling  arima-archTime series modelling  arima-arch
Time series modelling arima-arch
 
About functional SIR
About functional SIRAbout functional SIR
About functional SIR
 
Presentation
PresentationPresentation
Presentation
 
Holt alg1 ch5 1 identify linear functions
Holt alg1 ch5 1 identify linear functionsHolt alg1 ch5 1 identify linear functions
Holt alg1 ch5 1 identify linear functions
 
General Mathematics - Representation and Types of Functions
General Mathematics - Representation and Types of FunctionsGeneral Mathematics - Representation and Types of Functions
General Mathematics - Representation and Types of Functions
 
Seasonal ARIMA
Seasonal ARIMASeasonal ARIMA
Seasonal ARIMA
 
ARIMA Models - [Lab 3]
ARIMA Models - [Lab 3]ARIMA Models - [Lab 3]
ARIMA Models - [Lab 3]
 
Regression_1.pdf
Regression_1.pdfRegression_1.pdf
Regression_1.pdf
 
PartOne
PartOnePartOne
PartOne
 
AP Calculus Slides December 14, 2007
AP Calculus Slides December 14, 2007AP Calculus Slides December 14, 2007
AP Calculus Slides December 14, 2007
 
Lesson 8: Determinants III
Lesson 8: Determinants IIILesson 8: Determinants III
Lesson 8: Determinants III
 
Project time series ppt
Project time series pptProject time series ppt
Project time series ppt
 
What is ARIMA Forecasting and How Can it Be Used for Enterprise Analysis?
What is ARIMA Forecasting and How Can it Be Used for Enterprise Analysis?What is ARIMA Forecasting and How Can it Be Used for Enterprise Analysis?
What is ARIMA Forecasting and How Can it Be Used for Enterprise Analysis?
 
AP Calculus Jauary 13, 2009
AP Calculus Jauary 13, 2009AP Calculus Jauary 13, 2009
AP Calculus Jauary 13, 2009
 

Viewers also liked

Viewers also liked (6)

HAMS - Product and Prototype
HAMS - Product and PrototypeHAMS - Product and Prototype
HAMS - Product and Prototype
 
A Semantic Web Platform for Automating the Interpretation of Finite Element ...
A Semantic Web Platform for Automating the Interpretation of Finite Element ...A Semantic Web Platform for Automating the Interpretation of Finite Element ...
A Semantic Web Platform for Automating the Interpretation of Finite Element ...
 
REAL TIME PROJECTS IEEE BASED PROJECTS EMBEDDED SYSTEMS PAPER PUBLICATIONS M...
REAL TIME PROJECTS  IEEE BASED PROJECTS EMBEDDED SYSTEMS PAPER PUBLICATIONS M...REAL TIME PROJECTS  IEEE BASED PROJECTS EMBEDDED SYSTEMS PAPER PUBLICATIONS M...
REAL TIME PROJECTS IEEE BASED PROJECTS EMBEDDED SYSTEMS PAPER PUBLICATIONS M...
 
Vba Class Level 3
Vba Class Level 3Vba Class Level 3
Vba Class Level 3
 
Vba Class Level 1
Vba Class Level 1Vba Class Level 1
Vba Class Level 1
 
Real-Time Scheduling Algorithms
Real-Time Scheduling AlgorithmsReal-Time Scheduling Algorithms
Real-Time Scheduling Algorithms
 

Similar to Project management

CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docxCSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
mydrynan
 
matrix-algebra-for-engineers (1).pdf
matrix-algebra-for-engineers (1).pdfmatrix-algebra-for-engineers (1).pdf
matrix-algebra-for-engineers (1).pdf
ShafaqMehmood2
 

Similar to Project management (20)

Investigación de operaciones 026 programación lineal Solución Simplex con R S...
Investigación de operaciones 026 programación lineal Solución Simplex con R S...Investigación de operaciones 026 programación lineal Solución Simplex con R S...
Investigación de operaciones 026 programación lineal Solución Simplex con R S...
 
A Comparative Analysis Of Assignment Problem
A Comparative Analysis Of Assignment ProblemA Comparative Analysis Of Assignment Problem
A Comparative Analysis Of Assignment Problem
 
A0280115(1)
A0280115(1)A0280115(1)
A0280115(1)
 
Environmental Engineering Assignment Help
Environmental Engineering Assignment HelpEnvironmental Engineering Assignment Help
Environmental Engineering Assignment Help
 
Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4
 
Basic concepts in_matlab
Basic concepts in_matlabBasic concepts in_matlab
Basic concepts in_matlab
 
Ada notes
Ada notesAda notes
Ada notes
 
Solving ONE’S interval linear assignment problem
Solving ONE’S interval linear assignment problemSolving ONE’S interval linear assignment problem
Solving ONE’S interval linear assignment problem
 
Gauss Elimination Method With Partial Pivoting
Gauss Elimination Method With Partial PivotingGauss Elimination Method With Partial Pivoting
Gauss Elimination Method With Partial Pivoting
 
Setting linear algebra problems
Setting linear algebra problemsSetting linear algebra problems
Setting linear algebra problems
 
NEW APPROACH FOR SOLVING FUZZY TRIANGULAR ASSIGNMENT BY ROW MINIMA METHOD
NEW APPROACH FOR SOLVING FUZZY TRIANGULAR ASSIGNMENT BY ROW MINIMA METHODNEW APPROACH FOR SOLVING FUZZY TRIANGULAR ASSIGNMENT BY ROW MINIMA METHOD
NEW APPROACH FOR SOLVING FUZZY TRIANGULAR ASSIGNMENT BY ROW MINIMA METHOD
 
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docxCSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
 
Dynamic programming1
Dynamic programming1Dynamic programming1
Dynamic programming1
 
4 R Tutorial DPLYR Apply Function
4 R Tutorial DPLYR Apply Function4 R Tutorial DPLYR Apply Function
4 R Tutorial DPLYR Apply Function
 
Intro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithmIntro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithm
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
Computer Science Exam Help
Computer Science Exam Help Computer Science Exam Help
Computer Science Exam Help
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
 
Matrix Multiplication(An example of concurrent programming)
Matrix Multiplication(An example of concurrent programming)Matrix Multiplication(An example of concurrent programming)
Matrix Multiplication(An example of concurrent programming)
 
matrix-algebra-for-engineers (1).pdf
matrix-algebra-for-engineers (1).pdfmatrix-algebra-for-engineers (1).pdf
matrix-algebra-for-engineers (1).pdf
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 

Project management

  • 1. PROJECT MANAGEMENT THROUGH GENETIC ALGORITHM
  • 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.
  • 10. Ai A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 pi 0 6 1 1 2 3 5 3 2 0 bi 0 2 1 3 2 1 2 3 1 0 Si 0 1 1 1 7 2 2 8 5 0 A1 A4 A7 A0 A2 A5 A9 A3 A6 A8
  • 11. Mathematical Deduction:- Min Z = 12A1+A2+3A3+4A4+3A5+10A6+9A7+3A8 Subject to, 3A3+A2 <= 5 A5+2A6+2A1 <= 5 2A6+2A1 <= 5 A8+2A4 <= 5 3A7 <= 5
  • 12. FUNCTIONS USED FROM MATLAB LIBRARY
  • 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.