private void storeGraph(Graph graph) { if (numPatternsToStore < 1) return; if (topGraphs.isEmpty() || score > topGraphs.first().getScore()) { Graph graphCopy = new EdgeListGraphSingleConnections(graph); topGraphs.add(new ScoredGraph(graphCopy, score)); if (topGraphs.size() > getNumPatternsToStore()) { topGraphs.remove(topGraphs.first()); } } }