Class BFS


  • public class BFS
    extends Object
    Computes the visit order with respect to a breadth-first visit.
    Author:
    Marco Rosa, Thibault Allançon
    • Constructor Summary

      Constructors 
      Constructor Description
      BFS()  
    • Constructor Detail

      • BFS

        public BFS()
    • Method Detail

      • bfsperm

        public static long[][] bfsperm​(ImmutableGraph graph,
                                       long startingNode,
                                       int bufferSize)
                                throws IOException
        Return the permutation induced by the visit order of a depth-first visit.
        Parameters:
        graph - a graph.
        startingNode - the only starting node of the visit, or -1 for a complete visit.
        bufferSize - internal queue buffer size (will be minimized with Long.SIZE times the number of nodes in the graph).
        Returns:
        the permutation induced by the visit order of a depth-first visit.
        Throws:
        IOException
      • bfsperm

        public static long[][] bfsperm​(ImmutableGraph graph,
                                       long startingNode,
                                       long[][] startPerm,
                                       int bufferSize)
                                throws IOException
        Return the permutation induced by the visit order of a depth-first visit.
        Parameters:
        graph - a graph.
        startingNode - the only starting node of the visit, or -1 for a complete visit.
        startPerm - a permutation that will be used to shuffle successors, or null.
        bufferSize - internal queue buffer size (will be minimized with Long.SIZE times the number of nodes in the graph).
        Returns:
        the permutation induced by the visit order of a depth-first visit.
        Throws:
        IOException