+Where $x_i, x_j$ are vectors. To constract new core genes, we look on the value of intersecting two vectors, we call it $Score$:\\
+$$\text{New Core} = \begin{cases}
+\text{Ignored} & \text{if $Score=0$;} \\
+\text{new Core id} & \text{if $Score>0$.}
+\end{cases}$$\\
+
+if $Score=0$ then we have \textit{disjoint relation} (i.e no common genes between two genomes). In this case the system ignore the vector that smash the core genes. Otherwise, The system remove these two vectors from ICM and add new core vector with a \textit{coreID} of them to ICM for the calculation in next iteration. The partial core vectors generated with its values will store in the local database for reused to draw the tree. this process repeat until all vectors treated.
+We observe that ICM will result to be very large because of the huge amount of data that it stores. In addition, this will results to be time and memory consuming for calculating the intersection scores by using just genes names. To increase the speed of calculations, we can calculate the upper triangle scores only and exclude diagonal scores. This will reduce whole processing time and memory to half. The time complexity for this process after enhancement changed from $O(n^2-n)$ to $O(\frac{(n-1).n}{2})$.\\
+
+The Algorithm of construction the vector matrix and extracting the vector of maximum core genes where illustrated in Algorithm \ref{Alg1}. The output from this step is the maximum core vector with its two vectors to draw it in a tree.
+
+\begin{algorithm}[H]
+\caption{Extract Maximum Intersection Score}
+\label{Alg1}
+\begin{algorithmic}
+\REQUIRE $L \leftarrow \text{genomes vectors}$
+\ENSURE $B1 \leftarrow Max core vector$
+\FOR{$i \leftarrow 0:len(L)-1$}
+ \STATE $core1 \leftarrow set(GenomeList[L[i]])$
+ \STATE $score1 \leftarrow 0$
+ \STATE $g1,g2 \leftarrow$ " "
+ \FOR{$j \leftarrow i+1:len(L)$}
+ \STATE $core2 \leftarrow set(GenomeList[L[i]])$
+ \IF{$i < j$}
+ \STATE $Core \leftarrow core1 \cap core2$
+ \IF{$len(Core) > score1$}
+ \STATE $g1 \leftarrow L[i]$
+ \STATE $g2 \leftarrow L[j]$
+ \STATE $Score \leftarrow len(Core)$
+ \ELSIF{$len(Core) == 0$}
+ \STATE $g1 \leftarrow L[i]$
+ \STATE $g2 \leftarrow L[j]$
+ \STATE $Score \leftarrow -1$
+ \ENDIF
+ \ENDIF
+ \ENDFOR
+ \STATE $B1[score1] \leftarrow (g1,g2)$
+\ENDFOR
+\RETURN $max(B1)$
+\end{algorithmic}
+\end{algorithm}
+
+\textit{GenomeList} represents the local database.\\
+
+\subsection{Genomes Relationships}
+The goal here is to visualizing the results by build a tree of evolution. The system can produce this tree automatically by using Dot graphs package\cite{gansner2002drawing} from Graphviz library and all information available in a database. Core genes generated with their genes can be very important information in the tree, because they can viewed as an ancestor information for two genomes or more. Further more, each node represents a genome or core as \textit{(Genes count:Family name, Scientific names, Accession number)}, Edges represent numbers of lost genes from genomes-core or core-core relationship. The number of lost genes here can represent an important factor for evolution, it represents how much lost of genes for the species in same or different families. By the principle of classification, small number of gene lost among species indicate that those species are close to each other and belong to same family, while big genes lost means that species is far to be in the same family. To see the picture clearly, Phylogenetic tree is an evolutionary tree generated also by the system. Generating this tree is based on the distances among genes sequences. There are many resources to build such tree (for example: PHYML\cite{guindon2005phyml}, RAxML{\cite{stamatakis2008raxml,stamatakis2005raxml}, BioNJ , and TNT\cite{goloboff2008tnt}}. We consider to use RAxML\cite{stamatakis2008raxml,stamatakis2005raxml} to generate this tree.
+
+\section{Implementation}
+We implemented four algorithms to extract maximum core genes from large amount of chloroplast genomes. Two algorithms used to extract core genes based on NCBI annotation, and the others based on dogma annotation tool. Evolutionary tree generated as a result from each method implementation. In this section, we will present the four methods, and how they can extract maximum core genes?, and how the developed code will generate the evolutionary tree.
+
+\subsection{Extract Core genes based on NCBI Gene names and counts}
+The first idea to construct the core genome is based on the extraction of Genes names (as gene presence or absence). For instant, in this stage neither sequence comparison nor new annotation were made, we just want to extract all genes with counts stored in each chloroplast genome, then find the intersection core genes based on gene names. \\
+The pipeline of extracting core genes can summarize in the following steps:\\
+First, we apply the genome annotation method using NCBI annotation tool. Genome quality check can be used in this step to ensure that genomes pass some quality condition. Then, the system lunch annotation process using NCBI to extract code genes (i.e \textit{exons}) and solve gene fragments. From NCBI, we did not observe any problem with genes fragments, but there are a problem of genes orthography (e.g two different genes sequences with same gene name). After we obtain all annotated genomes from NCBI to the local database, the code will then automatically will generate GenVision\cite{geneVision} file format to lunch the second step to extract coding genes names and counts. The competition will start by building intersection matrix to intersect genomes vectors in the local database with the others. New core vector for two leaf vectors will generate and a specific \textit{CoreId} will assign to it. an evolutionary tree will take place by using all data generated from step 1 and 2. The tree will also display the amount of genes lost from each intersection iteration. A specific excel file will be generated that store all the data in local database. The whole operation illstrate in Figure \ref{NCBI:geneextraction}.
+
+\begin{figure}[H]
+ \centering
+ \includegraphics[width=0.7\textwidth]{NCBI_geneextraction}
+ \caption{Extract core genes based on NCBI gene names and counts}\label{NCBI:geneextraction}
+\end{figure}
+
+\subsection{Extract Core genes based on Dogma Gene names and counts}
+The main goal is to get as much as possible the core genes of maximum coding genes names. According to NCBI annotation problem based on \cite{Bakke2009}, annotation method like dogma can give us more reliable coding genes than NCBI. This is because NCBI annotation can carry some annotation and gene identification errors. The general overview of whole process of extraction illustrated in figure \ref{dog:Annotation}. From this figure, the pipeline of extracting core genes can summarize in the following steps:\\
+First, we apply the genome annotation method using Dogma annotation tool. Genome quality check can be used in this step to ensure that genomes pass some quality condition. Then, the system lunch annotation process using Dogma to extract code genes (i.e \textit{exons}) and solve gene fragments. The key difference here is that dogma can generate in addition transfer RNA and ribosomal RNA. As a result from annotation process with dogma is genomes files in GenVision\cite{geneVision} file format, the code will lunch genes de-fragments process to avoid genes duplications. little problems of genes orthography (e.g two different genes sequences with same gene name) where exists. After we obtain all annotated genomes from dogma, we store it in the local database. The code will then automatically lunch the second step to extract coding genes names and counts. The competition will start by building intersection matrix to intersect genomes vectors in the local database with the others. New core vector for two leaf vectors will generate and a specific \textit{CoreId} will assign to it. an evolutionary tree will take place by using all data generated from step 1 and 2. The tree will also display the amount of genes lost from each intersection iteration. A specific excel file will be generated that store all the data in local database. The whole operation illstrate in Figure \ref{dogma:geneextraction}.
+
+\begin{figure}[H]
+ \centering
+ \includegraphics[width=0.7\textwidth]{Dogma_geneextraction}
+ \caption{Extract core genes based on Dogma gene names and counts}\label{dogma:geneextraction}
+\end{figure}