\begin{figure}
\begin{alltt}
function GAC(data)
  for each row in data
    clusters.add(new Cluster(row))
    
  while(clusters.size() > 1)
    bestDistance = infinite
    bestA = null
    bestB = null
    
    for each clusterA in clusters
      for each clusterB in clusters
        if(A != B)
          if(distanceBetween(clusterA, clusterB) < bestDistance)
            bestDistance = distanceBetween(clusterA, clusterB)
            bestA = A
            bestB = B
            
    clusters.remove(bestA)
    clusters.remove(bestB)
    clusters.add(new Cluster({bestA, bestB}))
            
\end{alltt}
\caption{Pseudo code of Greedy Agglomerative Clustering\cite{GAC}}\label{fig:pseudoCode-gac}
\end{figure}
