@ParametersAreNonnullByDefault
Package com.google.common.graph
An API for representing graph (node and edge) data. It is analogous to the Java Collections
Framework APIs for lists, maps, sets, etc.
This package is a part of the open-source Guava library.
-
Interface Summary Interface Description BaseGraph<N> A non-public interface for the methods shared betweenGraph
andValueGraph
.Graph<N> An interface for graph-structured data, whose edges are anonymous entities with no identity or information of their own.GraphConnections<N,V> An interface for representing and manipulating an origin node's adjacent nodes and edge values in aGraph
.MutableGraph<N> A subinterface ofGraph
which adds mutation methods.MutableNetwork<N,E> A subinterface ofNetwork
which adds mutation methods.MutableValueGraph<N,V> A subinterface ofValueGraph
which adds mutation methods.Network<N,E> An interface for graph-structured data, whose edges are unique objects.NetworkConnections<N,E> An interface for representing and manipulating an origin node's adjacent nodes and incident edges in aNetwork
.PredecessorsFunction<N> A functional interface for graph-structured data.SuccessorsFunction<N> A functional interface for graph-structured data.ValueGraph<N,V> An interface for graph-structured data, whose edges have associated non-unique values. -
Class Summary Class Description AbstractBaseGraph<N> This class provides a skeletal implementation ofBaseGraph
.AbstractDirectedNetworkConnections<N,E> A base implementation ofNetworkConnections
for directed networks.AbstractGraph<N> This class provides a skeletal implementation ofGraph
.AbstractGraphBuilder<N> A base class for builders that construct graphs with user-defined properties.AbstractNetwork<N,E> This class provides a skeletal implementation ofNetwork
.AbstractUndirectedNetworkConnections<N,E> A base implementation ofNetworkConnections
for undirected networks.AbstractValueGraph<N,V> This class provides a skeletal implementation ofValueGraph
.DirectedGraphConnections<N,V> An implementation ofGraphConnections
for directed graphs.DirectedGraphConnections.NodeConnection<N> A value class representing single connection between the origin node and another node.DirectedGraphConnections.NodeConnection.Pred<N> DirectedGraphConnections.NodeConnection.Succ<N> DirectedGraphConnections.PredAndSucc A wrapper class to indicate a node is both a predecessor and successor while still providing the successor value.DirectedMultiNetworkConnections<N,E> An implementation ofNetworkConnections
for directed networks with parallel edges.DirectedNetworkConnections<N,E> An implementation ofNetworkConnections
for directed networks.EdgesConnecting<E> A class to represent the set of edges connecting an (implicit) origin node to a target node.ElementOrder<T> Used to represent the order of elements in a data structure that supports different options for iteration order guarantees.EndpointPair<N> An immutable pair representing the two endpoints of an edge in a graph.EndpointPair.Ordered<N> EndpointPair.Unordered<N> EndpointPairIterator<N> A class to facilitate the set returned byGraph.edges()
.EndpointPairIterator.Directed<N> If the graph is directed, each ordered [source, target] pair will be visited once if there is an edge connecting them.EndpointPairIterator.Undirected<N> If the graph is undirected, each unordered [node, otherNode] pair (except self-loops) will be visited twice if there is an edge connecting them.ForwardingGraph<N> ForwardingNetwork<N,E> A class to allowNetwork
implementations to be backed by a provided delegate.ForwardingValueGraph<N,V> A class to allowValueGraph
implementations to be backed by a provided delegate.GraphBuilder<N> A builder for constructing instances ofMutableGraph
orImmutableGraph
with user-defined properties.GraphConstants A utility class to hold various constants used by the Guava Graph library.Graphs Graphs.TransposedGraph<N> Graphs.TransposedNetwork<N,E> Graphs.TransposedValueGraph<N,V> ImmutableGraph<N> AGraph
whose elements and structural relationships will never change.ImmutableGraph.Builder<N> A builder for creatingImmutableGraph
instances, especiallystatic final
graphs.ImmutableNetwork<N,E> ANetwork
whose elements and structural relationships will never change.ImmutableNetwork.Builder<N,E> A builder for creatingImmutableNetwork
instances, especiallystatic final
networks.ImmutableValueGraph<N,V> AValueGraph
whose elements and structural relationships will never change.ImmutableValueGraph.Builder<N,V> A builder for creatingImmutableValueGraph
instances, especiallystatic final
graphs.IncidentEdgeSet<N> Abstract base class for an incident edges set that allows different implementations ofAbstractCollection.iterator()
.MapIteratorCache<K,V> A map-like data structure that wraps a backing map and caches values while iterating throughMapIteratorCache.unmodifiableKeySet()
.MapRetrievalCache<K,V> AMapIteratorCache
that adds additional caching.MapRetrievalCache.CacheEntry<K,V> MultiEdgesConnecting<E> A class to represent the set of edges connecting an (implicit) origin node to a target node.NetworkBuilder<N,E> A builder for constructing instances ofMutableNetwork
orImmutableNetwork
with user-defined properties.StandardMutableGraph<N> Standard implementation ofMutableGraph
that supports both directed and undirected graphs.StandardMutableNetwork<N,E> Standard implementation ofMutableNetwork
that supports both directed and undirected graphs.StandardMutableValueGraph<N,V> Standard implementation ofMutableValueGraph
that supports both directed and undirected graphs.StandardNetwork<N,E> Standard implementation ofNetwork
that supports the options supplied byNetworkBuilder
.StandardValueGraph<N,V> Standard implementation ofValueGraph
that supports the options supplied byAbstractGraphBuilder
.Traverser<N> An object that can traverse the nodes that are reachable from a specified (set of) start node(s) using a specifiedSuccessorsFunction
.Traverser.Traversal<N> Abstracts away the difference between traversing a graph vs.UndirectedGraphConnections<N,V> An implementation ofGraphConnections
for undirected graphs.UndirectedMultiNetworkConnections<N,E> An implementation ofNetworkConnections
for undirected networks with parallel edges.UndirectedNetworkConnections<N,E> An implementation ofNetworkConnections
for undirected networks.ValueGraphBuilder<N,V> A builder for constructing instances ofMutableValueGraph
orImmutableValueGraph
with user-defined properties. -
Enum Summary Enum Description ElementOrder.Type The type of ordering that this object specifies.GraphConstants.Presence Singleton edge value forGraph
implementations backed byValueGraph
s.Graphs.NodeVisitState An enum representing the state of a node during DFS.Traverser.InsertionOrder Poor man's method reference forDeque::addFirst
andDeque::addLast
. -
Annotation Types Summary Annotation Type Description ElementTypesAreNonnullByDefault Marks all "top-level" types as non-null in a way that is recognized by Kotlin.ParametricNullness Marks a "top-level" type-variable usage as (a) a Kotlin platform type when the type argument is non-nullable and (b) nullable when the type argument is nullable.