Uses of Interface
cloud.opencode.base.collections.graph.Graph

Packages that use Graph
Package
Description
Graph Collections Package - Graph Data Structures 图集合包 - 图数据结构
  • Uses of Graph in cloud.opencode.base.collections.graph

    Modifier and Type
    Class
    Description
    final class 
    MutableGraph - Mutable Graph Implementation MutableGraph - 可变图实现
    Methods in cloud.opencode.base.collections.graph with parameters of type Graph
    Modifier and Type
    Method
    Description
    static <N> List<List<N>>
    GraphTraversalUtil.allPaths(Graph<N> graph, N source, N target, int maxDepth)
    Find all paths between two nodes (limited by max depth).
    static <N> List<N>
    GraphTraversalUtil.bfs(Graph<N> graph, N startNode)
    Perform breadth-first search starting from the given node.
    static <N> void
    GraphTraversalUtil.bfs(Graph<N> graph, N startNode, Consumer<N> visitor)
    Perform BFS with a visitor function.
    static <N> Optional<N>
    GraphTraversalUtil.bfsUntil(Graph<N> graph, N startNode, Predicate<N> condition)
    Perform BFS until a condition is met.
    static <N> List<Set<N>>
    GraphTraversalUtil.connectedComponents(Graph<N> graph)
    Find all connected components in an undirected graph.
    static <N> List<N>
    GraphTraversalUtil.dfs(Graph<N> graph, N startNode)
    Perform depth-first search starting from the given node.
    static <N> void
    GraphTraversalUtil.dfs(Graph<N> graph, N startNode, Consumer<N> visitor)
    Perform DFS with a visitor function.
    static <N> List<N>
    GraphTraversalUtil.dfsIterative(Graph<N> graph, N startNode)
    Perform iterative depth-first search.
    static <N> boolean
    GraphTraversalUtil.hasCycle(Graph<N> graph)
    Check if the graph has a cycle.
    static <N> boolean
    GraphTraversalUtil.hasPath(Graph<N> graph, N source, N target)
    Check if there is a path between two nodes.
    static <N> boolean
    GraphTraversalUtil.isConnected(Graph<N> graph)
    Check if the graph is connected (for undirected graphs).
    static <N> boolean
    GraphTraversalUtil.isDag(Graph<N> graph)
    Check if the graph is a DAG (Directed Acyclic Graph).
    static <N> Set<N>
    GraphTraversalUtil.reachableFrom(Graph<N> graph, N startNode)
    Get all reachable nodes from a starting node.
    static <N> Optional<List<N>>
    GraphTraversalUtil.shortestPath(Graph<N> graph, N source, N target)
    Find the shortest path between two nodes using BFS.
    static <N> List<Set<N>>
    GraphTraversalUtil.stronglyConnectedComponents(Graph<N> graph)
    Find all strongly connected components in a directed graph (Kosaraju's algorithm).
    static <N> List<N>
    GraphTraversalUtil.topologicalSort(Graph<N> graph)
    Perform topological sort on a directed acyclic graph (DAG).
    static <N> Optional<List<N>>
    GraphTraversalUtil.topologicalSortKahn(Graph<N> graph)
    Perform topological sort using Kahn's algorithm.