Information Technology Reference
In-Depth Information
In[88]:= DSH BoundaryChecking MatrixForm
Out[88]//MatrixForm=
M4 M6 M3 M8 M3 M10 M7 M1 M4 M5
M2 M4 M8 M5 M5 M2 M7 M10 M10 M4
M8 M1 M2 M1 M6 M7 M9 M3 M3 M7
M7 M3 M9 M3 M6 M9 M2 M7 M8 M9
M4 M2 M8 M5 M7 M1 M5 M1 M2 M4
M6 M2 M9 M4 M1 M9 M2 M6 M6 M5
M9 M6 M7 M4 M6 M5 M9 M9 M10 M5
M3 M5 M9 M2 M7 M4 M9 M4 M10 M5
M9 M8 M6 M4 M9 M3 M5 M1
M4 M8
M2 M2 M4 M4 M9 M7 M6 M4
M5 M4
Fig. 7.31. Discrete Set Output
A discrete set can be created as shown in Fig 7.29.
The DSH function is given in Fig 7.30.
The result of applying the DSH set on the population is given in Fig 7.31.
Such or similar set can be used in other different methods (if needed) like fuzzy
logic etc. Due to the nature of permutative problems, (sequence has to be complete and
unique), the discrete set been set to the same sequence of numbers.
Due to the complex nature of permutative problems, a Local Search routine has been
added to the heuristic. Local search is used to search in the neighbourhood of the current
solutions. Keeping in mind the computational nature of the code, a 2 OPT local search
outine was selected as in Fig 7.32.
LocalSearch Sol :
Module Solution, NewSolution, CostVal, NewCostVal, Temp ,
CostVal Sol 1 ; Solution Sol 2 ; NewCostVal CostVal;
NewSolution Solution;
Label start ; CostVal NewCostVal; NewSolution Solution;
Do Temp Solution i ; Solution i Solution j ;
Solution j Temp;
NewCostVal CostFunction Solution, Prob, Mach ;
If NewCostVal CostVal, Goto start ,
i, Job 1 , j, i 1, Job ;
Solution CostVal, NewSolution ; Return Solution
Fig. 7.32. Local Search routine
The current fitness of the solution is kept in the variable CostVal , and the current
active solution is kept in Solution . The start flag is Label [ st art ].
Two iterators are activated, i , which is the index to the current variable in the solution
and j , which is the iterator from the current position indexed by i till the end of the
solution given as
{
j , i + 1 , Job
}
.
Search WWH ::




Custom Search