# An Efficient Information Retrieval System Using Evolutionary Algorithms
## 3 Methodology
### Advanced Document Indexing Method (ADIM) Stage
#### 3.1.2 Adim
Thus, the fitness function is used to assess the performance. FF is used to evaluate the relevance of documents to the user query. Documents are use the FF in two operators of GA; these two operators are selection and mutation. The proposed fitness function (FF) for this system is shown in Equation (2). \[\text{FF}=\sum_{C=0}^{15-1}\;\sum_{g=0}^{sp-1}[(\text{SPT}(\text{g})+0.1)+\; \text{WOT}(\text{g})+(\text{PID}(\text{g})*0.5)+\;\infty\;(\text{g})] \tag{2}\]

where C is the chromosome, g is the gene (page), SP is the number of shared pages (pages that contain the words of the user query), SPT has shared pages (all pages contain words of user query together), WOT is 1-6 weights of tags (HTML, head, sub-header (h1, h2, h3), and body), PID is the page ID (each page contains the words of the user query together), and \(\propto\) is a simple value that guarantees the remainder of all pages relevant to the user query at the first position of each chromosome, given by:

\[\propto=\text{FF}\;(\text{page})-\text{index}\;(\text{page}) \tag{3}\]

All equation parameters are detailed as follows:

SPT represents several shared pages of words from user queries together. It can be checked within all pages from the initial generation to find which page contains the words of the user query together. Each appearance of query words together can increase 0.1 of the page fitness value determined by the experiment. In the following example, a chromosome consists of six shared pages; only three of them contain the words of the user query together. When the total weight and word count are computed from the page-information table, the FF value is 1100. 0-1-362, 0-3-53, 0-2-18, 0-1-383, 0-1-399, 0-4-45 1100

Check if the query found in these pages came together; if this condition is verified, it can be increased by 0.1 for each appearance of the query. Suppose the query words appear four times in these three pages so that the value of FF becomes computed as follows:

For the first appearance become: 1100 + 0.1 = 1100.1

For the second appearance becomes: 1100.1 + 0.1 = 1100.2

For the third appearance becomes: 1100.2 + 0.1 = 1100.3

For the third appearance becomes: 1100.3 + 0.1 = 1100.4

This is the final FF value of the chromosome, and the chromosome becomes:

0-1-362, 0-3-53, 0-2-18, 0-1-383, 0-1-399, 0-4-45 1100.4

WOT represents integers 1 to 6, the weight of query words appearing in tags. For each word of the user query, WOT assigns a weight to determine the tag of this query. For example:

If the query is the operating system and these query words come together, the query increases to six due to the query being in the tag title and the weight of this tag is six. Moreover, if present in another page in the body, the weighting becomes one, as the weighting of the body is one, and accordingly for other queries. Suppose the FF value of the page contains the query; the operating system is 1000, and this page contains this query in the title, and then this value is increased by six as follows:

FF = 1000 + 6 = 1006

Suppose this query appears on the body of the other page, then the FF value will be:

FF = 1000 + 1 = 1001

The WOT gives more importance to the query appearing in the title than to the query appearing in the body. PID represents the page id and multiplies for each page, containing all queries together with a value of 0.5 determined by the experiment to ensure that the fitness of this page stays high. ### Parent Selection

Parent selection is one of the three main operators of the GA, which is used to produce the next generation. Parent selection is controlled by FF. Better selection of parents of high quality ensures a higher probability to copy the best individual to the next generation to produce better offspring. There are several selection methods. One of these methods is to select parents randomly without any restrictions; this type is simple. However, this method has some disadvantages, such as that it allows irrelevant documents to be selected.