V
- the node type.E
- the edge type.public class LimitedMemoryPolicy<V extends Traversable<V,E>,E extends Edge<V>> extends Object implements TraversalPolicy<V,E>
TraversalPolicy
that attempts to conserve memory usage during parallel execution.Modifier and Type | Class and Description |
---|---|
protected class |
LimitedMemoryPolicy.PolicyNode
An
Engine.EngineNode proxy class that aids in the computation of traversal orderings. |
Constructor and Description |
---|
LimitedMemoryPolicy()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
assign(V root)
Makes a total ordering and depth assignment to all nodes reachable from the given node.
|
protected int |
assignDepthFirst(LimitedMemoryPolicy.PolicyNode node,
Set<LimitedMemoryPolicy.PolicyNode> partiallyVisited,
Set<LimitedMemoryPolicy.PolicyNode> completelyVisited,
int dfsCtr)
A recursive subroutine for assigning traversal orders while traversing the
LimitedMemoryPolicy.PolicyNode graph in a
depth-first manner. |
protected LimitedMemoryPolicy.PolicyNode |
longestPath(Traversable<V,E> curr,
Map<Traversable<V,E>,LimitedMemoryPolicy.PolicyNode> visitedMap)
Sorts a
LimitedMemoryPolicy.PolicyNode 's children in decreasing order of maximum distance from the source. |
public int assign(V root)
TraversalPolicy
assign
in interface TraversalPolicy<V extends Traversable<V,E>,E extends Edge<V>>
root
- the given node.protected final LimitedMemoryPolicy.PolicyNode longestPath(Traversable<V,E> curr, Map<Traversable<V,E>,LimitedMemoryPolicy.PolicyNode> visitedMap)
LimitedMemoryPolicy.PolicyNode
's children in decreasing order of maximum distance from the source.protected final int assignDepthFirst(LimitedMemoryPolicy.PolicyNode node, Set<LimitedMemoryPolicy.PolicyNode> partiallyVisited, Set<LimitedMemoryPolicy.PolicyNode> completelyVisited, int dfsCtr)
LimitedMemoryPolicy.PolicyNode
graph in a
depth-first manner.