CN110991917A - Multi-mode resource-limited project scheduling optimization method adopting two-stage genetic algorithm - Google Patents

Multi-mode resource-limited project scheduling optimization method adopting two-stage genetic algorithm Download PDF

Info

Publication number
CN110991917A
CN110991917A CN201911259880.3A CN201911259880A CN110991917A CN 110991917 A CN110991917 A CN 110991917A CN 201911259880 A CN201911259880 A CN 201911259880A CN 110991917 A CN110991917 A CN 110991917A
Authority
CN
China
Prior art keywords
task
individual
list
scheduling
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911259880.3A
Other languages
Chinese (zh)
Other versions
CN110991917B (en
Inventor
单晓杭
王嘉梁
李研彪
张利
叶必卿
谢毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN201911259880.3A priority Critical patent/CN110991917B/en
Publication of CN110991917A publication Critical patent/CN110991917A/en
Application granted granted Critical
Publication of CN110991917B publication Critical patent/CN110991917B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06312Adjustment or analysis of established resource schedule, e.g. resource or task levelling, or dynamic rescheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E40/00Technologies for an efficient electrical power generation, transmission or distribution
    • Y02E40/70Smart grids as climate change mitigation technology in the energy generation sector
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Strategic Management (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Marketing (AREA)
  • Biomedical Technology (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Educational Administration (AREA)
  • Development Economics (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • Artificial Intelligence (AREA)
  • General Business, Economics & Management (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • General Factory Administration (AREA)

Abstract

The invention discloses a multi-mode resource-limited project scheduling optimization method adopting a two-stage genetic algorithm, which comprises the following steps of: acquiring information required by scheduling; judging whether a feasible scheme exists; carrying out pretreatment; calculating a level value of the task; initializing a contemporary population; evolution is carried out in two stages: stage 1 adopts a hierarchical-based scheduling sequence cross variation operation and adopts an individual execution mode list generated based on the earliest task completion time and calculates the fitness value of the individual execution mode list, so that the algorithm is quickly converged near the optimal solution, stage 2 adopts the execution mode and scheduling sequence list cross variation operation and uses an FBI & D method to improve the population and calculate the fitness value, and the neighborhood expansion search is carried out to find the optimal solution; outputting a scheduling optimization result; compared with a single-stage search strategy, the method has higher search efficiency and optimizing capability.

Description

Multi-mode resource-limited project scheduling optimization method adopting two-stage genetic algorithm
Technical Field
The invention relates to the fields of computer technology, information technology and system engineering, in particular to a multi-mode resource-limited project scheduling optimization method, and more particularly relates to a multi-mode resource-limited project scheduling optimization method adopting a two-stage genetic algorithm.
Background
The Resource-Constrained Project scheduling problem RCPSP (Resource-Constrained Project scheduling Project) refers to how to scientifically and reasonably allocate resources and arrange the execution sequence of tasks to determine the start and completion time thereof under the constraint of satisfying the Resource and task timing relationship, so as to achieve the given objectives, such as: optimization of construction period, cost, etc. With the adoption of project-oriented organizational structures and management modes by more and more modern enterprises, the RCPSP has a strong engineering background and is widely applied to enterprises in single-piece or small-batch production modes such as construction engineering, software development, airplane and ship manufacturing and the like. The RCPSP can be further divided into a single-mode resource-limited project scheduling problem SRCPSP and a multi-mode resource-limited project scheduling problem MRCPSP, wherein each task in the SRCPSP only has one execution mode, the resource is renewable resource, and the construction period and the resource demand of the task are determined; the tasks in the MRCPSP have a plurality of execution modes, resources comprise renewable resources and non-renewable resources, and the construction period and the resource demand amount corresponding to each execution mode of the tasks are different. SRCPSP can therefore be considered a special case of MRCPSP, which is a more complex problem than SRCPSP, but is more of a practical significance.
The method for solving the RCPSP at the present stage mainly comprises the following steps: 1) the precise algorithm, such as: 0-1 integer programming and branch-and-bound; 2) heuristic algorithms, such as: heuristic algorithm, separation arc method and local search calculation based on priority rule; 3) intelligent algorithms, such as: genetic algorithm, particle swarm optimization algorithm, ant colony algorithm and the like. Although the accurate algorithm can obtain the optimal solution in theory, the calculation time is generally unacceptable and is generally only suitable for small-scale problems, the heuristic algorithm can quickly obtain the solution of the problem based on a certain heuristic rule but generally cannot ensure the quality of the solution, the intelligent algorithm is based on the calculation intelligence, the near-optimal solution or the satisfactory solution is found in reasonable time by adopting an improved heuristic rule and a search mode, and the efficiency generally depends on the design of the algorithm and the type of the problem.
Disclosure of Invention
In order to overcome the defects that the existing precise algorithm is long in calculation time and cannot be suitable for large-scale problems, and the heuristic algorithm, the search space imperfection combined with the heuristic semi-intelligent algorithm, the intelligent algorithm efficiency depend on the design of the algorithm and the type of the problems and the like, the invention provides a multi-mode resource-limited project scheduling optimization method adopting a two-stage genetic algorithm, so that the solving time of the resource-limited project scheduling problem is effectively reduced, and the solving quality is improved.
The technical scheme adopted by the invention for solving the technical problems is as follows: a multi-mode resource-limited project scheduling optimization method adopting a two-stage genetic algorithm comprises the following steps:
step 1: formalizing a multi-mode resource limited project scheduling problem and acquiring information required by scheduling optimization;
acquiring a project task set T ═ T0,t1,...,tJ,tJ+1}; wherein t isjIndicating task j, i.e. task numbered j, t0And tJ+1The method is a virtual task which is artificially increased, namely, the project construction period and the resource are not occupied, and J is the actual task quantity to be scheduled;
obtaining the time sequence relation between tasks, namely a parent task set PR of the task jjAnd a set of subtasks SCjTask j at its parent task j-∈PRjCannot be started until all the completion, J is 0,1, …, J +1, t0Without a parent task, i.e.
Figure BDA0002311326640000021
tJ+1Without subtasks, i.e.
Figure BDA0002311326640000022
Obtaining the usable quantity R of renewable resources k at any timekK is 1, …, K is the renewable resource type number; acquiring non-updatable resource l in whole project construction periodUsable amount of N inlL ═ 1, …, L is the number of non-updateable resource types;
acquiring the time needed by the task j to execute in the mode m, namely the construction period dj,mAnd the number r of occupied renewable resources kj,m,kThe number n of non-updatable resources lj,m,l;j=1,…,J,m=1,…,MjK1, …, K, L1, …, L, wherein M isjIs the number of modes available for task j to choose to employ;
step 2: if there is an un-updateable resource/satisfy
Figure BDA0002311326640000023
Or that there is one task j and renewable resources k satisfying
Figure BDA0002311326640000024
Then the problem has no feasible scheduling scheme, the solution is finished, otherwise, the step 3 is switched to;
and step 3: carrying out pretreatment: carrying out redundancy and invalidation check on the mode and the resource, and removing the redundancy mode, the invalidation mode and the redundancy resource;
step 3.1: let the pattern flag value mflg ═ 0, resource flag value rflg ═ 0; if r is presentj,m,k>RkOr nj,m,l>NlThen mode m is invalid for task j, removing mode m in task j: order to
Figure BDA0002311326640000025
Figure BDA0002311326640000026
Wherein:
Figure BDA0002311326640000027
k1, …, K, L1, …, L; let Mj=Mj-1;
Step 3.2: if mflg is equal to 0, then let mflg be equal to 1, go to step 3.3; otherwise go to step 3.4;
step 3.3: if there is task j, patterns m and m' satisfy: dj,m′≤dj,m,rj,m′,k≤rj,m,k,nj,m′,l≤nj,m,lM' ≠ m, K ≠ 1, …, K, L ═ 1, …, L; then pattern m is redundant for task j, removing pattern m in task j: order to
Figure BDA0002311326640000028
Wherein:
Figure BDA0002311326640000029
k1, …, K, L1, …, L; let Mj=Mj-1,rflg=0;
Step 3.4: if rflg is equal to 0, let rflg be equal to 1, go to step 3.5; otherwise go to step 3.7;
step 3.5: if the renewable resource k satisfies:
Figure BDA0002311326640000031
then the renewable resource is redundant, removing renewable resource k: order to
Figure BDA0002311326640000032
Wherein: j-1, …, J,
Figure BDA0002311326640000033
let K-1, mflg-0;
step 3.6: if the non-updateable resource/satisfies:
Figure BDA0002311326640000034
then the non-updateable resource is redundant, removing non-updateable resource/: order to
Figure BDA0002311326640000035
Wherein: j-1, …, J,
Figure BDA0002311326640000036
let L-1, mflg-0;
step 3.7: if mflg ═ 1 ^ rflg ═ 1, go to step 3.8, otherwise go to step 3.2;
step 3.8: finishing the pretreatment;
and 4, step 4: calculating the hierarchy value of the task:
for a starting task 0 without a parent task, its hierarchy value is:
lvl0=0 (1)
the hierarchy values of other tasks are calculated using the following recursive formula:
Figure BDA0002311326640000037
and 5: initializing a contemporary population;
generating N different individuals by an individual generation method based on the hierarchy and the earliest task completion time to form an initial contemporary population, wherein N is the population scale and is a positive even number;
the individual adopts 2J bit integer coding, and the method comprises the following steps: ch ═ g1,…,gJ;gJ+1,…,g2J}, gene gjIs a positive integer, where g1,…,gJIs the execution mode list, gjIndicates the mode, g, adopted by task jj=1,...,MjJ — 1, …, J, for example: g12 indicates that task 1 employs mode 2; { gJ+1,…,g2JIs a scheduling order list, gJ+1,…,g2JIs an arrangement of 1, …, J and satisfies the timing constraint of a task, i.e. no task can be placed in front of its parent, gJ+jIndicating the jth scheduled task, i.e. task gJ+jIs the jth scheduled, e.g. gJ+13, the 1 st scheduled task is the task number 3;
the individual generation method based on the hierarchy and the earliest task completion time comprises the following steps:
step A1: randomly arranging and dividing t according to task hierarchy value from small to large0And tJ+1Other tasks, i.e., those with smaller hierarchy value in the front of larger hierarchy value and those with the same hierarchy value are arranged randomly to form a gene { g } which is an individual scheduling order listJ+1,…,g2J};
Step A2: individual serial decoding method based on earliest completion time of task generates individual execution mode list namely gene { g1,…,gJObtaining a fitness value fit thereof;
step A3: outputting an individual ch ═ g1,…,gJ,gJ+1,…,g2JFourthly, the operation is finished;
the individual serial decoding method based on the earliest completion time of the task comprises the following steps:
step B1: initializing a system state: order completion time f of task 000, F0Lf, lf representing the latest completion time of the item:
Figure BDA0002311326640000041
the elements in F are arranged from small to large; making a cycle control variable delta equal to 1; let the remaining available amount of the renewable resource corresponding to each completion time in F:
Figure BDA0002311326640000042
Figure BDA0002311326640000043
step B2: fetch task j equals gJ+δLet mode m equal to 1;
step B3: calculating the completion time f of task jjNamely:
step B3.1: let start time of task j
Figure BDA0002311326640000044
Let flag value flag be 1;
step B3.2: finding rt or more in FjAnd form a set TF, i.e., TF ═ { F ∈ F | F ≧ rtj};
Step B3.3: take the element with the smallest value from TF, do not set to fj′
Step B3.4: if flag is 1 and fj′-sj,m≥dj,mThen go to step B3.7; otherwise go to stepStep B3.5;
step B3.5: if flag is equal to 0, let sj,m=fj′,flag=1;
Step B3.6: judgment of fj′At the moment, whether the remaining available amount of all renewable resources meets the requirement of the task j is determined, that is, whether all K is 1, … and K meets the requirement
Figure BDA0002311326640000045
If not, the flag is 0; go to step B3.3;
step B3.7: let fj,m=sj,m+dj,m
Step B3.8: making m equal to m + 1; if M is less than or equal to MjGo to step B3.1, otherwise from
Figure BDA0002311326640000046
Taking out with minimum time of completion
Figure BDA0002311326640000047
Order to
Figure BDA0002311326640000048
Go to step B4;
step B4: if f isjIf F is absent, F is F ∪ { F ═ FjIs increased by fjRemaining available amount of renewable resources at the moment:
Figure BDA0002311326640000051
wherein: f. ofj″Is fjThe previous time of day;
step B5: update [ s ]j,fj) Remaining available amount of renewable resources within the time period:
Figure BDA0002311326640000052
step B6: let δ be δ +1, go to step B2 if δ ≦ J, otherwise go to step B7;
step B7: obtain execution mode list g1,…,gJ-calculating a fitness value fit of the individual,finishing the operation;
wherein:
Figure BDA0002311326640000053
representing the remaining available amount of resource k at time instant tau,
Figure BDA0002311326640000054
indicating the ready time of task j; step 6: carrying out N/2 times of scheduling sequence cross operation based on the hierarchy on the contemporary population to generate a new population, and carrying out scheduling sequence variation operation based on the hierarchy on each individual in the new population;
the scheduling order list interleaving operation based on the hierarchy comprises the following steps:
step C1: randomly selecting two different individuals from the contemporary population as a father 1 and a father 2 based on a ranking round-robin method;
step C2: randomly selecting a hierarchy without setting to be l;
step C3: exchanging the scheduling sequence of the task of the level l in the scheduling sequence list of the parent 1 and the scheduling sequence list of the parent 2, emptying the execution mode list, generating two children 1 and 2, and finishing the operation;
the hierarchical based scheduling order list mutation operation comprises the following steps:
step D1: generating a random number λ ∈ [0,1), if λ < pmGo to step D2, otherwise go to step D4;
step D2: if the number of tasks in the layer is larger than 1, randomly selecting one of the layers, not setting the layer as l, and going to step D3; otherwise go to step D4;
step D3: randomly selecting two tasks from the layer l, and exchanging the two tasks in a scheduling sequence list;
step D4: finishing the operation of the variation of the scheduling sequence list based on the hierarchy;
wherein: p is a radical ofm∈(0,1]Is the rate of variation;
and 7: generating an individual execution mode list and calculating the fitness value of each individual in the new population by adopting an individual serial decoding method based on the earliest task completion time;
and 8: selecting N different individuals from the current generation population and the new population from good to bad to form a new current generation population;
and step 9: judging whether a first-stage iteration termination condition is met, if so, ending the first-stage evolution, and turning to the step 10, otherwise, turning to the step 6;
the first stage termination condition is that the iteration is carried out to a specified algebraic TG1Or successive iterations GG1No improvement was made for the best individuals;
step 10: performing N/2 times of cross operation of the execution mode list and the scheduling sequence list on the contemporary population to generate a new population, and performing variation operation on the execution mode list and the scheduling sequence list on each individual in the new population;
the operation of crossing the execution mode list and the scheduling order list comprises the following steps:
step E1: two different individuals were randomly selected from the contemporary population as father 1 and father 2 based on a ranking round-robin method, which is not set as:
Figure BDA0002311326640000061
the daughter 1 and daughter 2 generated were not:
Figure BDA0002311326640000062
step E2: if it is not
Figure BDA0002311326640000063
And
Figure BDA0002311326640000064
if not, go to step E3, otherwise
Figure BDA0002311326640000065
Figure BDA0002311326640000066
Go to step E8;
step E3: finding out from front to back
Figure BDA0002311326640000067
And
Figure BDA0002311326640000068
position delta of the 1 st different gene of (1)1Finding out from back to front
Figure BDA0002311326640000069
And
Figure BDA00023113266400000610
position delta of the 1 st different gene of (1)2(ii) a If delta1≠δ2Go to step E4, otherwise
Figure BDA00023113266400000611
Go to step E7;
step E4: randomly generating a delta1To delta2-a positive integer α of 1;
step E5: ch (channel)c1The first α genes in the execution Pattern List part of (1) were from chp1The first α genes of the execution mode list part of (1), i.e.
Figure BDA00023113266400000612
The last J- α genes of the execution Pattern List part were from chp2The last J- α genes of the execution mode list part of (1), i.e.
Figure BDA00023113266400000613
Step E6: ch (channel)c2The first α genes in the execution Pattern List part of (1) were from chp2The first α genes of the execution mode list part of (1), i.e.
Figure BDA00023113266400000614
The last J- α genes of the execution Pattern List part were from chp1The last J- α genes of the execution mode list part of (1), i.e.
Figure BDA00023113266400000615
Step E7: if it is not
Figure BDA00023113266400000616
And
Figure BDA00023113266400000617
if not, go to step E8; otherwise
Figure BDA00023113266400000618
Figure BDA00023113266400000619
Go to step E12;
step E8: finding out from front to back
Figure BDA00023113266400000620
And
Figure BDA00023113266400000621
position delta of the 1 st different gene of (1)3From the back to the front
Figure BDA00023113266400000622
And
Figure BDA00023113266400000623
position delta of the 1 st different gene of (1)4
Step E9: randomly generating a delta3To delta4-a positive integer β of 1;
step E10: ch (channel)c1The first β genes in the dispatch order list from chp1The first β genes of the scheduling order list, i.e.
Figure BDA00023113266400000624
The last J- β genes are from chp2Scheduling order list of
Figure BDA00023113266400000625
Mid-delete chp1Scheduling order ofThe first β genes of the Table
Figure BDA00023113266400000626
The latter gene list;
step E11: ch (channel)c2The first β genes in the dispatch order list from chp2The first β genes of the scheduling order list, i.e.
Figure BDA0002311326640000071
The last J- β genes are from chp1Scheduling order list of
Figure BDA0002311326640000072
Mid-delete chp2The first β genes of the scheduling order list of
Figure BDA0002311326640000073
The latter gene list;
step E12: to obtain
Figure BDA0002311326640000074
Finishing the cross operation;
the execution mode list and scheduling order list mutation operation comprises the following steps:
step F1: generating a random number lambda1E [0,1), if λ1<pmGo to step F2; otherwise go to step F3;
step F2: from the execution mode list g1,…,gJRandomly selecting one gene, not setting as gjJ is 1, …, J, and if m is not set, g is the execution mode selected for task J again randomlyj=m;
Step F3: generating a random number lambda2E [0,1), if λ2<pmGo to step F4; otherwise go to step F5;
step F4: from the scheduling order list gJ+1,…,g2JRandomly selecting one gene, not setting as gjJ +1, …,2J if task gjThere is a parent task other than task 0Then from gjBegin finding the first parent g aheadj′Let the position value pos1J' +1, otherwise let pos1J + 1; if task gjThere are subtasks other than task J +1, then from gjStarting to find the first subtask g backwardsj″Let the position value pos2J "-1, otherwise let pos22J; in [ pos ]1,pos2]Randomly selects a position to insert gj
Step F5: finishing the mutation operation;
step 11: improving all individuals in the new population by adopting an FBI & D method and calculating the fitness value of the individuals;
the FBI & D method comprises the steps of:
step G1: making a counting variable theta equal to 1; performing serial individual decoding based on insertion mode on individual ch to obtain all task completion time fjAnd its fitness value fit;
step G2: changing task 0 into task J +1 and task J +1 into task 0, reversing the time sequence relationship between tasks, i.e. changing the father task set of tasks into the son task set, changing the son task set into the father task set, and according to the task completion time f, the scheduling sequence list in individual chjRearranging from large to small, i.e. g genes in individualsJ+jSet to the jth last completed task, J ═ 1, …, J, forming an individual ch;
step G3: let θ be θ +1, perform serial individual decoding based on the insertion mode on the individual ch to obtain the completion time f of all tasksjJ ═ 1, …, J, and its fitness value fit;
step G4: if fit < fit, then ch, fit, fj=fjJ is 1, …, J, go to step G2, otherwise go to step G5;
step G5: if theta is an even number, outputting the individual ch, otherwise outputting the individual ch, the fitness value fit of the individual ch, and ending the operation;
the serial individual decoding based on the insertion mode includes the steps of:
step H1: initializing a system state:order completion time f of task 000, F0Lf, the elements in F are arranged from small to large; making a cycle control variable delta equal to 1; let the remaining available amount of the renewable resource corresponding to each completion time in F:
Figure BDA0002311326640000081
step H2: fetch task j equals gJ+δAnd the mode m ═ g adopted by itj
Step H3: calculating the completion time of task j
Figure BDA0002311326640000082
Namely:
step H3.1: let start time s of task jj=rtjLet flag value flag be 1;
step H3.2: finding rt or more in FjAnd form a set TF, i.e., TF ═ { F ∈ F | F ≧ rtj};
Step H3.3: take the element with the smallest value from TF, do not set to fj′
Step H3.4: if flag is 1 and fj′-sj≥dj,mThen go to step H3.7; otherwise go to step H3.5;
step H3.5: if flag is equal to 0, let sj=fj′,flag=1;
Step H3.6: judgment of fj′At the moment, whether the remaining available amount of all renewable resources meets the requirement of the task j is determined, that is, whether all K is 1, … and K meets the requirement
Figure BDA0002311326640000083
If not, if the flag is 0, the step goes to a step H3.3;
step H3.7: let fj=sj+dj,m
Step H4: if f isjIf F is absent, F is F ∪ { F ═ FjIs increased by fjRemaining available amount of renewable resources at the moment:
Figure BDA0002311326640000084
wherein: f. ofj″Is fjThe previous time of day;
step H5: update [ s ]j,fj) Remaining available amount of renewable resources within the time period:
Figure BDA0002311326640000085
step H6: let δ be δ +1, go to step H2 if δ ≦ J, otherwise go to step H7;
step H7: obtaining all task completion times fj(ii) a Calculating the fitness value fit of the target, and finishing the operation;
step 12: selecting N different individuals from the current generation population and the new population from good to bad to form a new current generation population;
step 13: judging whether a second-stage evolution termination condition is met, if so, turning to a step 14, otherwise, turning to a step 10;
the second stage termination condition is that the iteration is carried out to a specified algebraic TG2Or successive iterations GG2No improvement was made for the best individuals;
step 14: if the optimal individual in the contemporary population is a feasible individual, outputting a scheduling scheme corresponding to the optimal individual and the project execution time thereof
Figure BDA0002311326640000091
Otherwise the problem has no feasible scheduling scheme.
Further, a specific calculation method of the fitness value fit is as follows: if the individual is an infeasible individual, i.e., there is an infeasible resource,/, satisfied
Figure BDA0002311326640000092
Then let the individual fitness value fit be lf + ms, otherwise let the individual fitness value fit be ms, where:
Figure BDA0002311326640000093
executing time for the project;
the smaller the fitness value fit, the better the individual.
Further, the specific steps of randomly selecting two different individuals from the contemporary population as father 1 and father 2 based on the ranking round-robin in the steps C1 and E1 are as follows:
step I1: sequencing the individuals in the contemporary population according to the priority to obtain the sequencing value rk of the individual nnN is 1, …, N, where the first row takes 1, the second row takes 2, and so on, and the last row takes N;
step I2: calculating the probability that the individual n is selected
Figure BDA0002311326640000094
R is greater than 1 and is a discrimination coefficient;
step I3: calculating the cumulative probability: a. the0=0,
Figure BDA0002311326640000095
Step I4: generating a random number lambda1E [0,1), if An-1≤λ1<AnThen individual n is selected as father 1;
step I5: generating a random number lambda2E [0,1), if An′-1≤λ2<An′And n '≠ n, then selects individual n' as parent 2, goes to step I6, otherwise goes to step I5;
step I6: the individual selection operation ends.
The invention has the beneficial effects that:
(1) compared with the traditional multi-mode resource limited project scheduling optimization method, the method provided by the invention has the advantages that the preprocessing step is added, so that the problem scale can be reduced and the solving time can be shortened when a redundant mode, an invalid mode and redundant resources exist.
(2) Compared with a heuristic algorithm, a semi-intelligent algorithm combined with the heuristic algorithm and an existing intelligent algorithm based on layered coding, the coding method adopted by the invention is designed, and any scheduling scheme has a coding scheme corresponding to the coding scheme, so that the search space is complete, and the global search can be realized;
(3) compared with an accurate algorithm, the algorithm designed by the invention can be suitable for solving large-scale problems.
(4) Compared with a common coding mode based on priority, the task scheduling sequence adopted by the invention adopts an integer coding method based on topological sorting, and the time sequence relation among tasks is considered, so that the decoding is simpler, the decoding efficiency can be effectively improved, and the overall efficiency of the algorithm is further improved.
(5) The serial decoding method, which is designed to be used in the present invention and which arranges the execution of tasks as early as possible based on the insertion mode, generally finds a better scheduling scheme than the decoding method based on the non-insertion mode and the parallel mode.
(6) Compared with the common one-way decoding method, the forward and backward individual decoding improvement strategy FBI & D adopted by the design of the invention enhances the neighborhood optimizing capability of the individual, thereby improving the optimizing capability and the searching efficiency of the whole algorithm.
(7) Compared with the existing single-stage intelligent search method, the method adopts a two-stage adaptive evolution strategy, the stage 1 adopts a mixed heuristic semi-intelligent algorithm based on a layering technology and the earliest task completion time, so that the algorithm can be converged near the optimal solution as soon as possible, and the stage 2 adopts a full intelligent algorithm to perform neighborhood expansion search on the basis of the previous stage, so that better individuals can be found, and the method has higher search efficiency and optimization capability.
(8) The invention adopts the strategy of generating the next generation population by combining the current generation population and the new population, thereby ensuring that the optimal individual is inherited to the next generation and leading the algorithm to be monotonously converged.
(9) Compared with the traditional crossing algorithm, the method increases the validity judgment of the crossing point in the crossing operation, and improves the crossing efficiency.
(10) Compared with the traditional random initialization method, the invention adopts the individual generation method based on the hierarchical topological sorting and the earliest task completion time when initializing the seed group, so that the algorithm can start searching from the vicinity of a better individual meeting the hierarchical coding, the searching efficiency can be improved, and the searching time can be shortened.
Drawings
FIG. 1 is a flow chart of a multi-mode resource-constrained project scheduling optimization method using a two-stage genetic algorithm according to the present invention.
FIG. 2 is a timing diagram of tasks according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, but the present invention is not limited to the examples.
A project is composed of 20 tasks numbered 0 to 19, and the task structure and the time sequence relation are shown in FIG. 2, wherein t0And t19Is a virtual task artificially increased, namely, the project construction period and the resource are not occupied, t1To t18The executable pattern of (a), and the time required for execution, the number of occupied updatable resources and the number of non-updatable resources in that pattern are shown in table 1. In this project, the available amount of the updatable resource 1 at any time is 12, the available amount of the updatable resource 2 at any time is 13, the available amount of the non-updatable resource 1 in the entire project period is 70, and the available amount of the non-updatable resource 2 in the entire project period is 85.
Figure BDA0002311326640000111
TABLE 1
For the above case, as shown in fig. 1, a method for scheduling and optimizing a multi-mode resource-constrained project using a two-stage genetic algorithm includes the following steps:
executing the step 1: formalizing a multi-mode resource limited project scheduling problem and acquiring information required by scheduling optimization;
acquiring task set T ═ T of project0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19Where task 0 and task 19, i.e. t0And t19Are virtual tasks, task 1 through task 18, i.e., t1,…,t18Is a task that actually needs to be scheduled;
obtaining the time sequence relation between tasks, namely a parent task set PR of the task jjAnd a set of subtasks SCj
Figure BDA0002311326640000112
SC0={t1,t2,t3};PR1={t0},SC1={t4,t6,t14};PR2={t0},SC2={t8};PR3={t0},SC3={t4,t5,t6};PR4={t1,t3},SC4={t10,t11,t13};PR5={t3},SC5={t7,t12,t13};PR6={t1,t3},SC6={t10,t18};PR7={t5},SC7={t8};PR8={t2,t7},SC8={t9,t14,t15};PR9={t8},SC9={t11,t16};PR10={t4,t6},SC10={t12,t16};PR11={t4,t9},SC11={t18};PR12={t5,t10},SC12={t17};PR13={t4,t5},SC13={t15,t17};PR14={t1,t8},SC14={t17};PR15={t8,t13},SC15={t16,t18};PR16={t9,t10,t15},SC16={t19};PR17={t12,t13,t14},SC17={t19};PR18={t6,t11,t15},SC18={t19};PR19={t16,t17,t18},
Figure BDA0002311326640000121
Acquiring the available quantity R of the renewable resource k in the project at any timek:R1=12,R 213, acquiring the available quantity N of the non-updatable resource l in the whole project periodl:N1=70,N2=85;
Acquiring the time needed by the task j to execute in the mode m, namely the construction period dj,mAnd the number r of occupied renewable resourcesj,m,kNumber of non-updatable resources nj,m,l:d1,1=2,r1,1,1=6,r1,1,2=9,n1,1,1=0,n1,1,2=8;d1,2=3,r1,2,1=5,r1,2,2=7,n1,2,1=4,n1,2,2=0;d1,3=5,r1,3,1=5,r1,3,2=6,n1,3,1=0,n1,3,2=6;……;d18,1=2,r18,1,1=6,r18,1,2=6,n18,1,1=0,n18,1,2=10;d18,2=4,r18,2,1=3,r18,2,2=4,n18,2,1=8,n18,2,2=0;d18,3=5,r18,3,1=3,r18,3,2=1,n18,3,1=2,n18,3,2=0。
And (3) executing the step 2: if there is an un-updateable resource/satisfy
Figure BDA0002311326640000122
Or that there is one task j and renewable resources k satisfying
Figure BDA0002311326640000123
Then the problem has no feasible scheduling scheme, the solution is finished, otherwise, the step 3 is switched to;
for a non-updateable resource 1,
Figure BDA0002311326640000124
for the non-updateable resource 2,
Figure BDA0002311326640000125
for renewable resource 1, all tasks j are satisfied
Figure BDA0002311326640000126
For renewable resource 2, all tasks j are satisfied
Figure BDA0002311326640000127
Therefore, there may be a feasible scheduling scheme for this problem, going to step 3. And (3) executing the step: carrying out pretreatment: carrying out redundancy and invalidation check on the mode and the resource, and removing the redundancy mode, the invalidation mode and the redundancy resource;
step 3.1 is executed: mflg ═ 0, rflg ═ 0; due to the absence of rj,m,k>RkAnd nj,m,l>Nl,j=1,…,18,m=1,…,MjK is 1,2, l is 1,2, so there is no invalid pattern in this item;
step 3.2 is executed: making mflg equal to 1 and going to step 3.3 because mflg is equal to 0;
step 3.3 is executed; since there is a task 12 and its mode 2 and mode 3 are satisfied: d12,2=8<d12,3=9,r12,2,1=6≤r12,3,1=6,r12,2,2=1≤r12,3,2=1,n12,2,1=3<n12,3,1=6,n12,2,2=2<n12,3,24, so pattern 3 is redundant to task 12, removing pattern 3 from task 12: let M12=3-1=2,rflg=0;
Step 3.4 is executed: making rflg ═ 1 because rflg is 0, go to step 3.5;
step 3.5 is executed: for renewable resource 1:
Figure BDA0002311326640000131
for renewable resource 2:
Figure BDA0002311326640000132
there are therefore no renewable resources k that satisfy:
Figure BDA0002311326640000133
the project does not have redundant renewable resources;
step 3.6 is executed: for non-updateable resource 1:
Figure BDA0002311326640000134
for non-updateable resource 2:
Figure BDA0002311326640000135
so that there is no non-updateable resource/that satisfies:
Figure BDA0002311326640000136
redundant non-updatable resources do not exist in the project;
step 3.7 is executed: since mflg ═ 1 ^ rflg ═ 1, go to step 3.8;
step 3.8 is executed: and finishing the pretreatment.
And (4) executing: calculating a level value of the task;
t0without parent task, with a hierarchy value of lvl0=0;t1Only one parent task 0, then
Figure BDA0002311326640000137
Similarly, the hierarchy values of other tasks may be obtained: lvl2=lvl3=1;lvl4=lvl5=lvl6=2;lvl7=lvl10=lvl13=3;lvl8=lvl12=4;lvl9=lvl14=lvl15=5;lvl11=lvl16=lvl17=6;lvl18=7;lvl19=8。
And 5, executing the step: initializing a contemporary population;
taking the population size N as 10;
the process of generating 1 individual based on the individual generation method of the hierarchy and the earliest completion time of the task is as follows:
step a1 is executed: randomly arranging tasks in level 1, which are 1,2,3, randomly arranging tasks in level 2, which are 4,5,6, randomly arranging tasks in level 3, which are 10,13,7, randomly arranging tasks in level 4, which are 8,12, randomly arranging tasks in level 5, which are 9,14,15, randomly arranging tasks in level 6, which are 11,16,17, randomly arranging tasks in level 7, which are 18, sequentially connecting the arrangements of tasks in level 1 to level 7 to form an individual scheduling order list { g }19,…,g36}={1,2,3,4,5,6,10,13,7,8,12,9,14,15,11,16,17,18};
Step a2 is executed: individual serial decoding method based on earliest completion time of task generates individual execution mode list { g1,…,g18}={1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,2,1,2};
Step a3 is executed: output individual ch11,1,1,1,1,1,1,3,1,1,1,1,1,1,2,1, 2; 1,2,3,4,5,6,10,13,7,8,12,9,14,15,11,16,17,18}, the fitness value fit thereof1The operation ends 66.
The specific implementation process of generating the individual execution mode list based on the individual serial decoding method of the earliest task completion time is as follows:
step B1 is executed: initialization of the system state f0=0,
Figure BDA0002311326640000141
Task completion time set F ═ F0-lf } - {0,122 }; the remaining available amount of the renewable resource corresponding to each completion time in F is:
Figure BDA0002311326640000142
Figure BDA0002311326640000143
δ=1;
step B2 is executed: fetch task j equals gJ+δ=g191, making the mode m 1;
step B3 is executed: calculating the completion time of task 1; i.e. step B3.1 is performed: let start time of task 1
Figure BDA0002311326640000144
Let flag be 1; and step B3.2 is executed: where F is ═ F0And if is greater than or equal to rt is found in {0,122}10, the composition set TF ═ { F ∈ F | F ≧ rt1=0}={f0-lf } - {0,122 }; step B3.3 is performed: from TF ═ f0The element with the smallest value is taken from {0,122}, which is f00; step B3.4 is performed: due to f0-s1,1=0-0=0<d1,1Go to step B3.5, 2; step B3.5 is performed: since flag is 1 at this time, go directly to step B3.6; step B3.6 is performed: due to the fact that
Figure BDA0002311326640000145
f0At time 0, the remaining available amount of all renewable resources meets the requirements of task 1, so the process goes directly to step B3.3; step B3.3 is performed: taking an element with the smallest value from TF { lf } {122}, wherein the element is lf-122; step B3.4 is performed: since flag is 1 and lf-s1,1=122-0=122>d1,1Go to step B3.7, 2; step B3.7 is performed: f. of1,1=s1,1+d1,10+ 2-2; step B3.8 is performed: m + 1-2, M2 ≦ M1If 3, go to step B3.1; step B3.1 is performed: let start time s of task 11,2=rt1=max{f0}=f00,1 is given as flag; and step B3.2 is executed: where F is ═ F0Finding rt or more from lf {0,122}10, the composition set TF ═ { F ∈ F | F ≧ rt1=0}={f0-lf } - {0,122 }; step B3.3 is performed: from TF ═ f0If is, take out the element with the smallest value (0,122)Element which is f00, then TF 122; step B3.4 is performed: due to f0-s1,2=0-0=0<d1,2Go to step B3.5, No. 3; step B3.5 is performed: since flag is 1 at this time, go directly to step B3.6; step B3.6 is performed: due to the fact that
Figure BDA0002311326640000151
f0At time 0, the remaining available amount of all renewable resources k meets the requirements of task 1, so the process goes directly to step B3.3; step B3.3 is performed: if the element with the smallest value is selected from TF { lf } {122}, which is lf 122, then
Figure BDA0002311326640000152
Step B3.4 is performed: since flag is 1 and lf-s1,2=122-0=122>d1,2Go to step B3.7, No. 3; step B3.7 is performed: f. of1,2=s1,2+d1,20+ 3-3; step B3.8 is performed: m is 2+1 is 3, because M is 3 ≦ M1If 3, go to step B3.1; … …, and repeating steps B3.1 to B3.8 until M is 4 > M1Is 3, gives s1,1=0,s1,2=0,s1,3=0,f1,1=2,f1,2=3,f1,3From f to 51,1=2,f1,2=3,f1,3Minimum removal completion time f of 51,12, let f1=f1,1=2,s1=f1-d1,1=2-2=0,g1Go to step B4, if 1;
step B4 is executed: due to the fact that
Figure BDA0002311326640000153
F is F ∪ { F ═ F1}={f0,lf}∪f1={f0,f1And if is {0,2,122}, increasing f1The remaining available amount of resources can be updated at 2:
Figure BDA0002311326640000154
step B5 is executed: updating[s1,f1) Remaining available amount of renewable resource k in time period [0, 2):
Figure BDA0002311326640000155
step B6 is executed: if δ +1 is 2, then go to step B2, since δ 2 ≦ J ≦ 18;
step B2 is executed: fetch task j equals g18+2=g202, making the mode m equal to 1;
step B3 is executed: calculating the completion time of task 2; i.e. step B3.1 is performed: let start time s of task 22,1=rt2=max{f0}=f00,1 is given as flag; and step B3.2 is executed: find out rt or more in F ═ {0,2,122}20, the composition set TF ═ {0,2,122 }; step B3.3 is performed: taking the element with the smallest value from TF {0,2,122}, and taking the element with the smallest value as 0, then TF {2,122 }; step B3.4 is performed: due to 0-s2,1=0<d2,1Turning to step B3.5, if 6; step B3.5 is performed: since flag is 1 at this time, go directly to step B3.6; step B3.6 is performed: due to the fact that
Figure BDA0002311326640000161
That is, at time 0, the remaining available amount of the renewable resource 1 cannot meet the requirement of the task 2, if flag is equal to 0, go to step B3.3; step B3.3 is performed: taking the element with the smallest value from TF {2,122}, wherein the element is 2, and TF {122 }; step B3.4 is performed: if flag is 0, go to step B3.5; step B3.5 is performed: since flag is equal to 0, s is2,12,1 is flag; step B3.6 is performed: due to the fact that
Figure BDA0002311326640000162
2, the residual available quantity of all renewable resources meets the requirement of the task 2, so the step B3.3 is directly carried out; step B3.3 is performed: the element with the smallest value is taken from TF 122, which is 122,
Figure BDA0002311326640000163
step B3.4 is performed: since flag is 1 and 122-s2,1=120>d2,1Turning to step B3.7, if 6; step B3.7 is performed: f. of2,1=s2,1+d2,12+ 6-8; step B3.8 is performed: m + 1-2, M2 ≦ M2If 3, go to step B3.1; … …, and repeating steps B3.1 to B3.8 until M is 4 > M2Is 3, gives s2,1=2,s2,2=2,s2,3=2,f2,1=8,f2,2=10,f2,311 from f2,1=8,f2,2=10,f2,3Minimum removal completion time f of 112,1Let f be 82=f2,1=8,s2=f2-d2,1=8-6=2,g2Go to step B4, if 1;
step B4 is executed: due to the fact that
Figure BDA0002311326640000169
Then F ═ F0,f1,f2And if is {0,2,8,122}, increasing f2The remaining available amount of resources can be updated at time 8:
Figure BDA0002311326640000164
step B5 is executed: update [ s ]2,f2) 2,8) remaining available amount of renewable resources in the time period:
Figure BDA0002311326640000165
step B6 is executed: if δ 2+1 is 3, go to step B2, since δ 3 ≦ J ≦ 18;
……
thus, the steps B2 to B6 are repeatedly executed until δ 19 > J18, and then the process goes to step B7;
step B7 is executed: obtain execution mode list g1,…,g18-1, 1,1,1,1,1,1,1,3,1,1,1,1,1,1,2,1,2}, calculating an individual fitness value: due to the fact that
Figure BDA0002311326640000166
Figure BDA0002311326640000167
The individual is thus a viable individual, the fitness value of which
Figure BDA0002311326640000168
The operation is ended.
Similarly, the remaining 9 different individuals that can generate the contemporary population are:
ch2={2,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,3,1;3,1,2,4,6,5,13,7,10,12,8,15,9,14,16,11,17,18};
ch3={2,1,1,1,1,1,1,1,2,1,1,2,1,1,1,1,3,1;2,3,1,5,4,6,10,13,7,12,8,14,15,9,16,11,17,18};
ch4={2,2,1,1,1,1,1,1,2,1,1,2,1,1,1,2,1,1;3,1,2,5,4,6,10,13,7,12,8,14,9,15,17,16,11,18};
ch5={1,1,1,1,1,1,1,1,2,1,1,1,3,1,1,2,1,1;2,1,3,5,4,6,7,13,10,12,8,14,9,15,17,16,11,18};
ch6={2,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;3,1,2,4,5,6,13,7,10,8,12,15,9,14,11,17,16,18};
ch7={2,1,1,1,1,1,1,1,2,1,1,1,3,1,1,1,1,1;2,3,1,5,4,6,7,10,13,12,8,14,9,15,16,17,11,18};
ch8={1,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1;3,2,1,5,4,6,13,7,10,8,12,15,9,14,16,17,11,18};
ch9={2,1,1,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1;2,3,1,4,6,5,13,10,7,8,12,15,14,9,16,11,17,18};
ch10={1,2,1,1,1,1,1,1,2,1,1,1,3,1,1,2,1,2;1,3,2,6,5,4,7,10,13,12,8,14,15,9,11,16,17,18};
the fitness values are respectively as follows: fit2=53,fit3=179,fit4=178,fit5=184,fit6=58,fit7=186,fit8=185,fit9=61,fit10=55;
The initial current generation population finally generated in this way is CP={ch1,ch2,ch3,ch4,ch5,ch6,ch7,ch8,ch9,ch10}。
And 6, executing the step: carrying out N/2 times of scheduling sequence cross operation based on the hierarchy on the contemporary population to generate a new population, and carrying out scheduling sequence variation operation based on the hierarchy on each individual in the new population;
the specific implementation process of performing one-time cross operation on the contemporary population is as follows:
step C1 is executed: rank-based betting rounds randomly select two different individuals from the contemporary population as father 1 and father 2, namely: step I1 is executed: sequencing the individuals in the current generation population according to the priority, and obtaining the sequencing value of each individual: rk1=5,rk2=1,rk3=7,rk4=6,rk5=8,rk6=3,rk7=10,rk8=9,rk9=4,rk102; step I2 is executed: let R1 + 1/N1.1, calculate the 1 st individual ch1Probability of being selected
Figure BDA0002311326640000173
Same principle A2=0.148,A3=0.083,A4=0.092,A5=0.076,A6=0.122,A7=0.063,A8=0.069,A9=0.111,A100.135; step I3 is executed: calculating cumulative probability A0=0,
Figure BDA0002311326640000171
Figure BDA0002311326640000172
A3=0.332,A4=0.424,A5=0.500,A6=0.622,A7=0.685,A8=0.754,A9=0.865,A101.000; step I4 is executed: generate a random number of [0,1), which is 0.433, since A4=0.424≤0.433<0.500=A5Thus selecting ch5As a father 1; step I5 is executed: randomly generating a random number of [0,1), which is 0.840 due to A8=0.754≤0.840<0.865=A9And 9 ≠ 4, so ch is selected9As father 2, go to step I6; step I6 is executed: the individual selection operation ends.
Step C2 is executed: randomly selecting a level, which is level 3;
step C3 is executed: exchanging the scheduling order of the task of level 3 in the scheduling order list of parent 1 and the scheduling order list of parent 2, as shown in table 2, and emptying the execution mode list to generate child 1:
ch′1{,,,,,,,,,,,,,,,; 2,1,3,5,4,6,13,10,7,12,8,14,9,15,17,16,11,18} and the subvolume 2:
ch′2{,,,,,,,,,,,,,,,; 2,3,1,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18 }; finishing the operation;
gene g19 g20 g21 g22 g23 g24 g25 g26 g27 g28 g29 g30 g31 g32 g33 g34 g35 g36
Father body 1 2 1 3 5 4 6 7 13 10 12 8 14 9 15 17 16 11 18
Father body 2 2 3 1 4 6 5 13 10 7 8 12 15 14 9 16 11 17 18
Sub-body 1 2 1 3 5 4 6 13 10 7 12 8 14 9 15 17 16 11 18
Sub-body 2 2 3 1 4 6 5 7 13 10 8 12 15 14 9 16 11 17 18
TABLE 2
Similarly, the remaining individuals in the new population generated after crossover are:
ch′3={,,,,,,,,,,,,,,,,,;1,2,3,4,5,6,10,13,7,8,12,9,14,15,11,16,17,18};
ch′4={,,,,,,,,,,,,,,,,,;3,2,1,5,4,6,13,7,10,8,12,15,9,14,16,17,11,18};
ch′5={,,,,,,,,,,,,,,,,,;3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18};
ch′6={,,,,,,,,,,,,,,,,,;2,1,3,5,4,6,13,7,10,12,8,14,9,15,17,16,11,18};
ch′7={,,,,,,,,,,,,,,,,,;3,1,2,4,6,5,10,13,7,12,8,14,9,15,17,16,11,18};
ch′8={,,,,,,,,,,,,,,,,,;2,3,1,5,4,6,13,10,7,8,12,15,14,9,16,11,17,18};
ch′9={,,,,,,,,,,,,,,,,,;3,1,2,4,5,6,10,13,7,12,8,14,9,15,17,16,11,18};
ch′10={,,,,,,,,,,,,,,,,,;3,1,2,5,4,6,13,7,10,8,12,15,9,14,11,17,16,18};
the new population thus finally generated is NP ═ ch'1,ch′2,ch′3,ch′4,ch′5,ch′6,ch′7,ch′8,ch′9,ch′10}。
The specific implementation process of performing mutation operation on the new population is as follows:
taking the rate of variation pm=0.2;
To individual ch'1{,,,,,,,,,,,,,,,; 2,1,3,5,4,6,13,10,7,12,8,14,9,15,17,16,11,18} performing mutation operations as follows:
step D1 is executed: randomly generating a [0,1) random number λ, which is 0.35, since λ 0.35 > pmIf 0.2, go to step D4;
step D4 is executed: finishing the operation of the variation of the scheduling sequence list based on the hierarchy;
……
to individual ch'4{,,,,,,,,,,,,,,,; 3,2,1,5,4,6,13,7,10,8,12,15,9,14,16,17,11,18} performing mutation operations as follows:
step D1 is executed: randomly generating a [0,1) random number λ, which is 0.01, since λ 0.01 < pmIf 0.2, go to step D2;
step D2 is executed: if the number of tasks in the levels 1,2,3,4,5 and 6 is more than 1, randomly selecting a level from the levels 1,2,3,4,5 and 6, wherein the level is level 5, and turning to the step D3;
step D3 is executed: follow from level 5The machine selects two tasks, which are t9And t15The two tasks are swapped in the scheduling order list, and the mutated individuals become ch'4={,,,,,,,,,,,,,,,,,;3,2,1,5,4,6,13,7,10,8,12,9,15,14,16,17,11,18};
Step D4 is executed: finishing the operation of the variation of the scheduling sequence list based on the hierarchy;
gene g19 g20 g21 g22 g23 g24 g25 g26 g27 g28 g29 g30 g31 g32 g33 g34 g35 g36
Before mutation 3 2 1 5 4 6 13 7 10 8 12 15 9 14 16 17 11 18
After mutation 3 2 1 5 4 6 13 7 10 8 12 9 15 14 16 17 11 18
TABLE 3
……
Thus, the individuals in the new population after mutation become:
ch′1={,,,,,,,,,,,,,,,,,;2,1,3,5,4,6,13,10,7,12,8,14,9,15,17,16,11,18};
ch′2={,,,,,,,,,,,,,,,,,;2,3,1,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch′3={,,,,,,,,,,,,,,,,,;1,2,3,4,5,6,10,13,7,8,12,9,14,15,11,16,17,18};
ch′5={,,,,,,,,,,,,,,,,,;3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18};
ch′6={,,,,,,,,,,,,,,,,,;2,1,3,5,4,6,13,7,10,12,8,14,9,15,17,16,11,18};
ch′7={,,,,,,,,,,,,,,,,,;3,1,2,4,6,5,13,10,7,12,8,14,9,15,17,16,11,18};
ch′8={,,,,,,,,,,,,,,,,,;2,3,1,5,4,6,13,10,7,8,12,15,14,9,16,11,17,18};
ch′9={,,,,,,,,,,,,,,,,,;3,1,2,4,5,6,10,13,7,12,8,14,9,15,17,16,11,18};
ch′10={,,,,,,,,,,,,,,,,,;3,1,2,5,4,6,13,7,10,8,12,15,9,14,11,17,16,18}。
and 7, executing the step: generating an individual execution mode list based on the earliest task completion time for each individual in the new population and calculating the fitness value of the individual execution mode list;
after all individuals in the new population generate an individual execution mode list based on the earliest task completion time, the method is changed into the following steps:
ch′1={1,1,1,1,1,1,1,1,2,1,1,2,1,1,1,2,1,1;2,1,3,5,4,6,13,10,7,12,8,14,9,15,17,16,11,18};
ch′2={2,1,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;2,3,1,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch′3={1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,2,1,2;1,2,3,4,5,6,10,13,7,8,12,9,14,15,11,16,17,18};
ch′4={1,2,1,1,1,1,1,1,3,1,1,1,1,3,1,1,1,1;3,2,1,5,4,6,13,7,10,8,12,9,15,14,16,17,11,18};
ch′5={2,2,1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1;3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18};
ch′6={1,1,1,1,1,1,1,1,2,1,1,2,1,1,1,2,1,1;2,1,3,5,4,6,13,7,10,12,8,14,9,15,17,16,11,18};
ch′7={2,2,1,1,1,2,1,1,2,1,1,2,1,1,1,2,1,1;3,1,2,4,6,5,13,10,7,12,8,14,9,15,17,16,11,18};
ch′8={2,1,1,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1;2,3,1,5,4,6,13,10,7,8,12,15,14,9,16,11,17,18};
ch′9={2,2,1,1,1,1,1,1,2,1,1,2,1,1,1,2,1,1;3,1,2,4,5,6,10,13,7,12,8,14,9,15,17,16,11,18};
ch′10={2,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;3,1,2,5,4,6,13,7,10,8,12,15,9,14,11,17,16,18};
the fitness values are respectively as follows: fist'1=183,fit′2=57,fit′3=66,fit′4=182,fit′5=54,fit′6=183,fit′7=55,fit′8=60,fit′9=178,fit′10=58。
And step 8 is executed: selecting N different individuals from the current generation population and the new population from good to bad to form a new current generation population;
selecting the ch of the current generation population from good to bad according to the fitness value1,ch2,ch6,ch9,ch10And ch 'of the New population'2,ch′5,ch′7,ch′8,ch′10Forming the next generation of population, i.e. GP ═ ch1,ch2,ch6,ch9,ch10,ch′2,ch′5,ch′7,ch′8,ch′10}。
Let CP be GP, the contemporary population becomes:
ch1={1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,2,1,2;1,2,3,4,5,6,10,13,7,8,12,9,14,15,11,16,17,18};
ch2={2,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,3,1;3,1,2,4,6,5,13,7,10,12,8,15,9,14,16,11,17,18};
ch3={2,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;3,1,2,4,5,6,13,7,10,8,12,15,9,14,11,17,16,18};
ch4={2,1,1,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1;2,3,1,4,6,5,13,10,7,8,12,15,14,9,16,11,17,18};
ch5={1,2,1,1,1,1,1,1,2,1,1,1,3,1,1,2,1,2;1,3,2,6,5,4,7,10,13,12,8,14,15,9,11,16,17,18};
ch6={2,1,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;2,3,1,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch7={2,2,1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1;3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18};
ch8={2,2,1,1,1,2,1,1,2,1,1,2,1,1,1,2,1,1;3,1,2,4,6,5,13,10,7,12,8,14,9,15,17,16,11,18};
ch9={2,1,1,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1;2,3,1,5,4,6,13,10,7,8,12,15,14,9,16,11,17,18};
ch10={2,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;3,1,2,5,4,6,13,7,10,8,12,15,9,14,11,17,16,18};
the fitness values are respectively as follows: fit1=66,fit2=53,fit3=58,fit4=61,fit5=55,fit6=57,fit7=54,fit8=55,fit9=60,fit10=58。
And step 9 is executed: judging whether a first-stage iteration termination condition is met, if so, ending the first-stage evolution, and turning to the step 10, otherwise, turning to the step 6;
the first stage iteration termination condition is set as population evolution TG115 generation;
and (4) since the current population is iteratively evolved for two generations and does not meet the iteration termination condition of the first stage, the step 6 is carried out.
……
Thus, the steps 6 to 9 are continuously and repeatedly executed, and after 15 generations of iteration, the contemporary population becomes:
ch1={2,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,3,1;3,1,2,4,6,5,13,7,10,12,8,15,9,14,16,11,17,18};
ch2={2,1,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;2,3,1,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch3={2,1,1,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1;2,3,1,5,4,6,13,10,7,8,12,15,14,9,16,11,17,18};
ch4={2,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;3,1,2,4,5,6,10,13,7,8,12,15,9,14,11,17,16,18};
ch5={2,2,1,1,1,2,1,1,3,1,1,1,3,1,3,1,3,1;3,1,2,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch6={2,1,1,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1;2,3,1,4,6,5,13,10,7,8,12,15,14,9,16,11,17,18};
ch7={2,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;3,1,2,4,5,6,13,7,10,8,12,15,9,14,11,17,16,18};
ch8={2,2,1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1;3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18};
ch9={1,2,1,1,1,1,1,1,2,1,1,1,3,1,1,2,1,2;1,3,2,6,5,4,7,10,13,12,8,14,15,9,11,16,17,18};
ch10={1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,2,1,2;1,2,3,4,5,6,10,13,7,8,12,9,14,15,11,16,17,18};
the fitness values are respectively as follows: fit1=53,fit2=57,fit3=60,fit4=59,fit5=52,fit6=61,fit7=58,fit8=54,fit9=55,fit10=66;
And (4) because the population is iteratively evolved for 15 generations and meets the iteration termination condition of the first stage, ending the evolution of the first stage and turning to the step 10.
Executing the step 10: performing N/2 times of cross operation of the execution mode list and the scheduling sequence list on the contemporary population to generate a new population, and performing variation operation on the execution mode list and the scheduling sequence list on each individual in the new population;
the specific implementation process of performing 1-time cross operation on the contemporary population is as follows:
step E1 is executed: randomly selecting two different individuals from the contemporary population as a father 1 and a father 2 by adopting a ranking-based round-robin method, wherein the two different individuals are respectively as follows:
ch52,2,1,1,1,2,1,1,3,1,1,1,3,1,3,1,3, 1; 3,1,2,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18} and
ch8={2,2,1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1;3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18};
step E2 is executed: since {2,2,1,1,1,2,1,1,3,1,1,1,3,1,3,1, 1,1, 1} is different from {2,2,1,1,1,1,1,1,1,1,1,1,3,1,3, 1}, go to step E3;
step E3 is executed: finding the position of the first different gene of the execution mode list {2,2,1,1,1,1, 2,1,1,3,1,1,1, 1,3,1,3,1} of the father 1 and the execution mode list {2,2,1,1,1,1,1,1, 3,1,3,1,3,1} of the father 2 from the front to the back, which is 6, finding the position of the first different gene of the execution mode list {2,2,1,1,1,1, 3,1,1,1,1,1,1, 1,3,1,3,1} of the father 1 and the execution mode list {2,2,1,1,1,1,1,1,1,1,1, 3,1} of the father 2 from the back to the front; as 6 ≠ 9, it goes to step E4;
step E4 is executed: randomly generating a positive integer between 6 and 8, which is 8;
step E5 is executed: as shown in table 4, the first 8 genes of the execution pattern list part of the daughter 1 are from the first 8 genes of the execution pattern list part of the father 1, and the last 10 genes of the execution pattern list part are from the last 10 genes of the execution pattern list part of the father 2;
step E6 is executed: as shown in table 4, the first 8 genes of the execution pattern list part of the daughter 2 are from the first 8 genes of the execution pattern list part of the father 2, and the last 10 genes of the execution pattern list part are from the last 10 genes of the execution pattern list part of the father 1;
Figure BDA0002311326640000221
Figure BDA0002311326640000231
TABLE 4
Step E7 is executed: since {3,1,2,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18} is different from {3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18}, go to step E8;
step E8 is executed: finding the position of the first different gene of the scheduling order list {3,1,2,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18} of parent 1 and the scheduling order list {3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18} of parent 2 from the front to the back, which is 5, finding the position of the first different gene of the scheduling order list {3,1,2,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18} of parent 1 and the scheduling order list {3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18} of parent 2 from the back to the front, which is 17;
step E9 is executed: randomly generating a positive integer between 5 and 16, which is 10;
step E10 is executed: as shown in table 5, the first 10 genes of the schedule order list of child 1 are from the first 10 genes of the schedule order list of father 1, and the last 8 genes are from the schedule order list of father 2 {3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18} in which the first 10 genes 3,1,2,4,6,5,7,13,10,8 of the schedule order list of father 1 are deleted;
step E11 is executed: as shown in table 5, the first 10 genes of the schedule order list of the daughter 2 are from the first 10 genes of the schedule order list of the father 2, and the last 8 genes are from the schedule order list of the father 1 {3,1,2,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18} in which the first 10 genes 3,1,2,4,5,6,7,13,10,8 of the schedule order list of the father 2 are deleted;
gene g19 g20 g21 g22 g23 g24 g25 g26 g27 g28 g29 g30 g31 g32 g33 g34 g35 g36
Father body 1 3 1 2 4 6 5 7 13 10 8 12 15 14 9 16 11 17 18
Father body 2 3 1 2 4 5 6 7 13 10 8 12 15 9 14 11 17 16 18
Sub-body 1 3 1 2 4 6 5 7 13 10 8 12 15 9 14 11 17 16 18
Sub-body 2 3 1 2 4 5 6 7 13 10 8 12 15 14 9 16 11 17 18
TABLE 5
Step E12 is executed: end of the crossover operation, output
ch′12,2,1,1,1,2,1,1,1,1,1, 3,1,3,1,3, 1; 3,1,2,4,6,5,7,13,10,8,12,15,9,14,11,17,16,18} and
ch′2={2,2,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;3,1,2,4,5,6,7,13,10,8,12,15,14,9,16,11,17,18}。
similarly, the remaining individuals in the new population generated after crossover are:
ch′3={2,1,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;2,3,1,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch′4={2,2,1,1,1,2,1,1,3,1,1,1,1,1,3,1,3,1;3,1,2,4,6,5,13,10,7,8,12,15,14,9,16,11,17,18};
ch′5={2,2,1,1,1,2,1,1,1,1,1,1,3,1,3,1,3,1;3,1,2,4,6,5,13,7,10,8,12,15,14,9,16,11,17,18};
ch′6={2,2,1,1,1,2,1,1,3,1,1,2,1,1,1,1,3,1;3,1,2,4,6,5,7,13,10,12,8,15,9,14,16,11,17,18};
ch′7={2,2,1,1,1,1,1,1,2,1,1,1,3,1,1,2,1,2;2,3,1,4,6,5,7,10,13,12,8,14,15,9,11,16,17,18};
ch′8={1,1,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;1,3,2,6,4,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch′9={2,2,1,1,1,1,1,1,2,1,1,1,3,1,1,2,1,2;3,1,2,6,5,4,7,10,13,12,8,14,15,9,11,16,17,18};
ch′10={1,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;1,3,2,4,5,6,13,7,10,8,12,15,9,14,11,17,16,18};
the new population thus finally generated is NP ═ ch'1,ch′2,ch′3,ch′4,ch′5,ch′6,ch′7,ch′8,ch′9,ch′10}。
The specific implementation process of performing mutation operation on the new population is as follows:
taking the rate of variation pm=0.2;
For ch'1={2,2,1,1,1,2,1,1,1,1,1,1,3,1,3,1,3,1;3,1,2,4,6,5,7,13,10,8,12,15,9,14,11,17,16,18};
Step F1 is performed: generating a random number of [0,1), which is 0.18, since 0.18 < pmIf 0.2, go to step F2;
step F2 is performed: randomly selecting a gene from the execution pattern list {2,2,1,1,1,2,1,1,1,1,1, 3,1,3,1}, which is g81, a pattern is randomly re-selected from the executable patterns of task 8, which is pattern 2, then g8=2;
Step F3 is performed: generating a random number of [0,1), which is 0.03, since 0.03 < pmIf 0.2, go to step F4;
step F4 is performed: randomly selecting a gene from the scheduling order list {3,1,2,4,6,5,7,13,10,8,12,15,9,14,11,17,16,18}, which is g27Since task 10 has a parent task other than task 0 and a child task other than task 19, the first parent task g is found forward23When the average molecular weight is 6, pos is123+ 1-24, find the first subtask g backward29=12,pos2At [24,28 ] 29-1-28]Randomly selects a position for insertion, which is g24
Step F5 is performed: finishing the mutation operation;
post mutation ch'={2,2,1,1,1,2,1,2,1,1,1,1,3,1,3,1,3,1;3,1,2,4,6,10,5,7,13,8,12,15,9,14,11,17,16,18}。
Similarly, other individuals in the new population become:
ch′2={2,2,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;3,1,2,4,5,6,7,13,10,8,15,14,9,16,11,12,17,18};
ch′3={2,3,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;2,3,1,6,4,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch′4={2,2,1,1,1,2,1,1,3,1,1,1,1,1,3,1,3,1;3,1,2,4,6,5,13,10,7,8,12,15,14,9,16,11,17,18};
ch′5={2,2,1,1,1,2,1,1,1,1,1,1,3,1,3,1,3,1;3,1,2,4,6,5,13,7,10,8,12,15,14,9,16,11,17,18};
ch′6={2,2,1,3,1,2,1,1,3,1,1,2,1,1,1,1,3,1;3,1,2,4,6,5,7,13,10,12,8,15,9,14,16,11,17,18};
ch′7={2,2,1,1,1,1,1,1,2,1,1,2,3,1,1,2,1,2;2,3,1,4,6,5,7,10,13,12,8,14,15,9,11,16,17,18};
ch′8={1,1,1,1,1,1,1,1,3,1,1,1,3,1,3,2,3,1;1,3,2,6,4,5,13,7,10,8,12,15,14,9,16,11,17,18};
ch′9={2,2,1,1,1,1,2,1,2,1,1,1,3,1,1,2,1,2;3,1,2,6,5,4,7,10,13,12,8,14,15,9,11,16,17,18};
ch′10={2,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;1,3,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18}。
executing step 11: improving all individuals in the new population by adopting an FBI & D method and calculating the fitness value of the individuals;
to individual ch'62,2,1,3,1,2,1,1,3,1,1,2,1,1,1, 3, 1; 3,1,2,4,6,5,7,13,10,12,8,15,9,14,16,11,17,18} employs FBI&The method D comprises the following specific implementation processes:
step G1 is executed: let θ be 1, for individual ch'6Performing serial individual decoding based on the insertion mode to obtain all task completion times: f'1=3,f′2=11,f′3=8,f′=11,f′5=17,f′6=14,f′7=24,f′8=44,f′9=49,f′10=18,f′11=58,f′12=37,f′13=29,f′14=49,f′15=45,f′16=52,f′17=61,f′1860 and a fitness value of fit'6=61;
Step G2 is executed: changing task 0 to task 19 and task 19 to task 0, reversing the timing relationship between the tasks, i.e.
Figure BDA0002311326640000251
SC0={t16,t17,t18};PR18={t0},SC18={t6,t11,t15};PR17={t0},SC17={t12,t13,t14};PR16={t0},SC16={t9,t10,t15};PR15={t16,t18},SC15={t8,t13};PR14={t17},SC14={t1,t8};PR13={t15,t17},SC13={t4,t5};PR12={t17},SC12={t5,t10};PR11={t18},SC11={t4,t9};PR10={t12,t16},SC10={t4,t6};PR9={t11,t16},SC9={t8};PR8={t9,t14,t15},SC8={t2,t7};PR7={t8},SC7={t5};PR6={t10,t18},SC6={t1,t3};PR5={t7,t12,t13},SC5={t3};PR4={t10,t11,t13},SC4={t1,t3};PR3={t4,t5,t6},SC3={t19};PR2={t8},SC2={t19};PR1={t4,t6,t14},SC1={t19};PR19={t1,t2,t3},
Figure BDA0002311326640000252
Prepared from ch'6According to the task completion time f 'in the scheduling sequence list'jRearranging from large to small, i.e. g genes in individualsJ+jSet to the jth last completed task, form individual ch'6={2,2,1,3,1,2,1,1,3,1,1,2,1,1,1,1,3,1;17,18,11,16,14,9,15,8,12,13,7,10,5,6,4,2,3,1};
Step G3 is executed: theta ═ 2, ch 'for individuals'6Performing serial individual decoding based on the insertion mode obtains the completion time of all tasks: f'1=52,f′2=49,f′3=52,f′4=41,f′5=41,f′6=44,f′7=31,f′8=24,f′9=17,f′10=38,f′11=8,f′12=32,f′13=37,f′14=13,f′15=14,f′16=12,f′17=9,f′182 and its fitness value of fit'6=52;
Step G4 is executed: due to fact'6=52<fit′661, then ch'6=ch′6,fit′6=fit′6,f′j=f′jGo to step G2;
step G2 is executed: changing task 0 to task 19, changing task 19 to task 0, reversing the timing relationship between the tasks, i.e.
Figure BDA0002311326640000261
SC0={t1,t2,t3};PR1={t0},SC1={t4,t6,t14};PR2={t0},SC2={t8};PR3={t0},SC3={t4,t5,t6};PR4={t1,t3},SC4={t10,t11,t13};PR5={t3},SC5={t7,t12,t13};PR6={t1,t3},SC6={t10,t18};PR7={t5},SC7={t8};PR8={t2,t7},SC8={t9,t14,t15};PR9={t8},SC9={t11,t16};PR10={t4,t6},SC10={t12,t16};PR11={t4,t9},SC11={t18};PR12={t5,t10},SC12={t17};PR13={t4,t5},SC13={t15,t17};PR14={t1,t8},SC14={t17};PR15={t8,t13},SC15={t16,t18};PR16={t9,t10,t15},SC16={t19};PR17={t12,t13,t14},SC17={t19};PR18={t6,t11,t15},SC18={t19};PR19={t16,t17,t18},
Figure BDA0002311326640000262
Prepared from ch'6According to the task completion time f 'in the scheduling sequence list'jRearranging from large to small, i.e. g genes in individualsJ+jSet to the jth last completed task, form individual ch'6={2,2,1,3,1,2,1,1,3,1,1,2,1,1,1,1,3,1;1,3,2,6,4,5,10,13,12,7,8,9,15,14,16,17,11,18};
Step G3 is executed: theta-3, ch 'for individual'6Performing serial individual decoding based on the insertion mode obtains the completion time of all tasks: f'1=3,f′2=11,f′3=8,f′4=14,f′5=14,f′6=11,f′7=27,f′8=35,f′9=40,f′10=15,f′11=49,f′12=28,f′13=20,f′14=40,f′15=36,f′16=43,f′17=52,f′1851 and its fitness value fit'6=52;
Step G4 is executed: due to fact'6=fit′6Go to step G5, 52;
step G5 is executed: since θ is an odd number, 3 is output as the individual ch'6=ch′6={2,2,1,3,12,1,1,3,1,1,2,1,1,1, 3, 1; 1,3,2,6,4,5,10,13,12,7,8,9,15,14,16,17,11,18}, and fitness value of fit'6When 52, the operation is finished;
ch 'to the above individuals'62,2,1,3,1,2,1,1,3,1,1,2,1,1,1, 3, 1; 3,1,2,4,6,5,7,13,10,12,8,15,9,14,16,11,17,18}, where θ is 1, the implementation procedure of the serial individual decoding based on the insertion mode is as follows:
step H1 is performed: initialization of the system state f00, lf 122, and a task completion time set F0-lf } - {0,122 }; the remaining available amount of renewable resources corresponding to each completion time in F is:
Figure BDA0002311326640000271
Figure BDA0002311326640000272
δ=1;
step H2 is performed: fetch task j equals gJ+δ=g193, and the mode m employed is g3=1;
Step H3 is performed: calculating the completion time of task 3; i.e. step H3.1: let start time s of task 33=rt3=f00,1 is given as flag; step H3.2 is performed: where F is ═ F0And if is greater than or equal to rt is found in {0,122}30, the composition set TF {0,122 }; step H3.3 is performed: taking the element with the smallest value from TF {0,122}, wherein the element is 0, and then TF {122 }; step H3.4 is performed: due to 0-s3=0<d3,1Go to step H3.5, 8; step H3.5 is performed: since flag is 1 at this time, go directly to step H3.6; step H3.6 is performed: due to the fact that
Figure BDA0002311326640000273
Figure BDA0002311326640000274
At time 0, the remaining available amount of all renewable resources meets the requirements of task 3, so the process goes directly to step H3.3; step H3.3 is performed: take one value from TF {122}The smallest element, which is 122, then
Figure BDA0002311326640000275
Step H3.4 is performed: since flag is 1 and 122-s3=122>d3,1Go to step H3.7, 8; step H3.7 is performed: f. of3=s3+d3,1=0+8=8;
Step H4 is performed: due to the fact that
Figure BDA0002311326640000276
Then F ═ F0,f3And if is 0,8,122, f is increased3The remaining available amount of resources can be updated at time 8:
Figure BDA0002311326640000277
step H5 is performed: update [ s ]3,f3) 1, [0,8) remaining available amount of renewable resource during the time period:
Figure BDA0002311326640000278
step H6 is performed: if δ is 1+1 — 2, go to step H2, since δ is 2 ≦ J ≦ 18;
step H2 is performed: fetch task j equals g18+2=g201, and the mode m employed is g1=2;
Step H3 is performed: calculating the completion time of task 1; i.e. step H3.1: let start time s of task 11=rt1=f00,1 is given as flag; step H3.2 is performed: where F is ═ F0,f3In {0,8,122}, rt or more is found10, the composition set TF ═ {0,8,122 }; step H3.3 is performed: taking the element with the smallest value from TF {0,8,122}, wherein the element is 0, and then TF {8,122 }; step H3.4 is performed: due to 0-s1=0<d1,2Go to step H3.5, No. 3; step H3.5 is performed: since flag is 1 at this time, go directly to step H3.6; step H3.6 is performed: due to the fact that
Figure BDA0002311326640000281
Figure BDA0002311326640000282
At time 0, the remaining available amount of all renewable resources meets the requirement of task 1, so the process directly goes to step H3.3; step H3.3 is performed: taking the element with the smallest value from TF {8,122}, wherein the element is 8, and then TF {122 }; step H3.4 is performed: since flag is 1 and 8-s1=8>d1,2Go to step H3.7, No. 3; step H3.7 is performed: f. of1=s1+d1,2=0+3=3;
Step H4 is performed: due to the fact that
Figure BDA0002311326640000283
Then F ═ F0,f1,f3And if is {0,3,8,122}, increasing f1The remaining available amount of resources can be updated at time 3:
Figure BDA0002311326640000284
step H5 is performed: update [ s ]1,f1) 1, [0,3) remaining available amount of renewable resource during the time period:
Figure BDA0002311326640000285
step H6 is performed: if δ 2+1 is 3, go to step H2, since δ 3 ≦ J is 18;
step H2 is performed: fetch task j equals g18+3=g212, and the mode m employed is g2=2;
Step H3 is performed: calculating the completion time of task 2; i.e. step H3.1: let start time s of task 22=rt2=f00,1 is given as flag; step H3.2 is performed: where F is ═ F0,f1,f3Where rt is equal to or greater than f, found from {0,3,8,122}30, the composition set TF ═ {0,3,8,122 }; step H3.3 is performed: taking the element with the smallest value from TF {0,3,8,122}, and taking the element with the smallest value as 0, then TF ═ {3,8,122 }; step H3.4 is performed: due to 0-s2=0<d2,2Go to step H3.5, 8; step H3.5 is performed: since flag is 1 at this time, go directly to step H3.6; step H3.6 is performed: due to the fact that
Figure BDA0002311326640000286
That is, at time 0, the remaining available amount of renewable resource 1 cannot meet the requirement of task 2, if flag is equal to 0, go to step H3.3; step H3.3 is performed: taking the element with the smallest value from TF {3,8,122}, wherein the element is 3, and then TF {8,122 }; step H3.4 is performed: since flag is 0, go to step H3.5; step H3.5 is performed: since flag is equal to 0, s is23,1 is flag; step H3.6 is performed: due to the fact that
Figure BDA0002311326640000287
3, the residual available quantity of all renewable resources meets the requirement of the task 2, so the step H3.3 is directly carried out; step H3.3 is performed: taking the element with the smallest value from TF {8,122}, wherein the element is 8, and then TF {122 }; step H3.4 is performed: due to 8-s2=5<d2,2Go to step H3.5, 8; step H3.5 is performed: since flag is 1 at this time, go directly to step H3.6; step H3.6 is performed: due to the fact that
Figure BDA0002311326640000291
At time 8, the residual available amount of all renewable resources meets the requirement of the task 2, so the step H3.3 is directly carried out; step H3.3 is performed: if the element with the smallest value is 122 out of TF 122, then
Figure BDA0002311326640000292
Step H3.4 is performed: since flag is 1 and 122-s1=119>d2,2Go to step H3.7, 8; step H3.7 is performed: f. of2=s2+d2,2=3+8=11;
Step H4 is performed: due to the fact that
Figure BDA0002311326640000293
Then F ═ F0,f1,f3,f2And if is {0,3,8,11,122}, is increasedf2The remaining available amount of resources can be updated at time 11:
Figure BDA0002311326640000294
step H5 is performed: update [ s ]2,f2) Remaining available amount of renewable resources in [3,11) time period:
Figure BDA0002311326640000295
Figure BDA0002311326640000296
step H6 is performed: if δ is 3+1 — 4, go to step H2, since δ is 4 ≦ J ≦ 18;
……
step H2 to step H6 are repeated until δ 19 > J18, and go to step H7;
step H7 is performed: obtaining completion times for all tasks: f'1=3,f′2=11,f′3=8,f′4=11,f′5=17,f′6=14,f′7=24,f′8=44,f′9=49,f′10=18,f′11=58,f′12=37,f′13=29,f′14=49,f′15=45,f′16=52,f′17=61,f′1860; calculating the fitness value: due to the fact that
Figure BDA0002311326640000297
That is, the subject is a viable subject, whose fitness value is fit'6=ms′6=max{f′16,f′17,f′18The operation ends 61.
Similarly, other individuals in the new population become:
ch′1={2,2,1,1,1,2,1,2,1,1,1,1,3,1,3,1,3,1;3,1,2,4,6,10,5,7,13,8,12,15,9,14,11,17,16,18};
ch′2={2,2,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;1,2,3,5,4,6,13,7,8,15,10,9,14,16,12,17,11,18};
ch′3={2,3,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;2,3,1,6,5,4,13,7,8,15,10,12,9,14,16,17,11,18};
ch′4={2,2,1,1,1,2,1,1,3,1,1,1,1,1,3,1,3,1;1,2,3,5,4,13,7,6,8,15,10,12,9,14,16,17,11,18};
ch′5={2,2,1,1,1,2,1,1,1,1,1,1,3,1,3,1,3,1;1,3,2,6,5,4,13,7,10,8,12,15,14,9,16,17,11,18};
ch′6={2,2,1,3,1,2,1,1,3,1,1,2,1,1,1,1,3,1;1,3,2,6,4,5,10,13,12,7,8,9,15,14,16,17,11,18};
ch′7={2,2,1,1,1,1,1,1,2,1,1,2,3,1,1,2,1,2;2,3,1,6,5,4,10,13,12,7,8,14,9,15,11,16,17,18};
ch′8={1,1,1,1,1,1,1,1,3,1,1,1,3,1,3,2,3,1;1,3,2,6,5,4,13,7,8,15,10,12,9,14,16,17,11,18};
ch′9={2,2,1,1,1,1,2,1,2,1,1,1,3,1,1,2,1,2;3,1,2,6,5,4,7,10,13,12,8,14,15,9,11,16,17,18};
ch′10={2,2,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1;1,3,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18};
the fitness values are respectively as follows: fist'1=54,fit′2=55,fit′3=53,fit′4=55,fit′5=55,fit′6=52,fit′7=57,fit′8=57,fit′9=57,fit′10=58。
And step 12 is executed: selecting N different individuals from the current generation population and the new population from good to bad to form a new current generation population;
selecting the ch of the current generation population from good to bad according to the fitness value1,ch5,ch8,ch9And ch 'of the New population'1,ch′2,ch′3,ch′4,ch′5,ch′6Forming the next generation of population, i.e. GP ═ ch1,ch5,ch8,ch9,ch′1,ch′2,ch′3,ch′4,ch′5,ch′6};
Let CP be GP; the contemporary population becomes:
ch1={2,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,3,1;3,1,2,4,6,5,13,7,10,12,8,15,9,14,16,11,17,18};
ch2={2,2,1,1,1,2,1,1,3,1,1,1,3,1,3,1,3,1;3,1,2,4,6,5,7,13,10,8,12,15,14,9,16,11,17,18};
ch3={2,2,1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1;3,1,2,4,5,6,7,13,10,8,12,15,9,14,11,17,16,18};
ch4={1,2,1,1,1,1,1,1,2,1,1,1,3,1,1,2,1,2;1,3,2,6,5,4,7,10,13,12,8,14,15,9,11,16,17,18};
ch5={2,2,1,1,1,2,1,2,1,1,1,1,3,1,3,1,3,1;3,1,2,4,6,10,5,7,13,8,12,15,9,14,11,17,16,18};
ch6={2,2,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;1,2,3,5,4,6,13,7,8,15,10,9,14,16,12,17,11,18};
ch7={2,3,1,1,1,1,1,1,3,1,1,1,3,1,3,1,3,1;2,3,1,6,5,4,13,7,8,15,10,12,9,14,16,17,11,18};
ch8={2,2,1,1,1,2,1,1,3,1,1,1,1,1,3,1,3,1;1,2,3,5,4,13,7,6,8,15,10,12,9,14,16,17,11,18};
ch9={2,2,1,1,1,2,1,1,1,1,1,1,3,1,3,1,3,1;1,3,2,6,5,4,13,7,10,8,12,15,14,9,16,17,11,18};
ch10={2,2,1,3,1,2,1,1,3,1,1,2,1,1,1,1,3,1;1,3,2,6,4,5,10,13,12,7,8,9,15,14,16,17,11,18};
the fitness values are respectively fit1=53,fit2=52,fit3=54,fit4=55,fit5=54,fit6=55,fit7=53,fit8=55,fit9=55,fit10=52;
And step 13 is executed: judging whether a second-stage evolution termination condition is met, if so, turning to a step 14, otherwise, turning to a step 10;
the second stage evolution termination condition is set as population evolution TG215 generation;
since the current population has evolved only one generation in the second stage and does not satisfy the second stage iteration termination condition, go to step 10.
……
Thus, steps 10 to 13 are repeated, and after 15 generations of second stage iteration, the contemporary population becomes:
ch1={1,2,1,1,1,1,1,1,1,1,1,1,3,3,1,2,3,1;1,3,2,4,6,5,7,10,13,8,12,14,15,9,11,17,16,18};
ch2={2,2,1,1,1,2,1,1,3,1,1,1,3,3,1,1,3,1;3,1,2,6,4,5,10,7,13,8,12,9,15,14,16,11,17,18};
ch3={2,2,1,1,1,2,1,1,1,3,1,1,3,3,2,2,3,1;1,3,2,6,5,4,13,7,8,10,12,14,9,15,17,11,16,18};
ch4={2,2,1,1,1,2,1,1,1,1,1,2,3,3,1,2,3,1;1,3,2,6,5,4,13,7,8,14,10,12,9,15,17,11,16,18};
ch5={1,2,1,1,1,1,1,1,1,1,1,1,3,3,1,2,1,2;1,3,2,6,5,4,7,10,13,8,12,14,15,9,11,16,17,18};
ch6={2,2,1,1,1,2,1,1,1,1,1,1,3,3,2,2,1,2;3,1,2,6,5,4,7,10,13,8,12,14,9,15,11,16,17,18};
ch7={2,2,1,1,1,2,1,1,1,1,1,1,3,3,2,2,3,1;3,1,2,4,6,5,7,10,13,8,12,14,9,15,11,17,16,18};
ch8={2,2,1,1,1,2,1,1,1,1,1,1,3,3,2,2,3,1;3,1,2,6,5,4,7,10,13,8,12,14,9,15,11,17,16,18};
ch9={2,2,1,1,1,1,1,1,3,1,1,1,3,3,1,1,3,1;3,1,2,5,4,6,10,7,13,8,12,9,15,14,16,11,17,18};
ch10={1,2,1,1,1,1,1,1,1,1,1,1,3,3,1,2,1,2;1,3,2,4,6,5,7,10,13,8,12,14,15,9,11,16,17,18};
the fitness values are respectively as follows: fit1=53,fit2=49,fit3=49,fit4=48,fit5=54,fit6=52,fit7=51,fit8=50,fit9=51,fit10=55;
Since the population in the second stage is evolved for 15 generations, and the termination condition of the second stage evolution is satisfied, the second stage evolution is ended, and the step 14 is carried out.
And step 14 is executed: if the optimal individual in the contemporary population is a feasible individual, outputting a scheduling scheme corresponding to the optimal individual and the project execution time thereof
Figure BDA0002311326640000311
Otherwise the problem has no feasible scheduling scheme;
the best individual in the contemporary population is
ch42,2,1,1,1,2,1,1,1,1, 2,3,3,1,2,3, 1; 1,3,2,6,5,4,13,7,8,14,10,12,9,15,17,11,16,18}, which are feasible individuals, with an item execution time ms equal to 48, and the corresponding scheduling scheme is shown in table 6.
Figure BDA0002311326640000321
TABLE 6
The above embodiments are only preferred embodiments of the present invention, and are not intended to limit the technical solutions of the present invention, so long as the technical solutions can be realized on the basis of the above embodiments without creative efforts, which should be considered to fall within the protection scope of the patent of the present invention.

