public class Graphs extends Object
| 构造器和说明 |
|---|
Graphs() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<List<Integer>> |
connectedComponents(BaseGraph graph)
obtain connected components of a **UNDIRECTED GRAPH**.
|
static boolean |
containsCycle(BaseGraph graph)
determine if a graph contains cycles.
|
static int |
edgesCountOf(BaseGraph graph)
compute the number of edges in a graph.
|
static BaseGraph |
empty()
construct a graph with no vertex and edge
|
static BaseGraph |
fullConnectedGraph(List<javax.vecmath.Point3d> vertices,
boolean isDirected) |
static BaseGraph |
graph(double[][] edges,
boolean directed)
construct a directed graph from given matrix
|
static BaseGraph |
knnGraph(List<javax.vecmath.Point3d> vertices,
List<int[]> knnIndices)
construct k-nearest-neighbor graph
|
static UndirectedGraph |
minimalSpanningTree(BaseGraph graph)
Construct a minimal spanning tree from a graph using Prim algorithm.
|
static BaseGraph |
subGraph(BaseGraph graph,
Set<Integer> vertices)
get a graph where the vertices is a sub-set of another graph
|
public static List<List<Integer>> connectedComponents(BaseGraph graph)
graph - an undirected graphpublic static boolean containsCycle(BaseGraph graph)
graph - a base graphpublic static UndirectedGraph minimalSpanningTree(BaseGraph graph)
graph - an undirected graphpublic static BaseGraph subGraph(BaseGraph graph, Set<Integer> vertices)
graph - another graphvertices - indices of verticespublic static int edgesCountOf(BaseGraph graph)
graph - a graphpublic static BaseGraph fullConnectedGraph(List<javax.vecmath.Point3d> vertices, boolean isDirected)
public static BaseGraph knnGraph(List<javax.vecmath.Point3d> vertices, List<int[]> knnIndices)
vertices - the verticesknnIndices - the k-nearest neighbors of verticespublic static BaseGraph graph(double[][] edges, boolean directed)
edges - the edges, a matrixdirected - if this graph is a directed graphpublic static BaseGraph empty()
Copyright © 2019. All rights reserved.