Package | Description |
---|---|
dev.nm.graph | |
dev.nm.graph.algorithm.traversal | |
dev.nm.graph.type |
Modifier and Type | Interface and Description |
---|---|
interface |
DAGraph<V,E extends Arc<V>>
A directed acyclic graph (DAG), is a directed graph with no directed cycles.
|
interface |
DiGraph<V,E extends Arc<V>>
A directed graph or digraph is a graph, or set of nodes connected by edges, where the edges have
a direction associated with them.
|
interface |
RootedTree<V,E extends Arc<V>>
A rooted tree is a directed graph, and has a root to measure distance from the
root.
|
Modifier and Type | Interface and Description |
---|---|
interface |
WeightedArc<V>
A weighted arc is an arc that has a weight or a cost associated with it.
|
Modifier and Type | Method and Description |
---|---|
static <V,N,E extends Arc<N>> |
GraphUtils.unDi2DAGraph(UnDiGraph<V,? extends UndirectedEdge<V>> g,
V root,
GraphUtils.EdgeFactory<V,N,E,UndirectedEdge<V>> edgeFactory)
Converts an undirected graph into a directed acyclic graph, arcs are created from the edges
by parent-child relations as determined by breadth-first-search.
|
Modifier and Type | Method and Description |
---|---|
static <V> DAGraph<V,Arc<V>> |
GraphUtils.unDi2DAGraph(UnDiGraph<V,? extends UndirectedEdge<V>> g,
V root)
Converts an undirected graph into a directed acyclic graph, arcs are created from the edges
by
parent-child relations as determined by breadth-first-search.
|
Modifier and Type | Method and Description |
---|---|
static <V> UnDiGraph<V,UndirectedEdge<V>> |
GraphUtils.di2UnDiGraph(DiGraph<V,? extends Arc<V>> diG)
Converts a directed graph into an undirected graph by removing the direction of all arcs.
|
static <V> Set<V> |
GraphUtils.getChildren(DiGraph<V,? extends Arc<V>> g,
V v)
Get the set of vertices that have an incoming arc coming from a vertex.
|
static <V> Set<V> |
GraphUtils.getParents(DiGraph<V,? extends Arc<V>> g,
V v)
Get the set of vertices that have an outgoing arc pointing to a vertex.
|
static <V> boolean |
GraphUtils.isStronglyConnected(DiGraph<V,? extends Arc<V>> g)
Check whether a directed graph is strongly connected.
|
static <V> int |
GraphUtils.numberOfChildren(DiGraph<V,? extends Arc<V>> g,
V v)
Gets the number of children.
|
static <V> int |
GraphUtils.numberOfParents(DiGraph<V,? extends Arc<V>> g,
V v)
Gets the number of parents.
|
Constructor and Description |
---|
BottomUp(DAGraph<V,? extends Arc<V>> g)
Constructs a BottomUp traversal instance.
|
Modifier and Type | Class and Description |
---|---|
class |
SparseDAGraph<V,E extends Arc<V>>
This class implements the sparse directed acyclic graph representation.
|
class |
SparseDiGraph<V,E extends Arc<V>>
This class implements the sparse directed graph representation.
|
Modifier and Type | Class and Description |
---|---|
class |
SimpleArc<V>
A simple arc has two vertices: head and tail.
|
Modifier and Type | Method and Description |
---|---|
Set<Arc<VertexTree<T>>> |
VertexTree.edges() |
Set<Arc<V>> |
SparseTree.edges() |
Set<Arc<V>> |
SparseTree.edges(V v) |
Set<Arc<VertexTree<T>>> |
VertexTree.edges(VertexTree<T> v) |
Set<Arc<V>> |
SparseTree.incomingArcs(V v) |
Set<Arc<VertexTree<T>>> |
VertexTree.incomingArcs(VertexTree<T> v) |
Set<Arc<V>> |
SparseTree.outgoingArcs(V v) |
Set<Arc<VertexTree<T>>> |
VertexTree.outgoingArcs(VertexTree<T> v) |
RootedTree<V,Arc<V>> |
SparseTree.rotate(V v)
This method re-pivots the tree with a new root vertex.
|
RootedTree<V,Arc<V>> |
SparseTree.subTree(V v) |
RootedTree<VertexTree<T>,Arc<VertexTree<T>>> |
VertexTree.subTree(VertexTree<T> v) |
Modifier and Type | Method and Description |
---|---|
SparseTree<V> |
SparseTree.addEdge(Arc<V> e)
Add an edge to the tree, connecting v1, the parent and v2..., the children.
|
VertexTree<T> |
VertexTree.addEdge(Arc<VertexTree<T>> e) |
SparseTree<V> |
SparseTree.removeEdge(Arc<V> e) |
VertexTree<T> |
VertexTree.removeEdge(Arc<VertexTree<T>> e) |
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.