Class TransitiveReduction

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TransitiveReduction()
      Private Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <V,​E>
      void
      reduce​(DirectedGraph<V,​E> directedGraph)
      This method will remove all transitive edges from the graph passed as input parameter.
      (package private) static void transformToPathMatrix​(java.util.BitSet[] matrix)
      The matrix passed as input parameter will be transformed into a path matrix.
      (package private) static void transitiveReduction​(java.util.BitSet[] pathMatrix)
      The path matrix passed as input parameter will be transformed into a transitively reduced matrix.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TransitiveReduction

        private TransitiveReduction()
        Private Constructor.
    • Method Detail

      • transformToPathMatrix

        static void transformToPathMatrix​(java.util.BitSet[] matrix)
        The matrix passed as input parameter will be transformed into a path matrix.

        This method is package visible for unit testing, but it is meant as a private method.

        Parameters:
        matrix - the original matrix to transform into a path matrix
      • transitiveReduction

        static void transitiveReduction​(java.util.BitSet[] pathMatrix)
        The path matrix passed as input parameter will be transformed into a transitively reduced matrix.

        This method is package visible for unit testing, but it is meant as a private method.

        Parameters:
        pathMatrix - the path matrix to reduce
      • reduce

        public <V,​E> void reduce​(DirectedGraph<V,​E> directedGraph)
        This method will remove all transitive edges from the graph passed as input parameter.

        You may want to clone the graph before, as transitive edges will be pitilessly removed.

        e.g.
         {
             @code DirectedGraph<V, T> soonToBePrunedDirectedGraph;
        
             TransitiveReduction.INSTANCE.reduce(soonToBePrunedDirectedGraph);
        
             // pruned !
         }
         
        Type Parameters:
        V - the graph vertex type
        E - the graph edge type
        Parameters:
        directedGraph - the directed graph that will be reduced transitively