Uses of Interface
cloud.opencode.base.graph.Graph
Packages that use Graph
Package
Description
Graph Layout Algorithms - Algorithms for graph visualization layout
图布局算法 - 用于图可视化布局的算法
-
Uses of Graph in cloud.opencode.base.graph
Subinterfaces of Graph in cloud.opencode.base.graphClasses in cloud.opencode.base.graph that implement GraphModifier and TypeClassDescriptionclassDirected Graph 有向图final classImmutable Graph - An unmodifiable snapshot of a graph 不可变图 - 图的不可修改快照classUndirected Graph 无向图Methods in cloud.opencode.base.graph that return GraphModifier and TypeMethodDescriptionOpenGraph.condensation(Graph<V> graph) Get condensation graph (DAG of SCCs) 获取冷凝图(强连通分量的DAG)static <V> Graph<V> OpenGraph.directed()Create a directed graph 创建有向图static <V> Graph<V> GraphTransform.filterEdges(Graph<V> graph, Predicate<Edge<V>> predicate) Filter edges, keeping all vertices but only edges matching the predicate 过滤边,保留所有顶点但仅保留匹配谓词的边static <V> Graph<V> OpenGraph.filterEdges(Graph<V> graph, Predicate<Edge<V>> predicate) Filter edges from a graph by predicate 按谓词过滤图的边static <V> Graph<V> GraphTransform.filterVertices(Graph<V> graph, Predicate<V> predicate) Filter vertices, keeping only those matching the predicate (induced subgraph) 过滤顶点,仅保留匹配谓词的顶点(诱导子图)static <V> Graph<V> OpenGraph.filterVertices(Graph<V> graph, Predicate<V> predicate) Filter vertices from a graph by predicate 按谓词过滤图的顶点static <V,R> Graph <R> GraphTransform.mapVertices(Graph<V> graph, Function<V, R> mapper) Map all vertices to a new type, preserving edges and weights 将所有顶点映射为新类型,保留边和权重static <V,R> Graph <R> OpenGraph.mapVertices(Graph<V> graph, Function<V, R> mapper) Transform graph vertices using mapping function 使用映射函数转换图顶点static <V> Graph<V> Reverse all edges in a directed graph; for undirected graphs, return a copy 反转有向图的所有边;对于无向图,返回副本static <V> Graph<V> Reverse a directed graph 反转有向图Graph.snapshot()Create an immutable snapshot of this graph 创建此图的不可变快照static <V> Graph<V> Create an immutable snapshot of a graph 创建图的不可变快照static <V> Graph<V> OpenGraph.transitiveClosure(Graph<V> graph) Compute transitive closure of DAG 计算DAG的传递闭包static <V> Graph<V> OpenGraph.transitiveReduction(Graph<V> graph) Compute transitive reduction of DAG 计算DAG的传递归约static <V> Graph<V> OpenGraph.undirected()Create an undirected graph 创建无向图Methods in cloud.opencode.base.graph with parameters of type GraphModifier and TypeMethodDescriptionstatic <V> FloydWarshallUtil.AllPairsResult<V> OpenGraph.allPairsShortestPaths(Graph<V> graph) Floyd-Warshall all-pairs shortest paths Floyd-Warshall全源最短路径static <V> Set<V> OpenGraph.articulationPoints(Graph<V> graph) Find all articulation points (cut vertices) 查找所有关节点(割点)static <V> List<V> OpenGraph.aStar(Graph<V> graph, V source, V target, BiFunction<V, V, Double> heuristic) Find shortest path using A* algorithm 使用A*算法查找最短路径OpenGraph.bellmanFord(Graph<V> graph, V source) Bellman-Ford single-source shortest paths (supports negative weights) Bellman-Ford单源最短路径(支持负权边)static <V> List<V> Breadth-first search 广度优先搜索static <V> List<V> OpenGraph.bidirectionalBfs(Graph<V> graph, V source, V target) Find path using bidirectional BFS (efficient for large graphs) 使用双向BFS查找路径(对大图高效)static <V> BipartiteUtil.BipartiteResult<V> OpenGraph.bipartitePartition(Graph<V> graph) Compute bipartite partition or odd cycle witness 计算二部图分区或奇环证据Find all bridges (cut edges) 查找所有桥(割边)static <V> booleanOpenGraph.canTopologicalSort(Graph<V> graph) Check if topological sort is possible (graph is DAG) 检查是否可以进行拓扑排序(图是DAG)static <V> GraphDiff.DiffResult<V> Compare two graphs and compute their differences 比较两个图并计算差异static <V> NetworkFlowUtil.FlowResult<V> OpenGraph.computeFlow(Graph<V> graph, V source, V sink) Compute flow result with detailed information 计算包含详细信息的流结果OpenGraph.condensation(Graph<V> graph) Get condensation graph (DAG of SCCs) 获取冷凝图(强连通分量的DAG)static <V> intOpenGraph.connectedComponentCount(Graph<V> graph) Get the number of connected components 获取连通分量数量OpenGraph.connectedComponents(Graph<V> graph) Find all connected components 查找所有连通分量static <V> ImmutableGraph<V> Create an immutable copy of the given graph 创建给定图的不可变副本static <V> doubleGet graph density 获取图密度static <V> List<V> Depth-first search 深度优先搜索static <V> List<V> OpenGraph.dfsIterative(Graph<V> graph, V start) Safe iterative depth-first search (avoids stack overflow) 安全的迭代式深度优先搜索(避免栈溢出)static <V> intGet graph diameter 获取图直径static <V> GraphDiff.DiffResult<V> Compare two graphs and get differences 比较两个图并获取差异Dijkstra's shortest path algorithm Dijkstra最短路径算法static <V> Graph<V> GraphTransform.filterEdges(Graph<V> graph, Predicate<Edge<V>> predicate) Filter edges, keeping all vertices but only edges matching the predicate 过滤边,保留所有顶点但仅保留匹配谓词的边static <V> Graph<V> OpenGraph.filterEdges(Graph<V> graph, Predicate<Edge<V>> predicate) Filter edges from a graph by predicate 按谓词过滤图的边static <V> Graph<V> GraphTransform.filterVertices(Graph<V> graph, Predicate<V> predicate) Filter vertices, keeping only those matching the predicate (induced subgraph) 过滤顶点,仅保留匹配谓词的顶点(诱导子图)static <V> Graph<V> OpenGraph.filterVertices(Graph<V> graph, Predicate<V> predicate) Filter vertices from a graph by predicate 按谓词过滤图的顶点static <V> List<V> Find one cycle if exists 如果存在则找到一个环Get flow on each edge 获取每条边上的流量static <V> booleanCheck if graph contains a cycle 检查图是否包含环static <V> booleanOpenGraph.hasNegativeCycle(Graph<V> graph, V source) Check for negative weight cycle reachable from source 检查从源顶点可达的负权环static <V> booleanOpenGraph.hasSpanningTree(Graph<V> graph) Check if a graph has a spanning tree (is connected) 检查图是否有生成树(是否连通)static <V> booleanOpenGraph.isBiconnected(Graph<V> graph) Check if graph is biconnected 检查图是否双连通static <V> booleanOpenGraph.isBipartite(Graph<V> graph) Check if graph is bipartite 检查图是否为二部图static <V> booleanOpenGraph.isConnected(Graph<V> graph, V v1, V v2) Check if two vertices are connected 检查两个顶点是否连通static <V> booleanOpenGraph.isFullyConnected(Graph<V> graph) Check if graph is fully connected 检查图是否完全连通static <V> booleanOpenGraph.isStronglyConnected(Graph<V> graph) Check if graph is strongly connected 检查图是否强连通Find minimum spanning tree using Kruskal's algorithm 使用Kruskal算法查找最小生成树static <V> List<V> OpenGraph.longestPath(Graph<V> graph) Find longest path in DAG (critical path) 查找DAG中的最长路径(关键路径)static <V,R> Graph <R> GraphTransform.mapVertices(Graph<V> graph, Function<V, R> mapper) Map all vertices to a new type, preserving edges and weights 将所有顶点映射为新类型,保留边和权重static <V,R> Graph <R> OpenGraph.mapVertices(Graph<V> graph, Function<V, R> mapper) Transform graph vertices using mapping function 使用映射函数转换图顶点static <V> doubleCalculate maximum flow using Ford-Fulkerson algorithm (Edmonds-Karp) 使用Ford-Fulkerson算法(Edmonds-Karp)计算最大流Find minimum cut edges 查找最小割边static <V> doubleCalculate the total weight of the minimum spanning tree 计算最小生成树的总权重Find minimum spanning tree using Prim's algorithm 使用Prim算法查找最小生成树Find minimum spanning tree using Prim's algorithm starting from a vertex 使用Prim算法从指定顶点开始查找最小生成树static <V> Graph<V> Reverse all edges in a directed graph; for undirected graphs, return a copy 反转有向图的所有边;对于无向图,返回副本static <V> Graph<V> Reverse a directed graph 反转有向图static <V> List<V> OpenGraph.shortestPath(Graph<V> graph, V source, V target) Find shortest path between two vertices 查找两个顶点之间的最短路径static <V> Graph<V> Create an immutable snapshot of a graph 创建图的不可变快照OpenGraph.stronglyConnectedComponents(Graph<V> graph) Find all strongly connected components (Tarjan's algorithm) 查找所有强连通分量(Tarjan算法)static <V> GraphMetrics.GraphSummaryGet graph summary with all key metrics 获取包含所有关键指标的图摘要static <V> List<V> OpenGraph.topologicalSort(Graph<V> graph) Topological sort using Kahn's algorithm 使用Kahn算法进行拓扑排序static <V> Graph<V> OpenGraph.transitiveClosure(Graph<V> graph) Compute transitive closure of DAG 计算DAG的传递闭包static <V> Graph<V> OpenGraph.transitiveReduction(Graph<V> graph) Compute transitive reduction of DAG 计算DAG的传递归约 -
Uses of Graph in cloud.opencode.base.graph.algorithm
Methods in cloud.opencode.base.graph.algorithm that return GraphModifier and TypeMethodDescriptionstatic <V> Graph<V> SubgraphUtil.complement(Graph<V> graph) Create the complement of a graph.StronglyConnectedComponentsUtil.condensation(Graph<V> graph) Build the condensation graph (DAG of SCCs).static <V> Graph<V> Create a copy of the graph.static <V> Graph<V> SubgraphUtil.difference(Graph<V> g1, Graph<V> g2) Compute difference of two graphs (g1 - g2).static <V> Graph<V> SubgraphUtil.edgeInduced(Graph<V> graph, Set<Edge<V>> edges) Create edge-induced subgraph.static <V> Graph<V> SubgraphUtil.egoNetwork(Graph<V> graph, V ego) Extract ego network (1-hop neighborhood).static <V> Graph<V> SubgraphUtil.egoNetwork(Graph<V> graph, V ego, int radius) Extract ego network with specified radius.static <V> Graph<V> SubgraphUtil.filterByWeight(Graph<V> graph, double minWeight, double maxWeight) Filter edges by weight range.static <V> Graph<V> SubgraphUtil.filterEdges(Graph<V> graph, Predicate<Edge<V>> predicate) Filter graph by edge predicate.static <V> Graph<V> SubgraphUtil.filterVertices(Graph<V> graph, Predicate<V> predicate) Filter graph by vertex predicate.static <V> Graph<V> Create vertex-induced subgraph.static <V> Graph<V> SubgraphUtil.intersection(Graph<V> g1, Graph<V> g2) Compute intersection of two graphs.static <V> Graph<V> SubgraphUtil.neighborhood(Graph<V> graph, V center, int k) Extract k-hop neighborhood of a vertex.static <V> Graph<V> SubgraphUtil.removeIsolated(Graph<V> graph) Remove isolated vertices (vertices with no edges).static <V> Graph<V> Create a reversed (transposed) graph.static <V> Graph<V> SubgraphUtil.sampleEdges(Graph<V> graph, int numEdges, Random random) Sample a random subgraph with specified number of edges.static <V> Graph<V> SubgraphUtil.sampleVertices(Graph<V> graph, int numVertices, Random random) Sample a random subgraph with specified number of vertices.static <V> Graph<V> SubgraphUtil.symmetricDifference(Graph<V> g1, Graph<V> g2) Compute symmetric difference of two graphs.static <V> Graph<V> DagUtil.transitiveClosure(Graph<V> graph) Compute the transitive closure of a DAG.static <V> Graph<V> DagUtil.transitiveReduction(Graph<V> graph) Compute the transitive reduction of a DAG.static <V> Graph<V> Compute union of two graphs.Methods in cloud.opencode.base.graph.algorithm with parameters of type GraphModifier and TypeMethodDescriptionstatic <V> Set<V> Find all ancestors of a vertex (vertices that can reach this vertex).static <V> doubleGraphMetrics.averageClusteringCoefficient(Graph<V> graph) Compute the average clustering coefficient over all vertices 计算所有顶点的平均聚类系数static <V> doubleGraphMetrics.averagePathLength(Graph<V> graph) Compute the average shortest path length (BFS-based, unweighted) 计算平均最短路径长度(基于BFS,无权)CentralityUtil.betweennessCentrality(Graph<V> graph) Calculate betweenness centrality for all vertices.CentralityUtil.betweennessCentrality(Graph<V> graph, boolean normalized) Calculate betweenness centrality with optional normalization.static <V> List<V> Breadth-First Search 广度优先搜索static <V> voidBreadth-First Search with visitor 带访问器的广度优先搜索static <V> List<V> Traverse all vertices (handles disconnected components) 遍历所有顶点(处理不连通分量)static <V> List<V> SafeGraphTraversalUtil.bfsWithLimit(Graph<V> graph, V start, int maxDistance) BFS with maximum distance limit 带最大距离限制的BFSstatic <V> doubleCommunityDetectionUtil.calculateModularity(Graph<V> graph, List<Set<V>> communities) Calculates the modularity score for a given community partition.static <V> doubleCommunityDetectionUtil.calculateModularity(Graph<V> graph, List<Set<V>> communities, double resolution) Calculates the modularity score with resolution parameter.static <V> booleanCheck if a valid topological ordering exists 检查是否存在有效的拓扑排序static <V> Set<V> Find the center of a graph (vertices with eccentricity equal to the radius) 查找图的中心(离心率等于半径的顶点集合)CentralityUtil.closenessCentrality(Graph<V> graph) Calculate closeness centrality for all vertices.static <V> doubleGraphMetrics.clusteringCoefficient(Graph<V> graph, V vertex) Compute the local clustering coefficient of a vertex 计算顶点的局部聚类系数static <V> Graph<V> SubgraphUtil.complement(Graph<V> graph) Create the complement of a graph.static <V> intMinimumSpanningTreeUtil.componentCount(Graph<V> graph) Get the count of connected components after MST/MSF construction 获取MST/MSF构建后的连通分量数static <V> Set<V> StronglyConnectedComponentsUtil.componentOf(Graph<V> graph, V vertex) Find the SCC containing the given vertex.static <V> FloydWarshallUtil.AllPairsResult<V> Compute all-pairs shortest paths using Floyd-Warshall algorithm.static <V> NetworkFlowUtil.FlowResult<V> NetworkFlowUtil.computeFlow(Graph<V> graph, V source, V sink) Get the flow result with detailed information 获取包含详细信息的流结果StronglyConnectedComponentsUtil.condensation(Graph<V> graph) Build the condensation graph (DAG of SCCs).static <V> Graph<V> Create a copy of the graph.static <V> intGet the number of connected components 获取连通分量的数量static <V> intCount the number of strongly connected components.CentralityUtil.degreeCentrality(Graph<V> graph) Calculate degree centrality for all vertices.static <V> doubleCompute the edge density of a graph 计算图的边密度static <V> Set<V> DagUtil.descendants(Graph<V> graph, V vertex) Find all descendants of a vertex (vertices reachable from this vertex).static <V> List<V> Depth-First Search (iterative) 深度优先搜索(迭代)static <V> voidDepth-First Search with visitor (iterative) 带访问器的深度优先搜索(迭代)static <V> List<V> Traverse all vertices using DFS (handles disconnected components) 使用DFS遍历所有顶点(处理不连通分量)static <V> List<V> SafeGraphTraversalUtil.dfsIterative(Graph<V> graph, V start) Iterative Depth-First Search (avoids stack overflow) 迭代式深度优先搜索(避免栈溢出)static <V> voidSafeGraphTraversalUtil.dfsIterative(Graph<V> graph, V start, Consumer<V> visitor) Iterative DFS with visitor 带访问器的迭代式DFSstatic <V> List<V> SafeGraphTraversalUtil.dfsIterativeWithLimit(Graph<V> graph, V start, int maxDepth) Iterative depth-limited DFS 迭代式深度限制DFSstatic <V> List<V> SafeGraphTraversalUtil.dfsWithLimit(Graph<V> graph, V start, int maxDepth) Depth-limited DFS 深度限制的DFSstatic <V> intCompute the diameter of a graph (max eccentricity over all vertices) 计算图的直径(所有顶点的最大离心率)static <V> Graph<V> SubgraphUtil.difference(Graph<V> g1, Graph<V> g2) Compute difference of two graphs (g1 - g2).Dijkstra's algorithm for single-source shortest paths Dijkstra单源最短路径算法static <V> intGraphMetrics.eccentricity(Graph<V> graph, V vertex) Compute the eccentricity of a vertex (BFS-based, unweighted) 计算顶点的离心率(基于BFS,无权)static <V> Graph<V> SubgraphUtil.edgeInduced(Graph<V> graph, Set<Edge<V>> edges) Create edge-induced subgraph.static <V> Graph<V> SubgraphUtil.egoNetwork(Graph<V> graph, V ego) Extract ego network (1-hop neighborhood).static <V> Graph<V> SubgraphUtil.egoNetwork(Graph<V> graph, V ego, int radius) Extract ego network with specified radius.CentralityUtil.eigenvectorCentrality(Graph<V> graph) Calculate eigenvector centrality for all vertices.CentralityUtil.eigenvectorCentrality(Graph<V> graph, int maxIterations, double tolerance) Calculate eigenvector centrality with parameters.static <V> Graph<V> SubgraphUtil.filterByWeight(Graph<V> graph, double minWeight, double maxWeight) Filter edges by weight range.static <V> Graph<V> SubgraphUtil.filterEdges(Graph<V> graph, Predicate<Edge<V>> predicate) Filter graph by edge predicate.static <V> Graph<V> SubgraphUtil.filterVertices(Graph<V> graph, Predicate<V> predicate) Filter graph by vertex predicate.Find all connected components 查找所有连通分量Find all strongly connected components using Tarjan's algorithm.static <V> Set<V> ArticulationPointUtil.findArticulationPoints(Graph<V> graph) Find all articulation points (cut vertices) in the graph.ArticulationPointUtil.findBridges(Graph<V> graph) Find all bridges (cut edges) in the graph.static <V> List<V> Find one cycle if exists 如果存在环则找到一个static <V> List<V> BellmanFordUtil.findNegativeCycle(Graph<V> graph, V source) Find and return a negative cycle reachable from the given source vertex.static <V> List<V> Find path with zero heuristic (equivalent to Dijkstra) 使用零启发式函数查找路径(等同于Dijkstra)static <V> List<V> AStarUtil.findPath(Graph<V> graph, V source, V target, BiFunction<V, V, Double> heuristic) Find shortest path using A* algorithm 使用A*算法查找最短路径static <V> List<V> Find path using bidirectional BFS 使用双向BFS查找路径static <V> AStarUtil.PathResult<V> AStarUtil.findPathDetailed(Graph<V> graph, V source, V target, BiFunction<V, V, Double> heuristic) Find path with detailed result 查找路径并返回详细结果static <V> List<V> AStarUtil.findPathWithCostLimit(Graph<V> graph, V source, V target, BiFunction<V, V, Double> heuristic, double maxCost) Find path with cost limit 使用成本限制查找路径static <V> Set<V> BidirectionalBfsUtil.findVerticesOnPath(Graph<V> graph, V source, V target, int maxDistance) Find all vertices within a certain distance using bidirectional approach 使用双向方法查找特定距离内的所有顶点static <V> Set<V> ConnectedComponentsUtil.getComponentContaining(Graph<V> graph, V vertex) Get the component containing a specific vertex 获取包含特定顶点的分量TopologicalSortUtil.getDependencyDepths(Graph<V> graph) Get the dependency depth (longest path length) for each vertex 获取每个顶点的依赖深度(最长路径长度)Get flow on each edge 获取每条边上的流量static <V> Set<V> ConnectedComponentsUtil.getLargestComponent(Graph<V> graph) Get the largest connected component 获取最大连通分量static <V> Set<V> TopologicalSortUtil.getSinkVertices(Graph<V> graph) Get vertices with no dependents (out-degree 0) 获取无被依赖的顶点(出度为0)static <V> Set<V> ConnectedComponentsUtil.getSmallestComponent(Graph<V> graph) Get the smallest connected component 获取最小连通分量static <V> Set<V> TopologicalSortUtil.getSourceVertices(Graph<V> graph) Get vertices with no dependencies (in-degree 0) 获取无依赖的顶点(入度为0)static <V> booleanCheck if graph contains a cycle 检查图是否包含环static <V> booleanBellmanFordUtil.hasNegativeCycle(Graph<V> graph, V source) Check if a negative cycle is reachable from the given source vertex.static <V> booleanCheck if path exists using bidirectional BFS 使用双向BFS检查路径是否存在static <V> booleanCheck if a path exists between two vertices 检查两个顶点之间是否存在路径static <V> booleanMinimumSpanningTreeUtil.hasSpanningTree(Graph<V> graph) Check if a graph has a spanning tree (is connected) 检查图是否有生成树(是否连通)CentralityUtil.inDegreeCentrality(Graph<V> graph) Calculate in-degree centrality for directed graphs.static <V> Graph<V> Create vertex-induced subgraph.static <V> Graph<V> SubgraphUtil.intersection(Graph<V> g1, Graph<V> g2) Compute intersection of two graphs.static <V> booleanArticulationPointUtil.isBiconnected(Graph<V> graph) Check if the graph is biconnected.static <V> booleanBipartiteUtil.isBipartite(Graph<V> graph) Check if the graph is bipartite.static <V> booleanConnectedComponentsUtil.isConnected(Graph<V> graph, V v1, V v2) Check if two vertices are connected 检查两个顶点是否连通static <V> booleanConnectedComponentsUtil.isFullyConnected(Graph<V> graph) Check if graph is fully connected (single component) 检查图是否完全连通(单一分量)static <V> booleanStronglyConnectedComponentsUtil.isStronglyConnected(Graph<V> graph) Check if the entire graph is strongly connected.CentralityUtil.katzCentrality(Graph<V> graph, double alpha, double beta) Calculate Katz centrality for all vertices.CentralityUtil.katzCentrality(Graph<V> graph, double alpha, double beta, int maxIterations, double tolerance) Calculate Katz centrality with full parameters.Find minimum spanning tree using Kruskal's algorithm 使用Kruskal算法查找最小生成树static <V> CommunityDetectionUtil.CommunityResult<V> CommunityDetectionUtil.labelPropagation(Graph<V> graph) Detects communities using Label Propagation algorithm.static <V> CommunityDetectionUtil.CommunityResult<V> CommunityDetectionUtil.labelPropagation(Graph<V> graph, int maxIterations) Detects communities using Label Propagation with max iterations.static <V> List<V> DagUtil.longestPath(Graph<V> graph) Find the longest path in the DAG (critical path).static <V> List<V> DagUtil.longestPath(Graph<V> graph, V source, V target) Find the longest path between two specific vertices in the DAG.static <V> doubleDagUtil.longestPathLength(Graph<V> graph) Compute the length (sum of edge weights) of the longest path in the DAG.static <V> CommunityDetectionUtil.CommunityResult<V> Detects communities using the Louvain algorithm.static <V> CommunityDetectionUtil.CommunityResult<V> Detects communities using the Louvain algorithm with parameters.static <V> doubleCalculate maximum flow using Ford-Fulkerson algorithm with BFS (Edmonds-Karp) 使用BFS的Ford-Fulkerson算法(Edmonds-Karp)计算最大流static <V> doubleNetworkFlowUtil.maxFlowDfs(Graph<V> graph, V source, V sink) Calculate maximum flow using Ford-Fulkerson with DFS 使用DFS的Ford-Fulkerson算法计算最大流Find minimum cut edges 查找最小割边static <V> doubleNetworkFlowUtil.minCutCapacity(Graph<V> graph, V source, V sink) Calculate min-cut capacity 计算最小割容量MinimumSpanningTreeUtil.minimumSpanningForest(Graph<V> graph) Find minimum spanning forest for disconnected graph 为不连通图查找最小生成森林static <V> doubleCalculate the total weight of the minimum spanning tree 计算最小生成树的总权重static <V> Graph<V> SubgraphUtil.neighborhood(Graph<V> graph, V center, int k) Extract k-hop neighborhood of a vertex.CentralityUtil.outDegreeCentrality(Graph<V> graph) Calculate out-degree centrality for directed graphs.Calculate PageRank for all vertices using default parameters.Calculate PageRank for all vertices.Calculate PageRank with convergence tolerance.static <V> BipartiteUtil.BipartiteResult<V> Compute the bipartite partition or find an odd cycle witness.Find minimum spanning tree using Prim's algorithm (auto-select start) 使用Prim算法查找最小生成树(自动选择起点)Find minimum spanning tree using Prim's algorithm 使用Prim算法查找最小生成树static <V> intCompute the radius of a graph (min eccentricity over all vertices) 计算图的半径(所有顶点的最小离心率)static <V> Graph<V> SubgraphUtil.removeIsolated(Graph<V> graph) Remove isolated vertices (vertices with no edges).static <V> Graph<V> Create a reversed (transposed) graph.static <V> Graph<V> SubgraphUtil.sampleEdges(Graph<V> graph, int numEdges, Random random) Sample a random subgraph with specified number of edges.static <V> Graph<V> SubgraphUtil.sampleVertices(Graph<V> graph, int numVertices, Random random) Sample a random subgraph with specified number of vertices.static <V> doubleShortestPathUtil.shortestDistance(Graph<V> graph, V source, V target) Get the shortest distance between two vertices 获取两个顶点之间的最短距离static <V> List<V> BellmanFordUtil.shortestPath(Graph<V> graph, V source, V target) Find shortest path between two vertices using Bellman-Ford algorithm.static <V> List<V> ShortestPathUtil.shortestPath(Graph<V> graph, V source, V target) Find shortest path between two vertices 查找两个顶点之间的最短路径static <V> intBidirectionalBfsUtil.shortestPathLength(Graph<V> graph, V source, V target) Find shortest path distance using bidirectional BFS (unweighted) 使用双向BFS查找最短路径距离(无权重)BellmanFordUtil.shortestPaths(Graph<V> graph, V source) Compute single-source shortest paths using Bellman-Ford algorithm.static <V> List<V> Topological sort using Kahn's algorithm 使用Kahn算法进行拓扑排序static <V> List<V> Topological sort using DFS 使用DFS进行拓扑排序static <V> GraphMetrics.GraphSummaryCompute a full summary of graph metrics 计算完整的图度量摘要static <V> Graph<V> SubgraphUtil.symmetricDifference(Graph<V> g1, Graph<V> g2) Compute symmetric difference of two graphs.static <V> Graph<V> DagUtil.transitiveClosure(Graph<V> graph) Compute the transitive closure of a DAG.static <V> Graph<V> DagUtil.transitiveReduction(Graph<V> graph) Compute the transitive reduction of a DAG.static <V> Graph<V> Compute union of two graphs.static <V> booleanCycleDetectionUtil.wouldCreateCycle(Graph<V> graph, V from, V to) Check if adding an edge would create a cycle 检查添加边是否会创建环 -
Uses of Graph in cloud.opencode.base.graph.builder
Methods in cloud.opencode.base.graph.builder that return Graph -
Uses of Graph in cloud.opencode.base.graph.layout
Methods in cloud.opencode.base.graph.layout with parameters of type GraphModifier and TypeMethodDescriptionstatic <V> Map<V, LayoutUtil.Point2D> Compute circular layout with default center.static <V> Map<V, LayoutUtil.Point2D> Compute circular layout.static <V> Map<V, LayoutUtil.Point2D> LayoutUtil.forceDirected(Graph<V> graph, double width, double height) Compute force-directed layout using Fruchterman-Reingold algorithm.static <V> Map<V, LayoutUtil.Point2D> LayoutUtil.forceDirected(Graph<V> graph, double width, double height, int iterations) Compute force-directed layout with custom iterations.static <V> Map<V, LayoutUtil.Point2D> Compute grid layout.static <V> Map<V, LayoutUtil.Point2D> LayoutUtil.hierarchical(Graph<V> graph, double width, double height) Compute hierarchical layout (top-down).static <V> Map<V, LayoutUtil.Point2D> Compute random layout.static <V> Map<V, LayoutUtil.Point2D> Compute spring layout (simplified force-directed).static <V> Map<V, LayoutUtil.Point2D> Compute spring layout with custom parameters. -
Uses of Graph in cloud.opencode.base.graph.security
Methods in cloud.opencode.base.graph.security with parameters of type GraphModifier and TypeMethodDescriptionstatic <V> voidSafeGraphOperations.safeAddEdge(Graph<V> graph, V from, V to) Safely add an edge with limit check 安全添加边(带限制检查)static <V> voidSafeGraphOperations.safeAddEdge(Graph<V> graph, V from, V to, double weight) Safely add an edge with weight and limit check 安全添加带权重的边(带限制检查)static <V> voidSafeGraphOperations.safeAddVertex(Graph<V> graph, V vertex) Safely add a vertex with limit check 安全添加顶点(带限制检查)SafeGraphOperations.safeDijkstra(Graph<V> graph, V source) Safely compute Dijkstra distances with timeout 安全计算Dijkstra距离(带超时)static <V> List<V> SafeGraphOperations.safeShortestPath(Graph<V> graph, V source, V target) Safely compute shortest path with timeout 安全计算最短路径(带超时)static <V> booleanSafeGraphOperations.wouldExceedEdgeLimit(Graph<V> graph) Check if adding edge would exceed limit 检查添加边是否会超出限制static <V> booleanSafeGraphOperations.wouldExceedVertexLimit(Graph<V> graph) Check if adding vertex would exceed limit 检查添加顶点是否会超出限制 -
Uses of Graph in cloud.opencode.base.graph.serializer
Methods in cloud.opencode.base.graph.serializer that return GraphModifier and TypeMethodDescriptionGraphSerializer.fromAdjacencyList(String input, boolean directed) Parse graph from adjacency list format 从邻接表格式解析图GraphSerializer.fromEdgeList(String input, boolean directed) Parse graph from edge list format 从边列表格式解析图Import graph from GEXF string.GexfUtil.fromGexf(String gexf, Map<String, Map<String, String>> vertexAttributes, Map<String, GexfUtil.VisualData> visualData) Import graph from GEXF string with attribute and visual data maps.GraphMLUtil.fromGraphML(String graphml) Import graph from GraphML string.GraphMLUtil.fromGraphML(String graphml, Map<String, Map<String, String>> vertexAttributes, Map<String, Map<String, String>> edgeAttributes) Import graph from GraphML string with attribute maps.GexfUtil.readFromFile(Path path) Read graph from GEXF file.GexfUtil.readFromFile(Path path, Map<String, Map<String, String>> vertexAttributes, Map<String, GexfUtil.VisualData> visualData) Read graph from GEXF file with attribute and visual data maps.GraphMLUtil.readFromFile(Path path) Read graph from GraphML file.GraphMLUtil.readFromFile(Path path, Map<String, Map<String, String>> vertexAttributes, Map<String, Map<String, String>> edgeAttributes) Read graph from GraphML file with attribute maps.Methods in cloud.opencode.base.graph.serializer with parameters of type GraphModifier and TypeMethodDescriptionstatic <V> StringGraphSerializer.getStatistics(Graph<V> graph) Get graph statistics as string 获取图统计信息字符串static <V> StringGraphSerializer.toAdjacencyList(Graph<V> graph) Convert graph to adjacency list format 将图转换为邻接表格式static <V> StringConvert graph to DOT format (Graphviz) 将图转换为DOT格式(Graphviz)static <V> StringConvert graph to DOT format with custom name 将图转换为带自定义名称的DOT格式static <V> StringGraphSerializer.toEdgeList(Graph<V> graph) Convert graph to edge list format 将图转换为边列表格式static <V> StringExport graph to GEXF format.static <V> StringGexfUtil.toGexf(Graph<V> graph, Map<V, Map<String, String>> vertexAttributes, Map<V, GexfUtil.VisualData> visualData) Export graph to GEXF format with attributes and visual data.static <V> StringExport graph to GraphML format.static <V> StringGraphMLUtil.toGraphML(Graph<V> graph, Map<V, Map<String, String>> vertexAttributes, Map<String, Map<String, String>> edgeAttributes) Export graph to GraphML format with attributes.static <V> voidGexfUtil.writeToFile(Graph<V> graph, Path path) Write graph to GEXF file.static <V> voidGexfUtil.writeToFile(Graph<V> graph, Path path, Map<V, Map<String, String>> vertexAttributes, Map<V, GexfUtil.VisualData> visualData) Write graph to GEXF file with attributes and visual data.static <V> voidGraphMLUtil.writeToFile(Graph<V> graph, Path path) Write graph to GraphML file.static <V> voidGraphMLUtil.writeToFile(Graph<V> graph, Path path, Map<V, Map<String, String>> vertexAttributes, Map<String, Map<String, String>> edgeAttributes) Write graph to GraphML file with attributes. -
Uses of Graph in cloud.opencode.base.graph.validation
Methods in cloud.opencode.base.graph.validation with parameters of type GraphModifier and TypeMethodDescriptionstatic <V> booleanGraphValidator.edgeExists(Graph<V> graph, V from, V to) Validate edge exists in graph 验证边在图中存在static <V> ValidationResultGraphValidator.validateDAG(Graph<V> graph) Check if graph is a valid DAG (Directed Acyclic Graph) 检查图是否为有效的DAG(有向无环图)static <V> ValidationResultGraphValidator.validateGraph(Graph<V> graph) Validate graph structure 验证图结构static <V> voidGraphValidator.validateGraphStructure(Graph<V> graph) Validate graph structure and throw exception if errors found 验证图结构,如果发现错误则抛出异常static <V> booleanGraphValidator.vertexExists(Graph<V> graph, V vertex) Validate vertex exists in graph 验证顶点在图中存在