orderedNodes.addAll(nodes);
Collections.sort(orderedNodes, nodeComparator);
Iterator<Node> nodeIterator = orderedNodes.iterator();
// Get the first node and add all the signature indexes.
Node node = nodeIterator.next();
final PossibleSignatures linkedList = buildInitialList(
node.getRankedSignatureIndexes());
// Count the number of times each signature index occurs.
while (nodeIterator.hasNext()) {
node = nodeIterator.next();
maxCount = getClosestSignaturesForNode(
node.getRankedSignatureIndexes(),
linkedList,
maxCount,
iteration);
iteration++;
}