Package org.vanted.indexednodes
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 Summary
Modifier and Type Method Description static void
breadthFirstSearch(int startNode, IndexedNodeSet subgraph, StatefulAccumulator<?,IndexedComponent>... accumulators)
static org.apache.commons.math3.linear.RealVector
calcDistances(int fromIndex, IndexedNodeSet inSet)
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.static int
countEdges(int fromIndex, IndexedNodeSet subgraph)
static int
countNodes(int fromIndex, IndexedNodeSet subgraph)
static List<IndexedComponent>
getComponents(IndexedNodeSet subgraph)
Get all connected components in the induced `subgraph`
-
Method Details
-
getComponents
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
-
countEdges
-
calcDistances
public static org.apache.commons.math3.linear.RealVector calcDistances(int fromIndex, IndexedNodeSet inSet)
-