Package | Description |
---|---|
com.google.common.graph |
An API for representing graph (node and edge) data.
|
Modifier and Type | Interface and Description |
---|---|
interface |
MutableGraph<N>
A subinterface of
Graph which adds mutation methods. |
interface |
MutableValueGraph<N,V>
A subinterface of
ValueGraph which adds mutation methods. |
interface |
ValueGraph<N,V>
An interface for graph-
structured data, whose edges have associated non-unique values.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractGraph<N>
This class provides a skeletal implementation of
Graph . |
class |
AbstractValueGraph<N,V>
This class provides a skeletal implementation of
ValueGraph . |
(package private) class |
ConfigurableMutableGraph<N>
Configurable implementation of
MutableGraph that supports both directed and undirected
graphs. |
(package private) class |
ConfigurableMutableValueGraph<N,V>
Configurable implementation of
MutableValueGraph that supports both directed and
undirected graphs. |
(package private) class |
ConfigurableValueGraph<N,V>
Configurable implementation of
ValueGraph that supports the options supplied by AbstractGraphBuilder . |
(package private) class |
ForwardingGraph<N>
A class to allow
Graph implementations to be backed by ValueGraph s. |
private static class |
Graphs.TransposedGraph<N> |
private static class |
Graphs.TransposedValueGraph<N,V> |
class |
ImmutableGraph<N>
A
Graph whose elements and structural relationships will never change. |
(package private) static class |
ImmutableGraph.ValueBackedImpl<N,V> |
class |
ImmutableValueGraph<N,V>
A
ValueGraph whose elements and structural relationships will never change. |
Modifier and Type | Field and Description |
---|---|
private Graph<N> |
Graphs.TransposedGraph.graph |
private Graph<N> |
EndpointPairIterator.graph |
Modifier and Type | Method and Description |
---|---|
Graph<N> |
Network.asGraph()
Returns a live view of this network as a
Graph . |
Graph<N> |
AbstractNetwork.asGraph() |
protected Graph<N> |
ConfigurableMutableGraph.delegate() |
protected abstract Graph<N> |
ForwardingGraph.delegate() |
protected Graph<N> |
ImmutableGraph.ValueBackedImpl.delegate() |
static <N> Graph<N> |
Graphs.transitiveClosure(Graph<N> graph)
Returns the transitive closure of
graph . |
static <N> Graph<N> |
Graphs.transpose(Graph<N> graph)
Returns a view of
graph with the direction (if any) of every edge reversed. |
Modifier and Type | Method and Description |
---|---|
private static boolean |
Graphs.canTraverseWithoutReusingEdge(Graph<?> graph,
java.lang.Object nextNode,
java.lang.Object previousNode)
Determines whether an edge has already been used during traversal.
|
private static <N> GraphConnections<N,GraphConstants.Presence> |
ImmutableGraph.connectionsOf(Graph<N> graph,
N node) |
static <N> ImmutableGraph<N> |
ImmutableGraph.copyOf(Graph<N> graph)
Returns an immutable copy of
graph . |
static <N> MutableGraph<N> |
Graphs.copyOf(Graph<N> graph)
Creates a mutable copy of
graph with the same nodes and edges. |
static boolean |
Graphs.equivalent(Graph<?> graphA,
Graph<?> graphB)
Returns
true if graphA and graphB have the same elements and the same
relationships between elements, as exposed via the Graph interface. |
static boolean |
Graphs.equivalent(Graph<?> graphA,
Graph<?> graphB)
Returns
true if graphA and graphB have the same elements and the same
relationships between elements, as exposed via the Graph interface. |
static <N> GraphBuilder<N> |
GraphBuilder.from(Graph<N> graph)
Returns a
GraphBuilder initialized with all properties queryable from graph . |
static <N> ValueGraphBuilder<N,java.lang.Object> |
ValueGraphBuilder.from(Graph<N> graph)
Returns a
ValueGraphBuilder initialized with all properties queryable from graph . |
private static <N> ImmutableMap<N,GraphConnections<N,GraphConstants.Presence>> |
ImmutableGraph.getNodeConnections(Graph<N> graph) |
static boolean |
Graphs.hasCycle(Graph<?> graph)
Returns true if
graph has at least one cycle. |
static <N> MutableGraph<N> |
Graphs.inducedSubgraph(Graph<N> graph,
java.lang.Iterable<? extends N> nodes)
Returns the subgraph of
graph induced by nodes . |
(package private) static <N> EndpointPair<N> |
EndpointPair.of(Graph<?> graph,
N nodeU,
N nodeV)
Returns an
EndpointPair representing the endpoints of an edge in graph . |
(package private) static <N> EndpointPairIterator<N> |
EndpointPairIterator.of(Graph<N> graph) |
static <N> java.util.Set<N> |
Graphs.reachableNodes(Graph<N> graph,
java.lang.Object node)
Returns the set of nodes that are reachable from
node . |
private static boolean |
Graphs.subgraphHasCycle(Graph<?> graph,
java.util.Map<java.lang.Object,Graphs.NodeVisitState> visitedNodes,
java.lang.Object node,
java.lang.Object previousNode)
Performs a traversal of the nodes reachable from
node . |
static <N> Graph<N> |
Graphs.transitiveClosure(Graph<N> graph)
Returns the transitive closure of
graph . |
static <N> Graph<N> |
Graphs.transpose(Graph<N> graph)
Returns a view of
graph with the direction (if any) of every edge reversed. |
Constructor and Description |
---|
Directed(Graph<N> graph) |
EndpointPairIterator(Graph<N> graph) |
TransposedGraph(Graph<N> graph) |
Undirected(Graph<N> graph) |