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.graph
    Modifier and Type
    Interface
    Description
    interface 
    Weighted Graph 加权图
    Classes in cloud.opencode.base.graph that implement Graph
    Modifier and Type
    Class
    Description
    class 
    Directed Graph 有向图
    final class 
    Immutable Graph - An unmodifiable snapshot of a graph 不可变图 - 图的不可修改快照
    class 
    Undirected Graph 无向图
    Methods in cloud.opencode.base.graph that return Graph
    Modifier and Type
    Method
    Description
    static <V> Graph<Set<V>>
    OpenGraph.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>
    GraphTransform.reverse(Graph<V> graph)
    Reverse all edges in a directed graph; for undirected graphs, return a copy 反转有向图的所有边;对于无向图,返回副本
    static <V> Graph<V>
    OpenGraph.reverse(Graph<V> graph)
    Reverse a directed graph 反转有向图
    default Graph<V>
    Graph.snapshot()
    Create an immutable snapshot of this graph 创建此图的不可变快照
    static <V> Graph<V>
    OpenGraph.snapshot(Graph<V> graph)
    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 Graph
    Modifier and Type
    Method
    Description
    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*算法查找最短路径
    static <V> Map<V,Double>
    OpenGraph.bellmanFord(Graph<V> graph, V source)
    Bellman-Ford single-source shortest paths (supports negative weights) Bellman-Ford单源最短路径(支持负权边)
    static <V> List<V>
    OpenGraph.bfs(Graph<V> graph, V start)
    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查找路径(对大图高效)
    OpenGraph.bipartitePartition(Graph<V> graph)
    Compute bipartite partition or odd cycle witness 计算二部图分区或奇环证据
    static <V> Set<Edge<V>>
    OpenGraph.bridges(Graph<V> graph)
    Find all bridges (cut edges) 查找所有桥(割边)
    static <V> boolean
    OpenGraph.canTopologicalSort(Graph<V> graph)
    Check if topological sort is possible (graph is DAG) 检查是否可以进行拓扑排序(图是DAG)
    static <V> GraphDiff.DiffResult<V>
    GraphDiff.compare(Graph<V> before, Graph<V> after)
    Compare two graphs and compute their differences 比较两个图并计算差异
    OpenGraph.computeFlow(Graph<V> graph, V source, V sink)
    Compute flow result with detailed information 计算包含详细信息的流结果
    static <V> Graph<Set<V>>
    OpenGraph.condensation(Graph<V> graph)
    Get condensation graph (DAG of SCCs) 获取冷凝图(强连通分量的DAG)
    static <V> int
    OpenGraph.connectedComponentCount(Graph<V> graph)
    Get the number of connected components 获取连通分量数量
    static <V> List<Set<V>>
    OpenGraph.connectedComponents(Graph<V> graph)
    Find all connected components 查找所有连通分量
    static <V> ImmutableGraph<V>
    ImmutableGraph.copyOf(Graph<V> graph)
    Create an immutable copy of the given graph 创建给定图的不可变副本
    static <V> double
    OpenGraph.density(Graph<V> graph)
    Get graph density 获取图密度
    static <V> List<V>
    OpenGraph.dfs(Graph<V> graph, V start)
    Depth-first search 深度优先搜索
    static <V> List<V>
    OpenGraph.dfsIterative(Graph<V> graph, V start)
    Safe iterative depth-first search (avoids stack overflow) 安全的迭代式深度优先搜索(避免栈溢出)
    static <V> int
    OpenGraph.diameter(Graph<V> graph)
    Get graph diameter 获取图直径
    static <V> GraphDiff.DiffResult<V>
    OpenGraph.diff(Graph<V> before, Graph<V> after)
    Compare two graphs and get differences 比较两个图并获取差异
    static <V> Map<V,Double>
    OpenGraph.dijkstra(Graph<V> graph, V source)
    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>
    OpenGraph.findCycle(Graph<V> graph)
    Find one cycle if exists 如果存在则找到一个环
    static <V> Map<Edge<V>,Double>
    OpenGraph.getFlows(Graph<V> graph, V source, V sink)
    Get flow on each edge 获取每条边上的流量
    static <V> boolean
    OpenGraph.hasCycle(Graph<V> graph)
    Check if graph contains a cycle 检查图是否包含环
    static <V> boolean
    OpenGraph.hasNegativeCycle(Graph<V> graph, V source)
    Check for negative weight cycle reachable from source 检查从源顶点可达的负权环
    static <V> boolean
    OpenGraph.hasSpanningTree(Graph<V> graph)
    Check if a graph has a spanning tree (is connected) 检查图是否有生成树(是否连通)
    static <V> boolean
    OpenGraph.isBiconnected(Graph<V> graph)
    Check if graph is biconnected 检查图是否双连通
    static <V> boolean
    OpenGraph.isBipartite(Graph<V> graph)
    Check if graph is bipartite 检查图是否为二部图
    static <V> boolean
    OpenGraph.isConnected(Graph<V> graph, V v1, V v2)
    Check if two vertices are connected 检查两个顶点是否连通
    static <V> boolean
    OpenGraph.isFullyConnected(Graph<V> graph)
    Check if graph is fully connected 检查图是否完全连通
    static <V> boolean
    OpenGraph.isStronglyConnected(Graph<V> graph)
    Check if graph is strongly connected 检查图是否强连通
    static <V> Set<Edge<V>>
    OpenGraph.kruskal(Graph<V> graph)
    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> double
    OpenGraph.maxFlow(Graph<V> graph, V source, V sink)
    Calculate maximum flow using Ford-Fulkerson algorithm (Edmonds-Karp) 使用Ford-Fulkerson算法(Edmonds-Karp)计算最大流
    static <V> Set<Edge<V>>
    OpenGraph.minCut(Graph<V> graph, V source, V sink)
    Find minimum cut edges 查找最小割边
    static <V> double
    OpenGraph.mstWeight(Graph<V> graph)
    Calculate the total weight of the minimum spanning tree 计算最小生成树的总权重
    static <V> Set<Edge<V>>
    OpenGraph.prim(Graph<V> graph)
    Find minimum spanning tree using Prim's algorithm 使用Prim算法查找最小生成树
    static <V> Set<Edge<V>>
    OpenGraph.prim(Graph<V> graph, V start)
    Find minimum spanning tree using Prim's algorithm starting from a vertex 使用Prim算法从指定顶点开始查找最小生成树
    static <V> Graph<V>
    GraphTransform.reverse(Graph<V> graph)
    Reverse all edges in a directed graph; for undirected graphs, return a copy 反转有向图的所有边;对于无向图,返回副本
    static <V> Graph<V>
    OpenGraph.reverse(Graph<V> graph)
    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>
    OpenGraph.snapshot(Graph<V> graph)
    Create an immutable snapshot of a graph 创建图的不可变快照
    static <V> List<Set<V>>
    OpenGraph.stronglyConnectedComponents(Graph<V> graph)
    Find all strongly connected components (Tarjan's algorithm) 查找所有强连通分量(Tarjan算法)
    OpenGraph.summary(Graph<V> graph)
    Get 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

    Modifier and Type
    Method
    Description
    static <V> Graph<V>
    SubgraphUtil.complement(Graph<V> graph)
    Create the complement of a graph.
    static <V> Graph<Set<V>>
    StronglyConnectedComponentsUtil.condensation(Graph<V> graph)
    Build the condensation graph (DAG of SCCs).
    static <V> Graph<V>
    SubgraphUtil.copy(Graph<V> graph)
    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>
    SubgraphUtil.induced(Graph<V> graph, Set<V> vertices)
    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>
    SubgraphUtil.reverse(Graph<V> graph)
    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>
    SubgraphUtil.union(Graph<V> g1, Graph<V> g2)
    Compute union of two graphs.
    Methods in cloud.opencode.base.graph.algorithm with parameters of type Graph
    Modifier and Type
    Method
    Description
    static <V> Set<V>
    DagUtil.ancestors(Graph<V> graph, V vertex)
    Find all ancestors of a vertex (vertices that can reach this vertex).
    static <V> double
    GraphMetrics.averageClusteringCoefficient(Graph<V> graph)
    Compute the average clustering coefficient over all vertices 计算所有顶点的平均聚类系数
    static <V> double
    GraphMetrics.averagePathLength(Graph<V> graph)
    Compute the average shortest path length (BFS-based, unweighted) 计算平均最短路径长度(基于BFS,无权)
    static <V> Map<V,Double>
    CentralityUtil.betweennessCentrality(Graph<V> graph)
    Calculate betweenness centrality for all vertices.
    static <V> Map<V,Double>
    CentralityUtil.betweennessCentrality(Graph<V> graph, boolean normalized)
    Calculate betweenness centrality with optional normalization.
    static <V> List<V>
    GraphTraversalUtil.bfs(Graph<V> graph, V start)
    Breadth-First Search 广度优先搜索
    static <V> void
    GraphTraversalUtil.bfs(Graph<V> graph, V start, Consumer<V> visitor)
    Breadth-First Search with visitor 带访问器的广度优先搜索
    static <V> List<V>
    GraphTraversalUtil.bfsAll(Graph<V> graph)
    Traverse all vertices (handles disconnected components) 遍历所有顶点(处理不连通分量)
    static <V> List<V>
    SafeGraphTraversalUtil.bfsWithLimit(Graph<V> graph, V start, int maxDistance)
    BFS with maximum distance limit 带最大距离限制的BFS
    static <V> double
    CommunityDetectionUtil.calculateModularity(Graph<V> graph, List<Set<V>> communities)
    Calculates the modularity score for a given community partition.
    static <V> double
    CommunityDetectionUtil.calculateModularity(Graph<V> graph, List<Set<V>> communities, double resolution)
    Calculates the modularity score with resolution parameter.
    static <V> boolean
    TopologicalSortUtil.canSort(Graph<V> graph)
    Check if a valid topological ordering exists 检查是否存在有效的拓扑排序
    static <V> Set<V>
    GraphMetrics.center(Graph<V> graph)
    Find the center of a graph (vertices with eccentricity equal to the radius) 查找图的中心(离心率等于半径的顶点集合)
    static <V> Map<V,Double>
    CentralityUtil.closenessCentrality(Graph<V> graph)
    Calculate closeness centrality for all vertices.
    static <V> double
    GraphMetrics.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> int
    MinimumSpanningTreeUtil.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.
    FloydWarshallUtil.compute(Graph<V> graph)
    Compute all-pairs shortest paths using Floyd-Warshall algorithm.
    NetworkFlowUtil.computeFlow(Graph<V> graph, V source, V sink)
    Get the flow result with detailed information 获取包含详细信息的流结果
    static <V> Graph<Set<V>>
    StronglyConnectedComponentsUtil.condensation(Graph<V> graph)
    Build the condensation graph (DAG of SCCs).
    static <V> Graph<V>
    SubgraphUtil.copy(Graph<V> graph)
    Create a copy of the graph.
    static <V> int
    ConnectedComponentsUtil.count(Graph<V> graph)
    Get the number of connected components 获取连通分量的数量
    static <V> int
    StronglyConnectedComponentsUtil.count(Graph<V> graph)
    Count the number of strongly connected components.
    static <V> Map<V,Double>
    CentralityUtil.degreeCentrality(Graph<V> graph)
    Calculate degree centrality for all vertices.
    static <V> double
    GraphMetrics.density(Graph<V> graph)
    Compute 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>
    GraphTraversalUtil.dfs(Graph<V> graph, V start)
    Depth-First Search (iterative) 深度优先搜索(迭代)
    static <V> void
    GraphTraversalUtil.dfs(Graph<V> graph, V start, Consumer<V> visitor)
    Depth-First Search with visitor (iterative) 带访问器的深度优先搜索(迭代)
    static <V> List<V>
    GraphTraversalUtil.dfsAll(Graph<V> graph)
    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> void
    SafeGraphTraversalUtil.dfsIterative(Graph<V> graph, V start, Consumer<V> visitor)
    Iterative DFS with visitor 带访问器的迭代式DFS
    static <V> List<V>
    SafeGraphTraversalUtil.dfsIterativeWithLimit(Graph<V> graph, V start, int maxDepth)
    Iterative depth-limited DFS 迭代式深度限制DFS
    static <V> List<V>
    SafeGraphTraversalUtil.dfsWithLimit(Graph<V> graph, V start, int maxDepth)
    Depth-limited DFS 深度限制的DFS
    static <V> int
    GraphMetrics.diameter(Graph<V> graph)
    Compute 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).
    static <V> Map<V,Double>
    ShortestPathUtil.dijkstra(Graph<V> graph, V source)
    Dijkstra's algorithm for single-source shortest paths Dijkstra单源最短路径算法
    static <V> int
    GraphMetrics.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.
    static <V> Map<V,Double>
    CentralityUtil.eigenvectorCentrality(Graph<V> graph)
    Calculate eigenvector centrality for all vertices.
    static <V> Map<V,Double>
    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.
    static <V> List<Set<V>>
    ConnectedComponentsUtil.find(Graph<V> graph)
    Find all connected components 查找所有连通分量
    static <V> List<Set<V>>
    StronglyConnectedComponentsUtil.find(Graph<V> graph)
    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.
    static <V> Set<Edge<V>>
    ArticulationPointUtil.findBridges(Graph<V> graph)
    Find all bridges (cut edges) in the graph.
    static <V> List<V>
    CycleDetectionUtil.findCycle(Graph<V> graph)
    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>
    AStarUtil.findPath(Graph<V> graph, V source, V target)
    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>
    BidirectionalBfsUtil.findPath(Graph<V> graph, V source, V target)
    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 获取包含特定顶点的分量
    static <V> Map<V,Integer>
    TopologicalSortUtil.getDependencyDepths(Graph<V> graph)
    Get the dependency depth (longest path length) for each vertex 获取每个顶点的依赖深度(最长路径长度)
    static <V> Map<Edge<V>,Double>
    NetworkFlowUtil.getFlows(Graph<V> graph, V source, V sink)
    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> boolean
    CycleDetectionUtil.hasCycle(Graph<V> graph)
    Check if graph contains a cycle 检查图是否包含环
    static <V> boolean
    BellmanFordUtil.hasNegativeCycle(Graph<V> graph, V source)
    Check if a negative cycle is reachable from the given source vertex.
    static <V> boolean
    BidirectionalBfsUtil.hasPath(Graph<V> graph, V source, V target)
    Check if path exists using bidirectional BFS 使用双向BFS检查路径是否存在
    static <V> boolean
    ShortestPathUtil.hasPath(Graph<V> graph, V source, V target)
    Check if a path exists between two vertices 检查两个顶点之间是否存在路径
    static <V> boolean
    MinimumSpanningTreeUtil.hasSpanningTree(Graph<V> graph)
    Check if a graph has a spanning tree (is connected) 检查图是否有生成树(是否连通)
    static <V> Map<V,Double>
    CentralityUtil.inDegreeCentrality(Graph<V> graph)
    Calculate in-degree centrality for directed graphs.
    static <V> Graph<V>
    SubgraphUtil.induced(Graph<V> graph, Set<V> vertices)
    Create vertex-induced subgraph.
    static <V> Graph<V>
    SubgraphUtil.intersection(Graph<V> g1, Graph<V> g2)
    Compute intersection of two graphs.
    static <V> boolean
    ArticulationPointUtil.isBiconnected(Graph<V> graph)
    Check if the graph is biconnected.
    static <V> boolean
    BipartiteUtil.isBipartite(Graph<V> graph)
    Check if the graph is bipartite.
    static <V> boolean
    ConnectedComponentsUtil.isConnected(Graph<V> graph, V v1, V v2)
    Check if two vertices are connected 检查两个顶点是否连通
    static <V> boolean
    ConnectedComponentsUtil.isFullyConnected(Graph<V> graph)
    Check if graph is fully connected (single component) 检查图是否完全连通(单一分量)
    static <V> boolean
    StronglyConnectedComponentsUtil.isStronglyConnected(Graph<V> graph)
    Check if the entire graph is strongly connected.
    static <V> Map<V,Double>
    CentralityUtil.katzCentrality(Graph<V> graph, double alpha, double beta)
    Calculate Katz centrality for all vertices.
    static <V> Map<V,Double>
    CentralityUtil.katzCentrality(Graph<V> graph, double alpha, double beta, int maxIterations, double tolerance)
    Calculate Katz centrality with full parameters.
    static <V> Set<Edge<V>>
    MinimumSpanningTreeUtil.kruskal(Graph<V> graph)
    Find minimum spanning tree using Kruskal's algorithm 使用Kruskal算法查找最小生成树
    CommunityDetectionUtil.labelPropagation(Graph<V> graph)
    Detects communities using Label Propagation algorithm.
    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> double
    DagUtil.longestPathLength(Graph<V> graph)
    Compute the length (sum of edge weights) of the longest path in the DAG.
    CommunityDetectionUtil.louvain(Graph<V> graph)
    Detects communities using the Louvain algorithm.
    CommunityDetectionUtil.louvain(Graph<V> graph, double resolution, int maxIterations)
    Detects communities using the Louvain algorithm with parameters.
    static <V> double
    NetworkFlowUtil.maxFlow(Graph<V> graph, V source, V sink)
    Calculate maximum flow using Ford-Fulkerson algorithm with BFS (Edmonds-Karp) 使用BFS的Ford-Fulkerson算法(Edmonds-Karp)计算最大流
    static <V> double
    NetworkFlowUtil.maxFlowDfs(Graph<V> graph, V source, V sink)
    Calculate maximum flow using Ford-Fulkerson with DFS 使用DFS的Ford-Fulkerson算法计算最大流
    static <V> Set<Edge<V>>
    NetworkFlowUtil.minCut(Graph<V> graph, V source, V sink)
    Find minimum cut edges 查找最小割边
    static <V> double
    NetworkFlowUtil.minCutCapacity(Graph<V> graph, V source, V sink)
    Calculate min-cut capacity 计算最小割容量
    static <V> Set<Edge<V>>
    MinimumSpanningTreeUtil.minimumSpanningForest(Graph<V> graph)
    Find minimum spanning forest for disconnected graph 为不连通图查找最小生成森林
    static <V> double
    MinimumSpanningTreeUtil.mstWeight(Graph<V> graph)
    Calculate 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.
    static <V> Map<V,Double>
    CentralityUtil.outDegreeCentrality(Graph<V> graph)
    Calculate out-degree centrality for directed graphs.
    static <V> Map<V,Double>
    CentralityUtil.pageRank(Graph<V> graph)
    Calculate PageRank for all vertices using default parameters.
    static <V> Map<V,Double>
    CentralityUtil.pageRank(Graph<V> graph, double dampingFactor, int maxIterations)
    Calculate PageRank for all vertices.
    static <V> Map<V,Double>
    CentralityUtil.pageRank(Graph<V> graph, double dampingFactor, int maxIterations, double tolerance)
    Calculate PageRank with convergence tolerance.
    BipartiteUtil.partition(Graph<V> graph)
    Compute the bipartite partition or find an odd cycle witness.
    static <V> Set<Edge<V>>
    MinimumSpanningTreeUtil.prim(Graph<V> graph)
    Find minimum spanning tree using Prim's algorithm (auto-select start) 使用Prim算法查找最小生成树(自动选择起点)
    static <V> Set<Edge<V>>
    MinimumSpanningTreeUtil.prim(Graph<V> graph, V start)
    Find minimum spanning tree using Prim's algorithm 使用Prim算法查找最小生成树
    static <V> int
    GraphMetrics.radius(Graph<V> graph)
    Compute 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>
    SubgraphUtil.reverse(Graph<V> graph)
    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> double
    ShortestPathUtil.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> int
    BidirectionalBfsUtil.shortestPathLength(Graph<V> graph, V source, V target)
    Find shortest path distance using bidirectional BFS (unweighted) 使用双向BFS查找最短路径距离(无权重)
    static <V> Map<V,Double>
    BellmanFordUtil.shortestPaths(Graph<V> graph, V source)
    Compute single-source shortest paths using Bellman-Ford algorithm.
    static <V> List<V>
    TopologicalSortUtil.sort(Graph<V> graph)
    Topological sort using Kahn's algorithm 使用Kahn算法进行拓扑排序
    static <V> List<V>
    TopologicalSortUtil.sortDfs(Graph<V> graph)
    Topological sort using DFS 使用DFS进行拓扑排序
    GraphMetrics.summary(Graph<V> graph)
    Compute 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>
    SubgraphUtil.union(Graph<V> g1, Graph<V> g2)
    Compute union of two graphs.
    static <V> boolean
    CycleDetectionUtil.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

    Modifier and Type
    Method
    Description
    GraphBuilder.build()
    Build the graph 构建图
    GraphBuilder.buildAndValidate()
    Build and validate the graph 构建并验证图
  • Uses of Graph in cloud.opencode.base.graph.layout

    Methods in cloud.opencode.base.graph.layout with parameters of type Graph
    Modifier and Type
    Method
    Description
    static <V> Map<V, LayoutUtil.Point2D>
    LayoutUtil.circular(Graph<V> graph, double width, double height)
    Compute circular layout with default center.
    static <V> Map<V, LayoutUtil.Point2D>
    LayoutUtil.circular(Graph<V> graph, double centerX, double centerY, double radius)
    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>
    LayoutUtil.grid(Graph<V> graph, double width, double height)
    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>
    LayoutUtil.random(Graph<V> graph, double width, double height)
    Compute random layout.
    static <V> Map<V, LayoutUtil.Point2D>
    LayoutUtil.spring(Graph<V> graph, double width, double height, double springLength)
    Compute spring layout (simplified force-directed).
    static <V> Map<V, LayoutUtil.Point2D>
    LayoutUtil.spring(Graph<V> graph, double width, double height, double springLength, int iterations)
    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 Graph
    Modifier and Type
    Method
    Description
    static <V> void
    SafeGraphOperations.safeAddEdge(Graph<V> graph, V from, V to)
    Safely add an edge with limit check 安全添加边(带限制检查)
    static <V> void
    SafeGraphOperations.safeAddEdge(Graph<V> graph, V from, V to, double weight)
    Safely add an edge with weight and limit check 安全添加带权重的边(带限制检查)
    static <V> void
    SafeGraphOperations.safeAddVertex(Graph<V> graph, V vertex)
    Safely add a vertex with limit check 安全添加顶点(带限制检查)
    static <V> Map<V,Double>
    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> boolean
    SafeGraphOperations.wouldExceedEdgeLimit(Graph<V> graph)
    Check if adding edge would exceed limit 检查添加边是否会超出限制
    static <V> boolean
    SafeGraphOperations.wouldExceedVertexLimit(Graph<V> graph)
    Check if adding vertex would exceed limit 检查添加顶点是否会超出限制
  • Uses of Graph in cloud.opencode.base.graph.serializer

    Modifier and Type
    Method
    Description
    static Graph<String>
    GraphSerializer.fromAdjacencyList(String input, boolean directed)
    Parse graph from adjacency list format 从邻接表格式解析图
    static Graph<String>
    GraphSerializer.fromEdgeList(String input, boolean directed)
    Parse graph from edge list format 从边列表格式解析图
    static Graph<String>
    GexfUtil.fromGexf(String gexf)
    Import graph from GEXF string.
    static Graph<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.
    static Graph<String>
    GraphMLUtil.fromGraphML(String graphml)
    Import graph from GraphML string.
    static Graph<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.
    static Graph<String>
    GexfUtil.readFromFile(Path path)
    Read graph from GEXF file.
    static Graph<String>
    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.
    static Graph<String>
    GraphMLUtil.readFromFile(Path path)
    Read graph from GraphML file.
    static Graph<String>
    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 Graph
    Modifier and Type
    Method
    Description
    static <V> String
    GraphSerializer.getStatistics(Graph<V> graph)
    Get graph statistics as string 获取图统计信息字符串
    static <V> String
    GraphSerializer.toAdjacencyList(Graph<V> graph)
    Convert graph to adjacency list format 将图转换为邻接表格式
    static <V> String
    GraphSerializer.toDot(Graph<V> graph)
    Convert graph to DOT format (Graphviz) 将图转换为DOT格式(Graphviz)
    static <V> String
    GraphSerializer.toDot(Graph<V> graph, String graphName)
    Convert graph to DOT format with custom name 将图转换为带自定义名称的DOT格式
    static <V> String
    GraphSerializer.toEdgeList(Graph<V> graph)
    Convert graph to edge list format 将图转换为边列表格式
    static <V> String
    GexfUtil.toGexf(Graph<V> graph)
    Export graph to GEXF format.
    static <V> String
    GexfUtil.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> String
    GraphMLUtil.toGraphML(Graph<V> graph)
    Export graph to GraphML format.
    static <V> String
    GraphMLUtil.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> void
    GexfUtil.writeToFile(Graph<V> graph, Path path)
    Write graph to GEXF file.
    static <V> void
    GexfUtil.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> void
    GraphMLUtil.writeToFile(Graph<V> graph, Path path)
    Write graph to GraphML file.
    static <V> void
    GraphMLUtil.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 Graph
    Modifier and Type
    Method
    Description
    static <V> boolean
    GraphValidator.edgeExists(Graph<V> graph, V from, V to)
    Validate edge exists in graph 验证边在图中存在
    static <V> ValidationResult
    GraphValidator.validateDAG(Graph<V> graph)
    Check if graph is a valid DAG (Directed Acyclic Graph) 检查图是否为有效的DAG(有向无环图)
    static <V> ValidationResult
    GraphValidator.validateGraph(Graph<V> graph)
    Validate graph structure 验证图结构
    static <V> void
    GraphValidator.validateGraphStructure(Graph<V> graph)
    Validate graph structure and throw exception if errors found 验证图结构,如果发现错误则抛出异常
    static <V> boolean
    GraphValidator.vertexExists(Graph<V> graph, V vertex)
    Validate vertex exists in graph 验证顶点在图中存在