Class GraphPartitioner

  • All Implemented Interfaces:

    public class GraphPartitioner
    extends Object
    implements GraphWalker
    Creates a collection of connected graphs from a single graph. A connected graph in which for every two pair of nodes, there is a path between them.
    Justin Deoliveira, Refractions Research Inc,
    • Constructor Detail

      • GraphPartitioner

        public GraphPartitioner​(Graph graph)
        Constructs a new partitioner for a graph.
        graph - Graph to be partitioned.
    • Method Detail

      • partition

        public boolean partition()
        Performs the partition.
        True if the partition was successful, otherwise false.
      • getPartitions

        public ArrayList<Serializable> getPartitions()
        Returns the partitions of the graph.
        A collection of Graph objects.
        See Also:
      • visit

        public int visit​(Graphable element,
                         GraphTraversal traversal)
        Adds the element to the current partition.
        Specified by:
        visit in interface GraphWalker
        element - The component being visited.
        traversal - The traversal controlling the sequence of graph component visits.
        GraphTraversal#CONTINUE to signal that the traversal should continue.
        GraphTraversal#CONTINUE to signal that the traversal should suspend.
        GraphTraversal#KILL_BRANCH to signal that the traversal should kill its current branch.
        GraphTraversal#STOP to signal that the traversal should stop.
        See Also:
        GraphWalker.visit(Graphable, GraphTraversal)
      • finish

        public void finish()
        Adds the current partition to the completed set of partitions and creates a new partition.
        Specified by:
        finish in interface GraphWalker
        See Also: