Map<CmpVertex,LearnerGraph> pathsFromEachStateInGraph = PairQualityLearner.constructPathsFromEachState(graph,directionForwardOrInverse);
List<StatePair> pairsList = PairQualityLearner.buildVerticesToMergeForPath(pathsFromEachStateInGraph,directionForwardOrInverse,pathsOfInterest);
LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>> verticesToMerge = new LinkedList<AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>>();
int score = graph.pairscores.computePairCompatibilityScore_general(null, pairsList, verticesToMerge);
LearnerGraph merged = MergeStates.mergeCollectionOfVertices(graph, null, verticesToMerge);// after merging all paths of interest, we get this graph.
ConsistencyChecker checker = new MarkovUniversalLearner.DifferentPredictionsInconsistency();
final long genScoreThreshold = 1;
int nrOfMergers=0;
List<StatePair> pairsToMerge = new LinkedList<StatePair>();
for(Entry<CmpVertex,Map<Label,CmpVertex>> entry:merged.transitionMatrix.entrySet())
for(Entry<Label,CmpVertex> transition:entry.getValue().entrySet())