src/main/java/de/dfki/lt/loot/fsa/algo/MinimizationBrzowski.java
private static <EdgeInfo> boolean equalEdgesByLabel(
    Comparator<EdgeInfo> comp,
    Iterable<Edge<EdgeInfo>> edgeList1,
    Iterable<Edge<EdgeInfo>> edgeList2) {

    TreeSet<EdgeInfo> edges1 = new TreeSet<EdgeInfo>(comp);
    for (Edge<EdgeInfo> edge : edgeList1) {
      edges1.add(edge.getInfo());
    }

    for (Edge<EdgeInfo> edge : edgeList2) {
      if (! edges1.remove(edge.getInfo())) return false;
    }
    // no mismatch found, so the lists are equal
    return edges1.isEmpty();
  }
/**
   * This checks if two edge lists are "equal", i.e., have the same length and
   * the same defined/undefined transitions.
   *
   * Since the lists are sorted, we only have to traverse them in parallel.
   *
   * @param edgeList1 a <code>List</code> with edges
   * @param edgeList2 a <code>List</code> with edges
   * @return a <code>boolean</code> indicating if the edge lists are equals
   */
This checks if two edge lists are "equal", i.e., have the same length and
the same defined/undefined transitions.

Since the lists are sorted, we only have to traverse them in parallel.

@param edgeList1 a List with edges
@param edgeList2 a List with edges
@return a boolean indicating if the edge lists are equals
This checks if two edge lists are " equal " i . e . have the same length and the same defined / undefined transitions . Since the lists are sorted we only have to traverse them in parallel . @param edgeList1 a List with edges @param edgeList2 a List with edges @return a boolean indicating if the edge lists are equals
private static <EdgeInfo> boolean equalEdgesByLabel(
    Comparator<EdgeInfo> comp,
    Iterable<Edge<EdgeInfo>> edgeList1,
    Iterable<Edge<EdgeInfo>> edgeList2) {
    TreeSet<EdgeInfo> edges1 = new TreeSet<EdgeInfo>(comp);
    for (Edge<EdgeInfo> edge : edgeList1) {
      edges1.add(edge.getInfo());
    }
    for (Edge<EdgeInfo> edge : edgeList2) {
      if (! edges1.remove(edge.getInfo())) return false;
    }
    return edges1.isEmpty();
  }
private static < EdgeInfo > boolean equalEdgesByLabel ( Comparator < EdgeInfo > comp , Iterable < Edge < EdgeInfo > > edgeList1 , Iterable < Edge < EdgeInfo > > edgeList2 ) { TreeSet < EdgeInfo > edges1 = new TreeSet < EdgeInfo > ( comp ) ; for ( Edge < EdgeInfo > edge : edgeList1 ) { edges1 . add ( edge . getInfo ( ) ) ; } for ( Edge < EdgeInfo > edge : edgeList2 ) { if ( ! edges1 . remove ( edge . getInfo ( ) ) ) return false ; } return edges1 . isEmpty ( ) ; }
This checks if two edge lists are "equal", i.e., have the same length and
 the same defined/undefined transitions.
This checks if two edge lists are " equal " i . e . have the same length and the same defined / undefined transitions .
// no mismatch found, so the lists are equal