Class IndexedGraphOperations

java.lang.Object
org.vanted.indexednodes.IndexedGraphOperations

public class IndexedGraphOperations
extends Object
Some graph operations backed by org.vanted.addons.indexednodes.IndexedNodeSet. Faster performance over more naive implementations. Specifically, this data structure is more space efficient.
Since:
2.8
Author:
Benjamin Moser
  • Method Details

    • getComponents

      public static List<IndexedComponent> getComponents​(IndexedNodeSet subgraph)
      Get all connected components in the induced `subgraph`
      Parameters:
      subgraph -
      Returns:
    • calcDistances

      public static org.apache.commons.math3.linear.RealVector calcDistances​(Node from, IndexedNodeSet inSet)
      Calculates the distance vector from the specified node to all other nodes in the given org.vanted.indexednodes.IndexedNodeSet.
      Parameters:
      from - the distances from this node to all others will be calculated.
      Returns:
      the distance vector from the from node to all others
    • breadthFirstSearch

      public static void breadthFirstSearch​(int startNode, IndexedNodeSet subgraph, StatefulAccumulator<?,​IndexedComponent>... accumulators)
    • countNodes

      public static int countNodes​(int fromIndex, IndexedNodeSet subgraph)
    • countEdges

      public static int countEdges​(int fromIndex, IndexedNodeSet subgraph)
    • calcDistances

      public static org.apache.commons.math3.linear.RealVector calcDistances​(int fromIndex, IndexedNodeSet inSet)