Package jline.util.graph
Class UndirectedGraph
java.lang.Object
jline.util.graph.UndirectedGraph
An undirected graph data structure with weighted edges represented as an adjacency matrix.
This class provides graph algorithms for undirected graphs including connected component detection and graph analysis. The adjacency matrix is symmetric, with edges (i,j) and (j,i) having the same weight.
Key features:
- Weakly connected component (WCC) detection
- Symmetric adjacency matrix representation
- Weighted edge support with normalization options
- Column filtering for selective analysis
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUndirectedGraph(Matrix param) UndirectedGraph(Matrix param, Set<Integer> colsToIgnore) Constructs an undirected graph with the given adjacency matrix and column filter.UndirectedGraph(Matrix param, Set<Integer> colsToIgnore, boolean normalize) Constructs an undirected graph with optional weight normalization. -
Method Summary
-
Constructor Details
-
UndirectedGraph
Constructs an undirected graph with the given adjacency matrix and column filter. Weights for bidirectional edges are summed.- Parameters:
param- adjacency matrix where entry (i,j) represents edge weightcolsToIgnore- set of column indices to ignore, can be null
-
UndirectedGraph
Constructs an undirected graph with optional weight normalization.- Parameters:
param- adjacency matrix where entry (i,j) represents edge weightcolsToIgnore- set of column indices to ignore, can be nullnormalize- if true, weights are averaged for links (i,j) and (j,i); if false, weights are summed
-
UndirectedGraph
-
-
Method Details
-
addEdge
public void addEdge(int s, int d, double weight) -
computeWeaklyConnectedComponents
public void computeWeaklyConnectedComponents() -
findCC
-
getWCC
-
toMatrix
-