Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 1.64 KB

README.md

File metadata and controls

23 lines (20 loc) · 1.64 KB

guava-graph-utils

This is a Java library with a few utilities for working with Guava graphs. Specifically:

  • MoreGraphs.buildGraph: builds an ImmutableGraph from a set of starting nodes and a "successors function". The successors function is applied in a breadth-first manner to the starting nodes, then their children, then their grand-children, and so on and so forth until all descendants have been traversed.
  • MoreGraphs.asValueGraph: wraps a Guava Table as a ValueGraph.
  • MoreGraphs.topologicalOrdering: returns a topological ordering of the given graph; that is, a traversal of the graph in which each node is visited only after all its predecessors and other ancestors have been visited.
  • MoreGraphs.lazyTopologicalOrdering: returns a lazy view of the topological ordering of the given graph.
  • MoreGraphs.topologicalOrderingStartingFrom: returns a topological ordering of the subgraph of the given graph that starts from the given nodes.
  • MoreGraphs.union: returns a view of the union of the given graphs.
  • MoreGraphs.pageRanks: returns the page ranks of all nodes of the given graph as per the PageRank algorithm.

See these methods' javadocs for more information.