Class SCCIterator<T>

  • All Implemented Interfaces:
    java.util.Iterator<java.util.Set<T>>

    public class SCCIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<java.util.Set<T>>
    This class computes strongly connected components for a Graph (or a subset of it). It does not store the SCCs in any lookaside structure, but rather simply generates an enumeration of them. See Cormen, Leiserson, Rivest Ch. 23 Sec. 5
    • Constructor Summary

      Constructors 
      Constructor Description
      SCCIterator​(Graph<T> G)
      Construct an enumeration across the SCCs of a given graph.
      SCCIterator​(Graph<T> G, java.util.Iterator<T> nodes)
      Construct an enumeration of the SCCs of the subset of a given graph determined by starting at a given set of nodes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Determine whether there are any more SCCs remaining in this enumeration.
      java.util.Set<T> next()
      Find the next SCC in this enumeration
      void remove()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • SCCIterator

        public SCCIterator​(Graph<T> G)
                    throws java.lang.NullPointerException
        Construct an enumeration across the SCCs of a given graph.
        Parameters:
        G - The graph over which to construct SCCs
        Throws:
        java.lang.NullPointerException - if G is null
      • SCCIterator

        public SCCIterator​(Graph<T> G,
                           java.util.Iterator<T> nodes)
        Construct an enumeration of the SCCs of the subset of a given graph determined by starting at a given set of nodes.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Determine whether there are any more SCCs remaining in this enumeration.
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public java.util.Set<T> next()
                              throws java.util.NoSuchElementException
        Find the next SCC in this enumeration
        Specified by:
        next in interface java.util.Iterator<T>
        Throws:
        java.util.NoSuchElementException
      • remove

        public void remove()
                    throws java.lang.UnsupportedOperationException
        Specified by:
        remove in interface java.util.Iterator<T>
        Throws:
        java.lang.UnsupportedOperationException