org.shiwa.fgi.iwir2agwl.misc
Class Graph<T>
java.lang.Object
org.shiwa.fgi.iwir2agwl.misc.Graph<T>
public class Graph<T>
- extends java.lang.Object
|
Method Summary |
void |
addPredecessor(T dst,
T src)
|
void |
addPredecessors(T src,
java.util.Collection<T> dsts)
|
void |
addSuccessor(T src,
T dst)
|
void |
addSuccessors(T src,
java.util.Collection<T> dsts)
|
java.util.Map<T,java.util.Set<T>> |
asUndirectedGraph()
|
boolean |
contains(T node)
|
void |
fold(java.util.Collection<? extends T> nodes)
|
java.util.Set<T> |
getAllPredecessors(T node)
|
java.util.Set<T> |
getAllSuccessors(T node)
|
java.util.Set<T> |
getNodes()
|
Graph.ParallelGraph |
getParallelGraph()
|
java.util.List<java.util.Set<T>> |
getParallelPaths(T node,
T target,
java.util.Set<T> succs)
|
java.util.Set<T> |
getPredecessors(T node)
|
java.util.Set<T> |
getRoots()
|
Graph<T> |
getSubGraph(T node)
|
Graph<T> |
getSubgraph(T start,
T target)
|
Graph<T> |
getSubgraphExcl(T start,
T target)
|
Graph<T> |
getSubgraphExclTarget(T start,
T target)
|
java.util.Set<T> |
getSucccessors(T node)
|
void |
intersect(Graph<T> b)
|
boolean |
isEmpty()
|
boolean |
isLinearDependent()
|
boolean |
isSeriesParallel(T start,
T target,
java.util.Set<T> startSucc)
|
T |
leastCommonSuccessor(java.util.Collection<T> nodes)
|
T |
leastCommonSuccessor(T... nodes)
|
static void |
main(java.lang.String[] args)
|
void |
parallelPath(T node,
Graph.ParallelGraph pgraph)
|
void |
removeNode(T node)
|
void |
retainAll(java.util.Collection<? extends T> nodes)
|
void |
safeRemove(T node)
|
int |
size()
|
java.util.List<T> |
topSort()
|
java.lang.String |
toString()
|
void |
trim()
|
void |
union(Graph<T> b)
|
void |
unsafetrim()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Graph
public Graph()
Graph
public Graph(Graph<T> b)
addSuccessor
public void addSuccessor(T src,
T dst)
addSuccessors
public void addSuccessors(T src,
java.util.Collection<T> dsts)
addPredecessor
public void addPredecessor(T dst,
T src)
addPredecessors
public void addPredecessors(T src,
java.util.Collection<T> dsts)
removeNode
public void removeNode(T node)
safeRemove
public void safeRemove(T node)
fold
public void fold(java.util.Collection<? extends T> nodes)
getSucccessors
public java.util.Set<T> getSucccessors(T node)
getPredecessors
public java.util.Set<T> getPredecessors(T node)
getAllPredecessors
public java.util.Set<T> getAllPredecessors(T node)
getAllSuccessors
public java.util.Set<T> getAllSuccessors(T node)
getSubGraph
public Graph<T> getSubGraph(T node)
getNodes
public java.util.Set<T> getNodes()
topSort
public java.util.List<T> topSort()
asUndirectedGraph
public java.util.Map<T,java.util.Set<T>> asUndirectedGraph()
getRoots
public java.util.Set<T> getRoots()
contains
public boolean contains(T node)
size
public int size()
isEmpty
public boolean isEmpty()
union
public void union(Graph<T> b)
intersect
public void intersect(Graph<T> b)
retainAll
public void retainAll(java.util.Collection<? extends T> nodes)
isSeriesParallel
public boolean isSeriesParallel(T start,
T target,
java.util.Set<T> startSucc)
leastCommonSuccessor
public T leastCommonSuccessor(T... nodes)
leastCommonSuccessor
public T leastCommonSuccessor(java.util.Collection<T> nodes)
getParallelPaths
public java.util.List<java.util.Set<T>> getParallelPaths(T node,
T target,
java.util.Set<T> succs)
parallelPath
public void parallelPath(T node,
Graph.ParallelGraph pgraph)
getSubgraphExcl
public Graph<T> getSubgraphExcl(T start,
T target)
getSubgraphExclTarget
public Graph<T> getSubgraphExclTarget(T start,
T target)
trim
public void trim()
unsafetrim
public void unsafetrim()
getSubgraph
public Graph<T> getSubgraph(T start,
T target)
isLinearDependent
public boolean isLinearDependent()
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
getParallelGraph
public Graph.ParallelGraph getParallelGraph()
main
public static void main(java.lang.String[] args)