# Composing Multiple Online Exams: The Bees Algorithm Solution
## 3 Methodology  
This section provides a detailed description of the algorithm employed to address the multiple-exam composition problem. Firstly, we will outline the main steps followed by the BA to solve this problem. After specifying the number of desired exams (\(m\)), the required difficulty level (\(DLR\)), the number of questions in each part, and the overlap threshold, the algorithm proceeds as follows:  
1. Generate an initial population of bees (\(s>m\)), in which each bee represents a potential exam, and \(s\) denotes the scout bees. Sort the population based on each bee's fitness, i.e., the exam's difficulty level, calculated using Equation (1). 2. Select the fittest bees (\(m\)) for neighborhood search. During neighborhood search, some questions in the selected exam are replaced, resulting in a new exam or neighbor. The number of neighbors generated for the elite (fittest) bees (\(e\)) within \(m\) is higher than the number of neighbors generated for the remaining bees (\(m\)-\(e\)). The fittest bee from each of the m patches or neighborhoods is then chosen to transfer to the next generation. Two neighborhood search methods are applied: random for the best and elite bees, and deterministic when the set of \(m\) exams fails the overlap condition. In the deterministic method, overlapping questions are replaced with new questions from the same chapters with similar difficulty levels. This preserves the fitness value while reducing the overlap percentage. 3. Test the overlap condition by comparing the \(m\) exams and keeping track of overlapping questions. If the overlap condition is satisfied, select the fittest bees from the \(m\) patches to transfer to the next generation and discard the remaining (\(s\)-\(m\)) bees. However, if the ratio of overlapping questions to the remaining questions in the exams exceeds the overlap threshold, perform a new neighborhood search operation on the previously selected \(m\) bees until the overlap condition is met. The overlap percentage is calculated by dividing the number of repeated questions by the total number of questions in the \(m\) exams, as shown in Equation (2). 4. Generate new (\(s\)-\(m\)) bees randomly to maintain the original population size. The stopping condition test memorizes the best \(DLR\) and checks whether the overlap percentage has changed. If not, the algorithm returns the desired m exams. The process (steps 2-4) repeats until the termination condition is met. The termination condition can be satisfied when the resulting set of bees includes \(m\) exams that fulfill all the conditions specified by the educator, or when the algorithm reaches a maximum pre-defined number of iterations, or when the overlapping percentage remains unchanged for five consecutive iterations. Algorithm 1 presents the pseudocode of the proposed method. A crucial aspect of the algorithm is the representation of a problem's solution, which, in our case, corresponds to an exam or test. The exam is structured into parts or chapters, with each part containing multiple questions of varying difficulty levels. The educator specifies the number of questions per part, the overall difficulty level of the test, and the desired overlap percentage between tests. Hence, the solution is represented as a test object comprising parts or chapters, where each part consists of a collection of questions identified via a question ID. Figure 2 provides an illustration of a solution representation for an exam. As mentioned earlier, our neighborhood move involves replacing one question in the exam to generate a new exam. In the following section, we present an example of a question bank that will be utilized to illustrate and describe the behavior of our algorithm.