You are on page 1of 9

Engineering optimzation project

FACULTY:

DR. RAGHUNATHAN.T

Members:

B.NAVEEN (17BEE0257)

G.ANURAG (17BEE0123)
Acknowledgement

It is our pleasure to complete Job shop scheduling project with the


guidance of our project incharge and course professor Dr.Raghunathan.T who is
with us to give his valuable and years of experienced input on our project. Job
shop scheduling by genetic algorithm is a project which we feel honored to
complete and contribute our ideas and input in the way of development.

Aim:
To determine the optimum sequence for the desired task to reduce the
maximum time of completion.

Introduction:

The job-shop scheduling problem (JSSP) is a very important practical problem.


Efficient methods of solving it can have major effects on profit ability and product
quality, but with the JSSP being among the worst members of the class of
NPcomplete problems (Gary & Johnson 1979) there remains much room for
improvement in current techniques. In general, the difficulty of the general JSSP
makes it very hard for conventional search-based methods to find near-optima in
reasonable time. This has led to recent interest in using genetic algorithms (GAs)

Inspiration :

Genetic algorithm work with a population composed of


individuals. The genetic structure of a biological individual is composed of several
chromosomes. Each of these chromosomes is composed of several genes each of
which consists of a number of alleles. In combinatorial optimization, an individual
is usually identified with a chromosome. A chromosome is further split into a
number of genes (in some papers a gene is also identified with an allele). Before
applying a genetic algorithm to scheduling problems, an appropriate encoding (or
representation) of the solution must be introduced.

Working:
In the general JSSP, there are j jobs and m machines; each job comprises a set of
tasks1 which must each be done on a different machine for different specified
processing times, in a given job-dependent order. A legal schedule is a schedule of
job sequences on each machine such that each job's task order is preserved, a
machine is not processing two different jobs at once, and different tasks of the
same job are not simultaneously being processed on different machines. The
problem is to minimise the total elapsed time between the beginning of the first
task and the completion of the last task (the makespan). Other measures of
schedule quality exist, but shortest makespan is the simplest and most widely
used criterion

Matlab code:

pop=100; %total population always


gen=100; %total generations n=15;
%no of jobs
%initpop=zeros(pop,n); %initial population
%pop_fitness=zeros(pop,1); %population fitness matrix
%pop_fitness_sorted=zeros(pop,1); %for sorted fitness
%fitness_temp=0; %fitness temporary variable used in fitness
loops between k and j for i=1:pop x(i,:)=randperm(n); %random initial
population --indicates queen position on board end; %counter=0;
%for i=1:100
% counter=counter+1;
% f(counter,:)=evaluate_objective(x(i,:));
% format shortg;
%end
%for i=1:100
% x(:,16)=f(:,1);
%end
%for i=1:100
% x(:,17)=f(:,2);
%end
%M=2;
%V=15;
%non_domination_sort_mod(x,M,V);

%actual_pop=initpop; %duplication for working on this variable


and keeping initial population intact

%generations loop pop=(pop/2);


for q=1:gen

%selection

for i=1:pop
cross_over_temp_mat(i,:)=x(i,:); end
cross_over_ready_pop=repmat(cross_over_temp_mat,2,1);
cross_over_pop_final=cross_over_ready_pop;

%cross over part begins


%for detail explaination cross over logic refer to the pdf attached
%logic---get random crossover point--then cross over at that point
%if two same values of rows in one individual..then adjust crossover
%according to the logic give in the pdf
while 1,
cross_over_point=floor(n*rand(1)); if
cross_over_point~=0
break;
end end

i=1; while
i<(pop-1),

cross_over_pop_temp_one(1,:)=cross_over_ready_pop(i,:); %copied
parents cross_over_pop_temp_two(1,:)=cross_over_ready_pop(i+1,:);
%copied parents
%for child one for
j=1:cross_over_point
for k=j:n
if (cross_over_pop_temp_one(1,j)==cross_over_pop_temp_two(1,k))
cross_over_pop_temp_adjust=cross_over_pop_temp_two(1,j);
cross_over_pop_temp_two(1,j)=cross_over_pop_temp_two(1,k);
cross_over_pop_temp_two(1,k)=cross_over_pop_temp_adjust; break;
end end end for j=1:cross_over_point
cross_over_child_one(1,j)=cross_over_pop_temp_one(1,j);
end for j=cross_over_point:n
cross_over_child_one(1,j)=cross_over_pop_temp_two(1,j);
end

%for child two


cross_over_pop_temp_two(1,:)=cross_over_ready_pop(i,:); %copied
parents cross_over_pop_temp_one(1,:)=cross_over_ready_pop(i+1,:);
%copied parents

for j=1:cross_over_point
for k=j:n
if (cross_over_pop_temp_one(1,j)==cross_over_pop_temp_two(1,k))
cross_over_pop_temp_adjust=cross_over_pop_temp_two(1,j);
cross_over_pop_temp_two(1,j)=cross_over_pop_temp_two(1,k);
cross_over_pop_temp_two(1,k)=cross_over_pop_temp_adjust;
break; end end end for j=1:cross_over_point
cross_over_child_two(1,j)=cross_over_pop_temp_one(1,j);
end for j=cross_over_point:n
cross_over_child_two(1,j)=cross_over_pop_temp_two(1,j);
end

cross_over_pop_final(i,:)=cross_over_child_one(1,:);
cross_over_child_two_flipped=wrev(cross_over_child_two);
cross_over_pop_final(i+1,:)=cross_over_child_two_flipped(1,:);

i=i+2;
end

%mutation introduced
%mutation occours :at every 5th individual..swapping of two random
% column values(that is queen positions)

%Any individual can change the mutation probability by simply changing


%the value. i=n; while i<pop,
mutation_temp_one=floor(rand(1)*n/2);
mutation_temp_two=floor(2*(rand(1)*n/2)); if
(mutation_temp_one==0 || mutation_temp_two==0) continue;
else
mutation_temp_data=cross_over_pop_final(i,mutation_temp_one);

cross_over_pop_final(i,mutation_temp_one)=cross_over_pop_final(i,mutation_te
mp_two);
cross_over_pop_final(i,mutation_temp_two)=mutation_temp_data;
end i=i+5; end i=0;

x=cross_over_pop_final;

end references
:

1. S. Bagchi, S. Uckun, Y. Miyabe, & K. Kawamura (1991). Exploring


problem-speci
c recombination operators for job shop. In R.K. Belew & L.B. Booker
(eds) Proceedings of the Fourth International Conference on Genetic
Algorithms, pages 10{17. San Mateo: Morgan Kaufmann, 1991.

2. D. Beasley, D. R. Bull, & R. R. Martin (1993). Reducing Epistasis in


Combinatorial Problems by Expansive Coding. In S. Forrest (ed),
Genetic Algorithms; Proceedings of the Fifth International
Conference (GA93), Morgan Kaufmann, San Mateo, CA.

3. Genetic algorithm for job shop scheduling by F werner(2013)(short


pdf)

4. Job shop scheduling problems by H l fang (2014) (short pdf)

You might also like