public class GraphUtils extends Object
GraphUtils
class provides utility functions for graphs.Modifier and Type | Method and Description |
---|---|
static <T> DirectedGraph<T> |
reverse(DirectedGraph<T> g)
Gets the reverse of the input graph.
|
static <T> List<T> |
reverseSort(DirectedGraph<T> g)
Sorts the specified directed graph and obtains a reversed topological
sorting of the nodes in the graph.
|
static <T> List<T> |
reverseSort(DirectedGraph<T> g,
java.util.function.Function<T,?> omapper,
java.util.function.Function<T,String> smapper)
Sorts the specified directed graph and obtains a topological sorting of
the nodes in the graph.
|
static <T> List<T> |
reverseSort(DirectedGraph<T> g,
java.util.function.Function<T,String> smapper)
Sorts the specified directed graph and obtains a topological sorting of
the nodes in the graph.
|
static <T> List<T> |
sort(DirectedGraph<T> g)
Sorts the specified directed graph and obtains a topological sorting of
the nodes in the graph.
|
static <T> List<T> |
sort(DirectedGraph<T> g,
java.util.function.Function<T,?> omapper,
java.util.function.Function<T,String> smapper)
Sorts the specified directed graph and obtains a topological sorting of
the nodes in the graph.
|
static <T> List<T> |
sort(DirectedGraph<T> g,
java.util.function.Function<T,String> smapper)
Sorts the specified directed graph and obtains a topological sorting of
the nodes in the graph.
|
public static <T> List<T> reverseSort(DirectedGraph<T> g)
T
- the type of the graph to sortg
- the graph to be sortedIllegalCycleException
- if the graph contains cyclespublic static <T> List<T> reverseSort(DirectedGraph<T> g, java.util.function.Function<T,String> smapper)
T
- the type of the graph to sortg
- the graph to be sortedsmapper
- is a function used to map the object to a string when
building an exception messageIllegalCycleException
- if the graph contains cyclespublic static <T> List<T> reverseSort(DirectedGraph<T> g, java.util.function.Function<T,?> omapper, java.util.function.Function<T,String> smapper)
T
- the type of the graph to sortg
- the graph to be sortedomapper
- is a function used to map the object to a different one when
building an exception messagesmapper
- is a function used to map the object to a string when
building an exception messageIllegalCycleException
- if the graph contains cyclespublic static <T> List<T> sort(DirectedGraph<T> g)
T
- the type of the graph to sortg
- the graph to be sortedIllegalCycleException
- if the graph contains cyclespublic static <T> List<T> sort(DirectedGraph<T> g, java.util.function.Function<T,String> smapper)
T
- the type of the graph to sortg
- the graph to be sortedsmapper
- is a function used to map the object to a string when
building an exception messageIllegalCycleException
- if the graph contains cyclespublic static <T> List<T> sort(DirectedGraph<T> g, java.util.function.Function<T,?> omapper, java.util.function.Function<T,String> smapper)
T
- the type of the graph to sortg
- the graph to be sortedomapper
- is a function used to map the object to a different one when
building an exception messagesmapper
- is a function used to map the object to a string when
building an exception messageIllegalCycleException
- if the graph contains cyclespublic static <T> DirectedGraph<T> reverse(DirectedGraph<T> g)
T
- the type of the graph to reverseg
- a graph to reverseCopyright (C) 2015-2017 The Helenus Driver Project Authors.