and the Universe

The solution of the Machines' Time Scheduling Problem (MTSP) is a hot point of research that is not yet matured, and needs further work. This paper presents two algorithms for the solution of the Machines' Time Scheduling Problem that leads to the best starting time for each machine in each cycle. The first algorithm is genetic-based (GA) (with non- uniform mutation), and the second one is based on particle swarm optimization (PSO) (with constriction factor). A comparative analysis between both algorithms is carried out. It was found that particle swarm optimization gives better penalty cost than GA algorithm and max-separable technique, regarding best starting time for each machine in each cycle.


INTRODUCTION
A great deal of research has been focused on solving scheduling problems.One of the most important scheduling problems is the Machine Time Scheduling Problem (MTSP).This problem was investigated in [1] as a parameterized version of the MTSP, which was defined in [2], with penalized earliness in starting and lateness in the completion of the operation.The authors in [1] applied the optimal choice concept which is given in [3] and some theoretical results from [4] to obtain the optimal values of the given parameters.
In [5] the authors investigated two cycles MTSP and introduced an algorithm to find the optimal choice of parameters, which represent the earliest possible starting time for the second cycle.In [6] an algorithm was developed (MTSP Algorithm (MTSPA)) for multi-cycle MTSP which found the starting time for each machine in each cycle by using the maxseparable technique.
The processing times in the previous researches were deterministic.The authors in [7] discussed how to solve the MTSP when the processing time for each machine is stochastic.To solve this problem, the Monte Carlo simulation was suggested to handle the given stochastic processing times.A generalization was introduced in [8] to overstep the cases at which an empty feasible set of solutions is described by the system.This paper examines two approaches for solving the MTSP; PSO (with constriction factor), and GA (with non-uniform mutation).A comparative analysis between both algorithms is to be carried out for the solution that minimizes the penalty cost regarding the best starting time for each machine in each cycle.
The paper is organized as follows.Part 2 formulates the problem.Part 3 introduces the proposed GA, as well as its implementation.Part 4 presents the PSO Algorithm, and its implementation.Both algorithms, in addition to the maxseparable technique, are applied for a specific scenario.Obtained results are investigated in Part 5.The paper is terminated by conclusions and proposals for future work.

II. PROBLEM FORMULATION
In machines' time scheduling problem there are n machines, each machine carries out one operation j with processing time p j for } ,..
N is the set of precedence machines) had finished their work in the (r-1) th cycle, so we can define the starting time in the (r+1) th cycle as follows: Assuming that the starting time x jr is constrained by a time interval [l jr , L jr ] for each N j , K r , then the set of feasible starting times x jr is described by the following system for each Assume also that for some echological reasons, there are a given recommended time interval [a jr , b jr ], The violation of (2) will be penalized by the following penalty function where the penalty function in a certain cycle r is given by: To minimize the maximum penalty in each cycle r, we should solve the following problem:

A. Using Genetic Algorithm (GA):
GA maintains a set of candidate solutions called population and repeatedly modifies them.At each step, the GA selects individuals from the current population to be parents and uses them to produce the children for the next generation.Candidate solutions are usually represented as strings of fixed length, called chromosomes.A fitness or objective function is used to reflect the goodness of each member of population [9].The principle of genetic algorithms is simple [10]:  Encoding of the problem in a binary string.
 Random generation of a population.This one includes a genetic pool representing a group of possible solutions.
 Reckoning of a fitness value for each subject.It will directly depend on the distance to the optimum.
 Selection of the subjects that will mate according to their share in the population global fitness.
 Genomes crossover and mutations.
 And then start again from point 3.This is repeated until some condition (for example number of populations or improvement of the best solution) is satisfied.
Non-uniform mutation has been used to reduce the disadvantage of random mutation in the real-coded GA [11].This new operator is defined as follows.For each individual  approaches to zero as t increases.This property causes this operator to search the space uniformly initially (when t is small), and very locally at later stages.This strategy increases the probability of generating a new number close to its successor than a random choice.We use the following function: Where r is a uniform random number from [0, 1], T is the maximal generation number, and b is a system parameter determining the degree of dependency on the iteration number.
In [12], the authors introduced a new mutation operator characterized by its non-uniformness.The operator has been used in the parameter optimization of the controllers of a supply ship.Four different kinds of controllers have been considered and optimized, providing a wide range of optimization problems with their own unique search spaces to test the mutation operator.
The main steps for solving the MTSP using GA are as follows: 1) Reformulation: Each machine boundaries will be reformulated (calculate the new boundaries) based on its' successors machines boundaries.For each machine, the new lower boundary is called h and the new upper boundary is called H.