Claims (3)

1. A multi-mode resource-limited project scheduling optimization method adopting a two-stage genetic algorithm is characterized by comprising the following steps of: the method comprises the following steps:
step 1: formalizing a multi-mode resource limited project scheduling problem and acquiring information required by scheduling optimization;
acquiring a project task set T ═ T0,t1,...,tJ,tJ+1}; wherein t isjIndicating task j, i.e. task numbered j, t0And tJ+1Is a virtual task artificially increased, namely, the project period and the resources are not occupied, J is the requirementThe actual number of tasks to be scheduled;
obtaining the time sequence relation between tasks, namely a parent task set PR of the task jjAnd a set of subtasks SCjTask j at its parent task j-∈PRjCannot be started until all the completion, J is 0,1, …, J +1, t0Without a parent task, i.e.
Figure FDA0002311326630000011
tJ+1Without subtasks, i.e.
Figure FDA0002311326630000012
Obtaining the usable quantity R of renewable resources k at any timekK is 1, …, K is the renewable resource type number; acquiring the available quantity N of the non-updatable resource l in the whole project periodlL ═ 1, …, L is the number of non-updateable resource types;
acquiring the time needed by the task j to execute in the mode m, namely the construction period dj,mAnd the number r of occupied renewable resources kj,m,kThe number n of non-updatable resources lj,m,l;j=1,…,J,m=1,…,MjK1, …, K, L1, …, L, wherein M isjIs the number of modes available for task j to choose to employ;
step 2: if there is an un-updateable resource/satisfy
Figure FDA0002311326630000013
Or that there is one task j and renewable resources k satisfying
Figure FDA0002311326630000014
Then the problem has no feasible scheduling scheme, the solution is finished, otherwise, the step 3 is switched to;
and step 3: carrying out pretreatment: carrying out redundancy and invalidation check on the mode and the resource, and removing the redundancy mode, the invalidation mode and the redundancy resource;
step 3.1: let the pattern flag value mflg ═ 0, resource flag value rflg ═ 0; if r is presentj,m,k>RkOr nj,m,l>NlThen mode m is invalid for task j, removing mode m in task j: order to
Figure FDA0002311326630000015
Figure FDA0002311326630000016
Wherein:
Figure FDA0002311326630000017
k1, …, K, L1, …, L; let Mj=Mj-1;
Step 3.2: if mflg is equal to 0, then let mflg be equal to 1, go to step 3.3; otherwise go to step 3.4;
step 3.3: if there is task j, patterns m and m' satisfy: dj,m′≤dj,m,rj,m′,k≤rj,m,k,nj,m′,l≤nj,m,lM' ≠ m, K ≠ 1, …, K, L ═ 1, …, L; then pattern m is redundant for task j, removing pattern m in task j: order to
Figure FDA0002311326630000021
Wherein:
Figure FDA0002311326630000022
k1, …, K, L1, …, L; let Mj=Mj-1,rflg=0;
Step 3.4: if rflg is equal to 0, let rflg be equal to 1, go to step 3.5; otherwise go to step 3.7;
step 3.5: if the renewable resource k satisfies:
Figure FDA0002311326630000023
then the renewable resource is redundant, removing renewable resource k: order to
Figure FDA0002311326630000024
Wherein: j-1, …, J,
Figure FDA0002311326630000025
let K-1, mflg-0;
step 3.6: if the non-updateable resource/satisfies:
Figure FDA0002311326630000026
then the non-updateable resource is redundant, removing non-updateable resource/: order to
Figure FDA0002311326630000027
Wherein: j-1, …, J,
Figure FDA0002311326630000028
let L-1, mflg-0;
step 3.7: if mflg ═ 1 ^ rflg ═ 1, go to step 3.8, otherwise go to step 3.2;
step 3.8: finishing the pretreatment;
and 4, step 4: calculating the hierarchy value of the task:
for a starting task 0 without a parent task, its hierarchy value is:
lvl0=0 (1)
the hierarchy values of other tasks are calculated using the following recursive formula:
Figure FDA0002311326630000029
and 5: initializing a contemporary population;
generating N different individuals by an individual generation method based on the hierarchy and the earliest task completion time to form an initial contemporary population, wherein N is the population scale and is a positive even number;
the individual adopts 2J bit integer coding, and the method comprises the following steps: ch ═ g1,…,gJ;gJ+1,…,g2J}, gene gjIs a positive integer, where g1,…,gJIs the execution mode list, gjIndicating task j adoptionMode (1), gj=1,...,Mj,j=1,…,J;{gJ+1,…,g2JIs a scheduling order list, gJ+1,…,g2JIs an arrangement of 1, …, J and satisfies the timing constraint of a task, i.e. no task can be placed in front of its parent, gJ+jIndicating the jth scheduled task, i.e. task gJ+jIs jth scheduled;
the individual generation method based on the hierarchy and the earliest task completion time comprises the following steps:
step A1: randomly arranging and dividing t according to task hierarchy value from small to large0And tJ+1Other tasks, i.e., those with smaller hierarchy value in the front of larger hierarchy value and those with the same hierarchy value are arranged randomly to form a gene { g } which is an individual scheduling order listJ+1,…,g2J};
Step A2: individual serial decoding method based on earliest completion time of task generates individual execution mode list namely gene { g1,…,gJObtaining a fitness value fit thereof;
step A3: outputting an individual ch ═ g1,…,gJ,gJ+1,…,g2JFourthly, the operation is finished;
the individual serial decoding method based on the earliest completion time of the task comprises the following steps:
step B1: initializing a system state: order completion time f of task 000, F0Lf, lf representing the latest completion time of the item:
Figure FDA0002311326630000031
the elements in F are arranged from small to large; making a cycle control variable delta equal to 1; let the remaining available amount of the renewable resource corresponding to each completion time in F:
Figure FDA0002311326630000032
Figure FDA0002311326630000033
k=1,…,K;
step B2: fetch task j equals gJ+δLet mode m equal to 1;
step B3: calculating the completion time f of task jjNamely:
step B3.1: let start time of task j
Figure FDA0002311326630000034
Let flag value flag be 1;
step B3.2: finding rt or more in FjAnd form a set TF, i.e., TF ═ { F ∈ F | F ≧ rtj};
Step B3.3: take the element with the smallest value from TF, do not set to fj′
Step B3.4: if flag is 1 and fj′-sj,m≥dj,mThen go to step B3.7; otherwise go to step B3.5;
step B3.5: if flag is equal to 0, let sj,m=fj′,flag=1;
Step B3.6: judgment of fj′At the moment, whether the remaining available amount of all renewable resources meets the requirement of the task j is determined, that is, whether all K is 1, … and K meets the requirement
Figure FDA0002311326630000035
If not, the flag is 0; go to step B3.3;
step B3.7: let fj,m=sj,m+dj,m
Step B3.8: making m equal to m + 1; if M is less than or equal to MjGo to step B3.1, otherwise from
Figure FDA0002311326630000036
Taking out with minimum time of completion
Figure FDA0002311326630000037
Order to
Figure FDA0002311326630000038
Go to step B4;
step B4: if f isjIf F is absent, F is F ∪ { F ═ FjIs increased by fjRemaining available amount of renewable resources at the moment:
Figure FDA0002311326630000041
wherein: f. ofj″Is fjThe previous time of day;
step B5: update [ s ]j,fj) Remaining available amount of renewable resources within the time period:
Figure FDA0002311326630000042
step B6: let δ be δ +1, go to step B2 if δ ≦ J, otherwise go to step B7;
step B7: obtain execution mode list g1,…,gJCalculating the fitness value fit of the individual, and finishing the operation;
wherein:
Figure FDA0002311326630000043
representing the remaining available amount of resource k at time instant tau,
Figure FDA0002311326630000044
indicating the ready time of task j;
step 6: carrying out N/2 times of scheduling sequence cross operation based on the hierarchy on the contemporary population to generate a new population, and carrying out scheduling sequence variation operation based on the hierarchy on each individual in the new population;
the scheduling order list interleaving operation based on the hierarchy comprises the following steps:
step C1: randomly selecting two different individuals from the contemporary population as a father 1 and a father 2 based on a ranking round-robin method;
step C2: randomly selecting a hierarchy without setting to be l;
step C3: exchanging the scheduling sequence of the task of the level l in the scheduling sequence list of the parent 1 and the scheduling sequence list of the parent 2, emptying the execution mode list, generating two children 1 and 2, and finishing the operation;
the hierarchical based scheduling order list mutation operation comprises the following steps:
step D1: generating a random number λ ∈ [0,1) if λ<pmGo to step D2, otherwise go to step D4;
step D2: if the number of tasks in the layer is larger than 1, randomly selecting one of the layers, not setting the layer as l, and going to step D3; otherwise go to step D4;
step D3: randomly selecting two tasks from the layer l, and exchanging the two tasks in a scheduling sequence list;
step D4: finishing the operation of the variation of the scheduling sequence list based on the hierarchy;
wherein: p is a radical ofm∈(0,1]Is the rate of variation;
and 7: generating an individual execution mode list and calculating the fitness value of each individual in the new population by adopting an individual serial decoding method based on the earliest task completion time;
and 8: selecting N different individuals from the current generation population and the new population from good to bad to form a new current generation population;
and step 9: judging whether a first-stage iteration termination condition is met, if so, ending the first-stage evolution, and turning to the step 10, otherwise, turning to the step 6;
the first stage termination condition is that the iteration is carried out to a specified algebraic TG1Or successive iterations GG1No improvement was made for the best individuals; step 10: performing N/2 times of cross operation of the execution mode list and the scheduling sequence list on the contemporary population to generate a new population, and performing variation operation on the execution mode list and the scheduling sequence list on each individual in the new population;
the operation of crossing the execution mode list and the scheduling order list comprises the following steps:
step E1: two different individuals were randomly selected from the contemporary population as father 1 and father 2 based on a ranking round-robin method, which is not set as:
Figure FDA0002311326630000051
the daughter 1 and daughter 2 generated were not:
Figure FDA0002311326630000052
step E2: if it is not
Figure FDA0002311326630000053
And
Figure FDA0002311326630000054
if not, go to step E3, otherwise
Figure FDA0002311326630000055
Figure FDA0002311326630000056
Go to step E8;
step E3: finding out from front to back
Figure FDA0002311326630000057
And
Figure FDA0002311326630000058
position delta of the 1 st different gene of (1)1Finding out from back to front
Figure FDA0002311326630000059
And
Figure FDA00023113266300000510
position delta of the 1 st different gene of (1)2(ii) a If delta1≠δ2Go to step E4, otherwise
Figure FDA00023113266300000511
Go to step E7;
step E4: randomly generating a delta1To delta2-1 isThe integers α;
step E5: ch (channel)c1The first α genes in the execution Pattern List part of (1) were from chp1The first α genes of the execution mode list part of (1), i.e.
Figure FDA00023113266300000512
The last J- α genes of the execution Pattern List part were from chp2The last J- α genes of the execution mode list part of (1), i.e.
Figure FDA00023113266300000513
Step E6: ch (channel)c2The first α genes in the execution Pattern List part of (1) were from chp2The first α genes of the execution mode list part of (1), i.e.
Figure FDA00023113266300000514
The last J- α genes of the execution Pattern List part were from chp1The last J- α genes of the execution mode list part of (1), i.e.
Figure FDA00023113266300000515
Step E7: if it is not
Figure FDA00023113266300000516
And
Figure FDA00023113266300000517
if not, go to step E8; otherwise
Figure FDA00023113266300000518
Figure FDA00023113266300000519
Go to step E12;
step E8: finding out from front to back
Figure FDA00023113266300000520
And
Figure FDA00023113266300000521
position delta of the 1 st different gene of (1)3From the back to the front
Figure FDA00023113266300000522
And
Figure FDA00023113266300000523
position delta of the 1 st different gene of (1)4
Step E9: randomly generating a delta3To delta4-a positive integer β of 1;
step E10: ch (channel)c1The first β genes in the dispatch order list from chp1The first β genes of the scheduling order list, i.e.
Figure FDA00023113266300000524
The last J- β genes are from chp2Scheduling order list of
Figure FDA00023113266300000525
Mid-delete chp1The first β genes of the scheduling order list of
Figure FDA00023113266300000526
The latter gene list;
step E11: ch (channel)c2The first β genes in the dispatch order list from chp2The first β genes of the scheduling order list, i.e.
Figure FDA0002311326630000061
The last J- β genes are from chp1Scheduling order list of
Figure FDA0002311326630000062
Mid-delete chp2The first β genes of the scheduling order list of
Figure FDA0002311326630000063
The latter gene list;
step E12: to obtain
Figure FDA0002311326630000064
Finishing the cross operation;
the execution mode list and scheduling order list mutation operation comprises the following steps:
step F1: generating a random number lambda1E [0,1), if λ1<pmGo to step F2; otherwise go to step F3;
step F2: from the execution mode list g1,…,gJRandomly selecting one gene, not setting as gjJ is 1, …, J, and if m is not set, g is the execution mode selected for task J again randomlyj=m;
Step F3: generating a random number lambda2E [0,1), if λ2<pmGo to step F4; otherwise go to step F5;
step F4: from the scheduling order list gJ+1,…,g2JRandomly selecting one gene, not setting as gjJ +1, …,2J if task gjThere is a parent task other than task 0, then from gjBegin finding the first parent g aheadj′Let the position value pos1J' +1, otherwise let pos1J + 1; if task gjThere are subtasks other than task J +1, then from gjStarting to find the first subtask g backwardsj″Let the position value pos2J "-1, otherwise let pos22J; in [ pos ]1,pos2]Randomly selects a position to insert gj
Step F5: finishing the mutation operation;
step 11: improving all individuals in the new population by adopting an FBI & D method and calculating the fitness value of the individuals;
the FBI & D method comprises the steps of:
step G1: making a counting variable theta equal to 1; performing serial individual decoding based on insertion mode on individual ch to obtain all task completion time fjAnd its fitness value fit;
step G2: changing task 0 into task J +1 and task J +1 into task 0, reversing the time sequence relationship between tasks, i.e. changing the father task set of tasks into the son task set, changing the son task set into the father task set, and according to the task completion time f, the scheduling sequence list in individual chjRearranging from large to small, i.e. g genes in individualsJ+jSet to the jth last completed task, J1, …, J, forming an individual
Figure FDA0002311326630000065
Step G3: let theta be theta +1, for individual
Figure FDA0002311326630000066
Performing serial individual decoding based on insertion mode to obtain completion time of all tasks
Figure FDA0002311326630000067
And its fitness value
Figure FDA0002311326630000068
Step G4: if it is
Figure FDA0002311326630000069
Then
Figure FDA00023113266300000610
Go to step G2, otherwise go to step G5;
step G5: if theta is even number, then output individual ch, otherwise output individual ch
Figure FDA0002311326630000071
The fitness value fit is obtained, and the operation is finished;
the serial individual decoding based on the insertion mode includes the steps of:
step H1: initializing a system state: order completion time f of task 000, F0Lf, the elements in F are arranged from small to large; making a cycle control variable delta equal to 1; let the remaining available amount of the renewable resource corresponding to each completion time in F:
Figure FDA0002311326630000072
step H2: fetch task j equals gJ+δAnd the mode m ═ g adopted by itj
Step H3: calculating the completion time of task j
Figure FDA0002311326630000073
Namely:
step H3.1: let start time s of task jj=rtjLet flag value flag be 1;
step H3.2: finding rt or more in FjAnd form a set TF, i.e., TF ═ { F ∈ F | F ≧ rtj};
Step H3.3: take the element with the smallest value from TF, do not set to fj′
Step H3.4: if flag is 1 and fj′-sj≥dj,mThen go to step H3.7; otherwise go to step H3.5;
step H3.5: if flag is equal to 0, let sj=fj′,flag=1;
Step H3.6: judgment of fj′At the moment, whether the remaining available amount of all renewable resources meets the requirement of the task j is determined, that is, whether all K is 1, … and K meets the requirement
Figure FDA0002311326630000074
If not, if the flag is 0, the step goes to a step H3.3;
step H3.7: let fj=sj+dj,m
Step H4: if f isjIf F is absent, F is F ∪ { F ═ FjIs increased by fjRemaining available amount of renewable resources at the moment:
Figure FDA0002311326630000075
wherein: f. ofj″Is fjThe previous time of day;
step H5: update [ s ]j,fj) Remaining available amount of renewable resources within the time period:
Figure FDA0002311326630000076
step H6: let δ be δ +1, go to step H2 if δ ≦ J, otherwise go to step H7;
step H7: obtaining all task completion times fj(ii) a Calculating the fitness value fit of the target, and finishing the operation;
step 12: selecting N different individuals from the current generation population and the new population from good to bad to form a new current generation population;
step 13: judging whether a second-stage evolution termination condition is met, if so, turning to a step 14, otherwise, turning to a step 10;
the second stage termination condition is that the iteration is carried out to a specified algebraic TG2Or successive iterations GG2No improvement was made for the best individuals;
step 14: if the optimal individual in the contemporary population is a feasible individual, outputting a scheduling scheme corresponding to the optimal individual and the project execution time thereof
Figure FDA0002311326630000081
Otherwise the problem has no feasible scheduling scheme.
2. The method for scheduling and optimizing the multi-mode resource-constrained project by using the two-stage genetic algorithm as claimed in claim 1, wherein: the specific calculation method of the fitness value fit is as follows: if the individual is an infeasible individual, i.e., presentOne non-updatable resource, < i > satisfy >
Figure FDA0002311326630000082
Then let the individual fitness value fit be lf + ms, otherwise let the individual fitness value fit be ms, where:
Figure FDA0002311326630000083
executing time for the project;
the smaller the fitness value fit, the better the individual.
3. The method for scheduling and optimizing the multi-mode resource-constrained project by using the two-stage genetic algorithm as claimed in claim 1, wherein: the specific steps of randomly selecting two different individuals from the contemporary population as the father 1 and the father 2 based on the sorted round-robin in the steps C1 and E1 are as follows:
step I1: sequencing the individuals in the contemporary population according to the priority to obtain the sequencing value rk of the individual nnN is 1, …, N, where the first row takes 1, the second row takes 2, and so on, and the last row takes N;
step I2: calculating the probability that the individual n is selected
Figure FDA0002311326630000084
R>1 is a discrimination coefficient;
step I3: calculating the cumulative probability:
Figure FDA0002311326630000085
step I4: generating a random number lambda1E [0,1) if
Figure FDA0002311326630000086
Then individual n is selected as father 1;
step I5: generating a random number lambda2E [0,1) if
Figure FDA0002311326630000087
And n '≠ n, then individual n' is selected as parent 2, proceeding to step I6, otherwise to step I5;
step I6: the individual selection operation ends.
CN201911259880.3A 2019-12-10 2019-12-10 Multi-mode resource-limited project scheduling optimization method adopting two-stage genetic algorithm Active CN110991917B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911259880.3A CN110991917B (en) 2019-12-10 2019-12-10 Multi-mode resource-limited project scheduling optimization method adopting two-stage genetic algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911259880.3A CN110991917B (en) 2019-12-10 2019-12-10 Multi-mode resource-limited project scheduling optimization method adopting two-stage genetic algorithm

Publications (2)

Publication Number Publication Date
CN110991917A true CN110991917A (en) 2020-04-10
CN110991917B CN110991917B (en) 2022-07-15

Family

ID=70091970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911259880.3A Active CN110991917B (en) 2019-12-10 2019-12-10 Multi-mode resource-limited project scheduling optimization method adopting two-stage genetic algorithm

Country Status (1)

Country Link
CN (1) CN110991917B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113469412A (en) * 2021-06-02 2021-10-01 国核电力规划设计研究院有限公司 Real-time operation strategy optimization method and system for comprehensive energy system
CN113721545A (en) * 2021-09-02 2021-11-30 内蒙古第一机械集团股份有限公司 Production scheduling method for mixed flow shop with batch processing machine

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945510A (en) * 2012-10-23 2013-02-27 西安理工大学 Effective method for solving complex resource-constrained project scheduling problem
CN104217293A (en) * 2014-09-04 2014-12-17 西安理工大学 Effective method for solving multi-target resource-constrained project scheduling
CN107274124A (en) * 2017-06-06 2017-10-20 泉州装备制造研究所 A kind of AGV vehicle dispatching optimization methods based on two benches multi-Population Parallel Genetic Algorithm
CN108388508A (en) * 2018-01-29 2018-08-10 华南理工大学 A kind of test cases selection method based on user conversation and hierarchical clustering algorithm
CN108846570A (en) * 2018-06-08 2018-11-20 武汉理工大学 A method of solving resource constrained project scheduling problem
CN109190857A (en) * 2018-10-30 2019-01-11 武汉大学 A kind of optimization algorithm based on multiple target Resource-constrained Project Scheduling Problem model

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945510A (en) * 2012-10-23 2013-02-27 西安理工大学 Effective method for solving complex resource-constrained project scheduling problem
CN104217293A (en) * 2014-09-04 2014-12-17 西安理工大学 Effective method for solving multi-target resource-constrained project scheduling
CN107274124A (en) * 2017-06-06 2017-10-20 泉州装备制造研究所 A kind of AGV vehicle dispatching optimization methods based on two benches multi-Population Parallel Genetic Algorithm
CN108388508A (en) * 2018-01-29 2018-08-10 华南理工大学 A kind of test cases selection method based on user conversation and hierarchical clustering algorithm
CN108846570A (en) * 2018-06-08 2018-11-20 武汉理工大学 A method of solving resource constrained project scheduling problem
CN109190857A (en) * 2018-10-30 2019-01-11 武汉大学 A kind of optimization algorithm based on multiple target Resource-constrained Project Scheduling Problem model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王丽霞: "组织进化算法在多模态资源受限项目调度中的应用", 《万方学位论文库》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113469412A (en) * 2021-06-02 2021-10-01 国核电力规划设计研究院有限公司 Real-time operation strategy optimization method and system for comprehensive energy system
CN113469412B (en) * 2021-06-02 2024-04-09 国核电力规划设计研究院有限公司 Real-time operation strategy optimization method and system for comprehensive energy system
CN113721545A (en) * 2021-09-02 2021-11-30 内蒙古第一机械集团股份有限公司 Production scheduling method for mixed flow shop with batch processing machine
CN113721545B (en) * 2021-09-02 2024-02-23 内蒙古第一机械集团股份有限公司 Production scheduling method for mixed flow shop with batch processor

Also Published As

Publication number Publication date
CN110991917B (en) 2022-07-15

Similar Documents

Publication Publication Date Title
CN111126800B (en) Multi-mode resource-limited project scheduling method using layered self-adaptive intelligent algorithm
CN109190857B (en) Optimization algorithm based on multi-target resource limited project scheduling model
Shen et al. Mathematical modeling and multi-objective evolutionary algorithms applied to dynamic flexible job shop scheduling problems
CN105629927A (en) Hybrid genetic algorithm-based MES (Manufacturing Execution System) production planning and scheduling method
CN110991917B (en) Multi-mode resource-limited project scheduling optimization method adopting two-stage genetic algorithm
CN110738365B (en) Flexible job shop production scheduling method based on particle swarm algorithm
CN110458326B (en) Mixed group intelligent optimization method for distributed blocking type pipeline scheduling
CN111008745A (en) Multi-mode resource-limited project scheduling optimization method based on hybrid heuristic and intelligent algorithms
CN116027753A (en) Multi-target mixed flow shop scheduling method and system
CN111026534B (en) Workflow execution optimization method based on multiple group genetic algorithms in cloud computing environment
CN110928648B (en) Heuristic and intelligent computing-fused cloud workflow segmentation online scheduling optimization method
CN111090510A (en) Two-stage cloud workflow scheduling optimization method based on hybrid heuristic algorithm and genetic algorithm
CN110942209B (en) Resource-constrained project scheduling optimization method based on hierarchical two-stage intelligent algorithm
CN111027856B (en) Multimode resource-constrained project scheduling method based on two-dimensional multi-population genetic algorithm
CN110928670B (en) Workflow optimization method based on partial sequence adaptive genetic algorithm in cloud computing environment
CN111062528A (en) Multi-mode resource-limited project scheduling optimization method based on multi-decoding intelligent algorithm
CN110689216B (en) Robot assembly unit mixed product JIT energy-saving production optimization method based on mixed fruit fly algorithm
CN110928671B (en) Cloud workflow scheduling optimization method based on hierarchy and load balancing genetic algorithm
CN111047183A (en) Cloud workflow scheduling optimization method based on layered self-adaptive intelligent computing algorithm
CN111026533A (en) Workflow execution optimization method based on distributed estimation algorithm in cloud computing environment
CN113220437A (en) Workflow multi-target scheduling method and device
CN110941487B (en) Workflow scheduling optimization method based on multi-stage genetic algorithm in cloud computing environment
CN111078361A (en) Cloud workflow scheduling optimization method based on distributed estimation algorithm
CN110968428A (en) Cloud workflow virtual machine configuration and task scheduling collaborative optimization method
CN117610867A (en) Unmanned cluster multi-sensor task allocation scheduling optimization method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant