public abstract class GraphTests extends Object
Constructor and Description |
---|
GraphTests() |
Modifier and Type | Method and Description |
---|---|
static <V,E> boolean |
isBipartite(Graph<V,E> graph)
Test whether a graph is bipartite.
|
static <V,E> boolean |
isBipartitePartition(Graph<V,E> graph,
Set<? extends V> firstPartition,
Set<? extends V> secondPartition)
Test whether a partition of the vertices into two sets is a bipartite partition.
|
static <V,E> boolean |
isComplete(Graph<V,E> graph)
Test whether a graph is complete.
|
static <V,E> boolean |
isConnected(UndirectedGraph<V,E> graph)
Test whether an undirected graph is connected.
|
static <V,E> boolean |
isEmpty(Graph<V,E> graph)
Test whether a graph is empty.
|
static <V,E> boolean |
isEulerian(Graph<V,E> graph)
Test whether a graph is Eulerian.
|
static <V,E> boolean |
isSimple(Graph<V,E> graph)
Check if a graph is simple.
|
static <V,E> boolean |
isStronglyConnected(DirectedGraph<V,E> graph)
Test whether a directed graph is strongly connected.
|
static <V,E> boolean |
isTree(UndirectedGraph<V,E> graph)
Test whether an undirected graph is a tree.
|
static <V,E> boolean |
isWeaklyConnected(DirectedGraph<V,E> graph)
Test whether a directed graph is weakly connected.
|
public static <V,E> boolean isEmpty(Graph<V,E> graph)
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphpublic static <V,E> boolean isSimple(Graph<V,E> graph)
V
- the graph vertex typeE
- the graph edge typegraph
- a graphpublic static <V,E> boolean isComplete(Graph<V,E> graph)
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphpublic static <V,E> boolean isConnected(UndirectedGraph<V,E> graph)
This method does not performing any caching, instead recomputes everything from scratch. In
case more control is required use ConnectivityInspector
directly.
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphConnectivityInspector
public static <V,E> boolean isWeaklyConnected(DirectedGraph<V,E> graph)
This method does not performing any caching, instead recomputes everything from scratch. In
case more control is required use ConnectivityInspector
directly.
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphConnectivityInspector
public static <V,E> boolean isStronglyConnected(DirectedGraph<V,E> graph)
This method does not performing any caching, instead recomputes everything from scratch. In
case more control is required use KosarajuStrongConnectivityInspector
directly.
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphKosarajuStrongConnectivityInspector
public static <V,E> boolean isTree(UndirectedGraph<V,E> graph)
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphpublic static <V,E> boolean isBipartite(Graph<V,E> graph)
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphpublic static <V,E> boolean isBipartitePartition(Graph<V,E> graph, Set<? extends V> firstPartition, Set<? extends V> secondPartition)
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphfirstPartition
- the first vertices partitionsecondPartition
- the second vertices partitionpublic static <V,E> boolean isEulerian(Graph<V,E> graph)
V
- the graph vertex typeE
- the graph edge typegraph
- the input graphHierholzerEulerianCycle.isEulerian(Graph)
Copyright © 2017. All rights reserved.