# An Efficient Information Retrieval System Using Evolutionary Algorithms
## 3 Methodology
### Advanced Document Indexing Method (ADIM) Stage
#### 3.1.2 Adim
\[\text{Total-tag-weight}=\text{Weight (W) tag}+\sum\text{Weight (W) tag} \tag{1}\]

where the weight (W) tag is the weighting word. ### Query Search Processing Stage

The proposed system converts a string of user queries into a set of words stored in an array. It fetches the word and page list from the word-information table, saving them in an array called query words (QW). The information of each word in the database is acquired, merging each word of the page list with the other page-list words of the entered query into one array called the ID list. It is used as the initial generation of GA; however, the ID list contains a repeated ID that is useful in the initial generation as the page contains the most frequent ID. This increases the population's probability. Algorithm 2 describes the main steps of the query search algorithm (QS). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Tag-name** & **Weight** & **How Many Tags Occur on Page** & **Description** \\ \hline title & 6 & appear only one time and not & It is the most important tag because contains \\ header \& sub-header (h1, h2, & repeated & terms near to the request of the UQ. \\ and h3) & 5 & appear n times & words found within the tags deliver \\ An anchor & 4 & appear n times & structural information. \\ Italic (I) \& bold (B) & 4 & appear n times & This tag contains a word this word points to \\  & & & another word or link. \\ Italic (I) \& bold (B) & 4 & gives the descriptions of the document and \\  & & & the score. \\ body & 1 & appear only one time and not & less important tag that contains the plain text. \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Document-tags dataset. ```
1. Begin
2. Initialization: QW [word, pages-list] = [], X [word] = [], ID-list [pages-list] = [], Input user query (UQ = S) \(\backslash\backslash\)  where S is string. 3. Loop // For i = 0 to UQ length
4. Split the user query (string) into words. 5. X [W] = split (S)
6. Stop until UQ is completed. 7. Loop // For each word in X [W] Do
8. QW [word, pages-list] = for each W get word. 9. QW [word, pages-list] = pages-list from words-information table. 10. ID-list [pages-list] = merge Pages-list for each word with the other pages-list word of the entered query. 11. Stop until the criteria are met. 12. Return ID-List array. 13. End
```
**Algorithm 2**Query Search Algorithm (QSA)

Algorithm 2 begins with initialization lists for both QW, X, and UQ. It splits UQ into words and stores these words in the list of X. For each word in the X list, obtain the word and page list from the word-information table in the results, create QW (word, page list), and merge the page list for each word with the other page-list words of the entered query to obtain the ID list (page list). ### Evolutionary Algorithm Stage

#### 3.3.1 Modify Genetic Algorithm (MGA)

GA was modified and integrated with CA to be adaptable with IR for optimization problems. It has several parameters that are implemented in various methods. GA operators (i.e., initial generation, fitness function, parent selection, crossover, and mutation) are summarized in Algorithm 3. The following subsections describe the details of these operators. ```
1. Begin
2. Encode the problem. 3. Initial Generation.//First generation Randomly create. 4. In the first generation evaluate the FF for each chromosome. 5. Loop
6. Following operators to create the next generation:
7. Selection operator;
8. crossover operator;
9. mutation operator. 10. stop until the criteria are met. 11. From the last generation, return the best chromosome's content. 12. End
```
**Algorithm 3**GA- Processes

Figure 5: chromosome representation. The chromosome length represents the number of shared pages between the query and QW, representing the ID list. ### Fitness-Function

GA works to generate several generations before reaching the best solution or finding this solution. From the initial generation, these generations can be obtained by applying the operators of GA (i.e., selection, crossover, and mutation).