Class DepthFirstEnumerationBuilder<T>

  • Type Parameters:
    T - type of nodes in the graph.
    All Implemented Interfaces:
    EnumerationBuilder<T>


    public class DepthFirstEnumerationBuilder<T>
    extends Object
    • Field Detail

      • invertOrderOfNewNeighbors

        protected boolean invertOrderOfNewNeighbors
    • Constructor Detail

      • DepthFirstEnumerationBuilder

        public DepthFirstEnumerationBuilder(Graph<T> graph)
        Create a new EnumerationBuilder for the denoted graph.
        Parameters:
        graph - the graph to build an enumeration for.
      • DepthFirstEnumerationBuilder

        public DepthFirstEnumerationBuilder(Graph<T> graph,
                                            SetFactory<T> setFactory)
        Create a new EnumerationBuilder for the denoted graph.
        Parameters:
        graph - the graph to build an enumeration for.
        setFactory - a factory to create sets for storing nodes with.
    • Method Detail

      • chooseNext

        protected T chooseNext(List<T> neighbours,
                               Set<T> neighbourSet)
      • createList

        protected List<T> createList()
      • buildEnumeration

        public List<T> buildEnumeration()
        Description copied from interface: EnumerationBuilder
        Builds an enumeration of the nodes in the graph. This method will build a list containing all nodes of the graph such that algorithms may work on the nodes of the graph sequentially.
        Specified by:
        buildEnumeration in interface  EnumerationBuilder<T>
        Returns:
        an enumeration of the nodes in the graph.