## 3 Simulated Annealing Algorithm with Cooperative Threads (SACT)  
The SACT algorithm (simulated annealing with cooperative threads) generates threads (\(H1\),..., \(Hn\)) that are administered by the operating system Windows Vista Ultimate 64 bits and which work in parallel form. Each thread generated \(Hi\) by SACT executes and controls one simulated annealing algorithm (SA) in individual form. A core of CPU carries out the control of each thread \(Hi\). If there are more threads than cores of CPU's, then the threads are distributed in a balanced way among the group of cores of CPU's that the computer contains. The cooperation among the existing threads, \(n\), allows each thread, \(Hi\), in which simulated annealing is carried out, to know (in any instant of important time) the best solution, \(S_{best}\) that has been found up to that point in time. This makes it possible that a thread \(Hi\) can use the best solution \(S_{best}\) to realize an _effective-address_ procedure with the solution \(S_{Hi,c}\) that is found by executing the SA algorithm. The resulting solution of the _effective-address_ procedure is used as an initial solution in the restart of SA within the thread \(Hi\). Because SACT constantly needs to know and upgrade the best solution \(S_{best}\). The threads have the advantage of working actively and using the same memory address space. This makes the communication among them quicker [28]. The threads are able to work simultaneously. In SACT, the threads have continuous access to a space of shared memory that stores the best found solution for the n threads at a time \(t\). This makes it necessary to implement a CREW model, where the access to this space of shared memory must be synchronized between the threads in order to avoid conflicts of reading/writing that could cause errors or loss of information. In order to synchronize the access to this memory, the critical section is used. This guarantees that in any given instant in time, only one thread can have access to read/write, leaving the others on a waiting list. In the operating system Windows Vista Ultimate 64 bits, the threads are administrated like objects, which are created for calling functions to the applications programming interface (API), using the MFC library [29]. In the SACT algorithm, the functions of the MFC of Microsoft visual C++, 2017, are used for the creation of the threads in a single process. Each thread created by SACT works by carrying out the same number of identical activities, but with different data. Knowing this, a class was created that upon generating \(n\) instances for the class, \(n\) objects are generated. Each object represents a thread [30]. SACT has the possibility of generating a parent thread, which in turn generates \(n\) offspring threads, executing them in parallel form. Figure 1: Job shop scheduling with three jobs and three machines. The SACT algorithm applies to JSSP when the objective function is minimizing the maximum time of completion of the last job, this is known as minimizing the makespan. Algorithm 1, presents the SA algorithm that is executed for each created thread \(Hi\) by SACT. ```
1. Obtain \(S_{Hi}\), where \(S_{Hi}\) = f (UB). 2. Give an iteration initial \(iter\) = 0, initialize values of \(Cf\), \(Co\), \(\alpha\), f(\(S_{Hi,c}\)). 3. While (\(iter\) < Maxiter)
```  
**Algorithm 1** Simulated annealing executed in each generated thread \(Hi\) by SACT. The explanation of the algorithm is the following (Algorithm 1):  
1. \(S_{Hi}\) is the schedule (initial solution of JSSP) obtained by the scheduling algorithm [12] using the disjunctive graph model. The makespan of \(S_{Hi}\) should not surpass an upper bound (UB) defined as date of entrance. In order to define this bound see [26]. 2. \(iter\) (global variable known in the \(n\) threads) is the variable that counts the number of SA executed in SACT.