2) Initial population:
First, the chromosome is defined as a set of starting times for the machines in all cycles.So, S is the size of the chromosome is equal to n multiplied by k (n number of machines and k number of cycles).The gene x ircp is the starting times for machine i in cycle r in chromosome c in population p www.ijarai.thesai.org(Q number of chromosomes and W number of population) which satisfy the constraint in (P r ).The value of x ircp is generated randomly where

3) Other generation:
The value of fitness for each chromosome in the previous population had been calculated.The next generation is created by selecting the best chromosomes which have the greatest value in the objective function.T is a percent of the previous population which determines the number of best chromosomes that transfer to the next generation.

4) Crossover:
The remaining chromosomes are divided as a pair.Each chromosome in each pair is divided in certain cycle v then swap between v to k cycle in first chromosome and v to k cycles in the second chromosome.
The steps form 3 to 5 will be repeated until the last number of population.The solution is the first chromosome of the last population.

6) GAnuM-MTSP Algorithm:
GA1: Reformulate the boundaries for each machine in each cycle as follows: Input values of a ir and b ir for each cycle are as shown in Table I.The GA-MTSP algorithm is implemented and run for solving the allocated problem on a computer with processor Intel Centrino 1.6 GHz with 215 MB RAM.The population size has been tested by 40, 60, 80 and 100 chromosomes.The result shows that, the best population size is 100 chromosome as shown in figure (1-a).The number of chromosomes that will be kept in the next population has been tested by 30%, 20%, www.ijarai.thesai.org10%, 5%, 2.5% and 1.25% of population size.It was found that, the best number of chromosomes that will be kept in the next population equals 1.25% from population size as shown in figure (1-b).This means that the best chromosome, which has the best fitness function, will be transferred to the next population.The rest of chromosomes will be crossovered together to generate the rest of next population.It means that the probability of crossover is 98.75%, which is another parameter of GA.Using single point crossover, it was found that the best position of cutting point is 33% of the chromosome size as shown in figure (1-c).Finally, the Genetic algorithm parameters that give the best starting times have been determined: The best value for the objective function f is 35.26.Assuming that α is the cost, and then the penalty cost equals 35.26 α

B. Using Particle Swarm Optimization (PSO)
The PSO method is a member of wide category of Swarm Intelligence methods for solving the optimization problems.It is a population based search algorithm where each individual is referred to as particle and represents a candidate solution.Each particle in PSO flies through the search space with an adaptable velocity that is dynamically modified according to its own flying experience and also the flying experience of the other particles.Further, each particle has a memory and hence it is capable of remembering the best position in the search space ever visited by it.The position corresponding to the best fitness is known as pbest and the overall best out of all the particles in the population is called gbest [9].
The modified velocity and position of each particle can be calculated using the current velocity and the distance from the pbest j to gbest as shown in the following formulas: , With j=1, 2, …,n and g=1, 2, …, m n =number of particles in a group; m = number of members in a particle; t = number of iterations (generations); The index of best particle among all of the particles in the group is represented by the gbest.In PSO, each particle moves in the search space with a velocity according to its own previous best solution and its group's previous best solution.The velocity update in a PSO consists of three parts; namely momentum, cognitive and social parts.
The balance among these parts determines the performance of a PSO algorithm.The parameters c 1 & c 2 determine the relative pull of pbest and gbest and the parameters r 1 & r 2 help in stochastically varying these pulls [9].[13] Showed that combining them by setting the inertia weight,  , to the constriction factor, v, improved performance across a wide range of problems as follows:  [14] PSO is combined with the Lagrangian Relaxation (LR) framework to solve a power-generator scheduling problem known as the unit commitment problem (UCP).In terms of the solution quality, the PSO-LR provided a "best solution" with a lower cost than GA for problem sizes larger than 20 units, and than LR for problem sizes 20 and 80 units.PSO-LR also provided a "best solution", for the problem size of 10 units, with a much lower cost than using PSO alone.
A novel approach based on Particle Swarm Optimization (PSO) for scheduling jobs on computational grids is introduced in [15].The proposed approach is to dynamically generate an optimal schedule so as to complete the tasks within a minimum period of time as well as utilizing the resources in an efficient way.When compared to genetic algorithm (GA) and simulating Annealing (SA), an important advantage of the PSO algorithm is its speed of convergence and the ability to obtain faster and feasible schedules.
Application and performance comparison of PSO and GA optimization techniques were presented in [9], for Thyristor Controlled Series Compensator (TCSC)-based controller design.Results indicate that in terms of computational time, the GA approach is faster.The computational time increases linearly with the number of generations for GA, whereas for PSO the computational time increases almost exponentially with the number of generations.The higher computational time for PSO is due to the communication between the particles after each generation.However, the PSO seems to arrive at its final parameter values in fewer generations than the GA.
The main steps for solving the MTSP by PSO are as follows: 1) Reformulation: Each machine boundaries will be reformulated (calculate the new boundaries) based on its' successors machines boundaries.For each machine the new lower boundary is called h and the new upper boundary is called H.

