code: public double getWorstCaseSubstituteAll() {
          double worstCase = -1;
  
          // make a copy of editDistanceGraph
          SimpleDirectedWeightedGraph worstCaseGraph = new SimpleDirectedWeightedGraph();
          Set vertices = editDistanceGraph.vertexSet();
          Set edges = editDistanceGraph.edgeSet();
          worstCaseGraph.addAllVertices(vertices);
          worstCaseGraph.addAllEdges(edges);
  
          edges = worstCaseGraph.edgeSet();
  
          for (Object o : edges) {
              Edge edge = (Edge) o;
              GraphVertexTuple vertex1 = (GraphVertexTuple) edge.getSource();
              GraphVertexTuple vertex2 = (GraphVertexTuple) edge.getTarget();
              // check if this edge is a diagonal
              if (vertex2.getLeft() == vertex1.getLeft() + 1
                      && vertex2.getRight() == vertex1.getRight() + 1) {
                  edge.setWeight(weightSubstitute);
              }
          }
          DijkstraShortestPath shortestPath = new DijkstraShortestPath(worstCaseGraph, firstVertex, lastVertex, pathLengthLimit);
          worstCase = shortestPath.getPathLength();
          return worstCase;
      }
docs: This worst-case is computed as follows: We look at the original graph
  <code>editDistanceGraph</code>, and change the weights of all diagonal
  edges to {@link #weightSubstitute}. Previously their weights depended on
  whether the node-tuple is equal or not. But now we look at it as if all
  the labels in both trees were different. Then we compute again the
  shortest path through this altered graph. By considering the
  shortestPath, we are still able to insert nodes prior to delete others.
  This is not possible in: {@link #getWorstCaseRetainStructure()}.
  
  @return the worst-case scenario of edit operations