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 有向图
    class 
    Undirected Graph 无向图
    Methods in cloud.opencode.base.graph that return Graph
    Modifier and Type
    Method
    Description
    static <V> Graph<V>
    OpenGraph.directed()
    Create a directed graph 创建有向图
    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
    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> 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查找路径(对大图高效)
    static <V> boolean
    OpenGraph.canTopologicalSort(Graph<V> graph)
    Check if topological sort is possible (graph is DAG) 检查是否可以进行拓扑排序(图是DAG)
    OpenGraph.computeFlow(Graph<V> graph, V source, V sink)
    Compute flow result with detailed information 计算包含详细信息的流结果
    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> 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> Map<V,Double>
    OpenGraph.dijkstra(Graph<V> graph, V source)
    Dijkstra's shortest path algorithm Dijkstra最短路径算法
    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.hasSpanningTree(Graph<V> graph)
    Check if a graph has a spanning tree (is connected) 检查图是否有生成树(是否连通)
    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> Set<Edge<V>>
    OpenGraph.kruskal(Graph<V> graph)
    Find minimum spanning tree using Kruskal's algorithm 使用Kruskal算法查找最小生成树
    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> List<V>
    OpenGraph.shortestPath(Graph<V> graph, V source, V target)
    Find shortest path between two vertices 查找两个顶点之间的最短路径
    static <V> List<V>
    OpenGraph.topologicalSort(Graph<V> graph)
    Topological sort using Kahn's algorithm 使用Kahn算法进行拓扑排序
  • 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<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>
    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> 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> Map<V,Double>
    CentralityUtil.closenessCentrality(Graph<V> graph)
    Calculate closeness centrality for all vertices.
    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构建后的连通分量数
    NetworkFlowUtil.computeFlow(Graph<V> graph, V source, V sink)
    Get the flow result with detailed information 获取包含详细信息的流结果
    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> Map<V,Double>
    CentralityUtil.degreeCentrality(Graph<V> graph)
    Calculate degree centrality for all vertices.
    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> 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> 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<V>
    CycleDetectionUtil.findCycle(Graph<V> graph)
    Find one cycle if exists 如果存在环则找到一个
    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
    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
    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> 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.
    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.
    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> 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>
    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> 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进行拓扑排序
    static <V> Graph<V>
    SubgraphUtil.symmetricDifference(Graph<V> g1, Graph<V> g2)
    Compute symmetric difference of two graphs.
    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 验证顶点在图中存在