2) Initial iteration:
First, the particle is defined as a set of starting times for the machines in all cycles.The particle is represented by Ddimensional, where D is equal to N multiplied by K (where N number of machines and K number of cycles .Determine the pbest p which is the best position of particle p that makes the best value of the objective function.Then determine the gbest which is the best particle that make the best value of the objective function in all iterations.

3) Other generation:
The next iteration created by modifying the velocity of each particle by the following equation: Then the particle position will be update by the following equation: The new iteration has been created with new position of SWARM.Calculate the objective function then find the pbest p and gbest.Repeat this step until last iterations.The solution is the gbest in the last iteration.

4) PSOc-MTSP Algorithm:
A1: Reformulate the boundaries for each machine in each cycle as follows:

5) Simulation Results
The PSOc-MTSP algorithm has been implemented and run for the same scenario used in Part 3.1.2.The program is run 100 times for determining the suitable parameters.Using test www.ijarai.thesai.orgsizes of 5, 20, 40 and 50 particle in the swarm, we found that, the best swarm size equals 20 as show in figure (2-a).After testing the w value by 0.1, 0.5, 0.9 and 0.9→ 0.1 (decreasing value) we found that the best value of w equals 0.5 as show in figure (2-b).The last parameters, we need to determine, are c 1 , c 2 .Using the values 0.5, 1, 1.5, 1.7, 1.9 and 2, for c1 and c2 we found that the best value for c 1 , c 2 equal 1.5 as shown in figure (2-c).Finally, the swarm parameters that give the best starting times have been determined is shown below.The best value for the objective function f equals 32.9.Assuming that the cost equal α.Then the penalty cost equals 32.9 α.

C. Discussion
From previous experimental results we found that, solving the MTSP using particle swarm optimization algorithm (PSOc-MTSP), leads to 32.9α penalty cost in 420 iterations that took 11 seconds.When solving the MTSP using genetic algorithm (GAnuM-MTSP), the penalty cost was 35.25 α, reached in generation 41 that took 2 seconds.But when the MTSP was solved using max-separable algorithm in [2], the penalty cost was 35.75 α in less than 0.5 seconds, (Figure 3).

D. Conclusion
The machine time scheduling problem (MTSP) was solved using particle swarm optimization (with constriction factor), genetic algorithm (GA) (with non-uniform mutation), and maxseparable technique.We found that, particle SWARM optimization gives the lowest penalty cost of the MTSP problem, followed by GA algorithm.The max-separable technique gives the highest penalty cost.That means that particle swarm optimization algorithm is the most suitable for solving the MTSP problem, giving the best starting time for each machine in each cycle.
and LB and UB are the lower and upper bounds of the variables x k .The function )

v
Figure 1.Genetic algorithm parameters p < Q then p = p + 1 go to A16.A22: If t < T then go to A15.A23: The solution is gbest.

Figure 2 .Figure 3 .
Figure 2. Determination of the swarm parameters Table I, and the machines relations are as shown in Table II.

TABLE IV
).The x irpt is the starting time for machine i in cycle r in particle p,