Package oracle.pgx.algorithm
Interface Traversal
-
public interface TraversalUtility functions to build a BFS/DFS traversal.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTraversal.Direction
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Traversalbackward(java.util.function.Consumer<PgxVertex> backward)Visit the vertex in the backward direction of the traversal.TraversalbackwardFilter(java.util.function.Predicate<PgxVertex> filter)Filter the vertices in the BFS/DFS traversal when going backward.static intcurrentLevel()Get the current level of the BFS/DFS traversal.Traversaldirection(Traversal.Direction direction)Set the direction of the BFS/DFS traversal.Traversalfilter(java.util.function.Predicate<PgxVertex> filter)Filter the vertices in the BFS/DFS traversal.Traversalforward(java.util.function.Consumer<PgxVertex> forward)Visit the vertex in the forward direction of the BFS traversal.static TraversalinBFS(PgxGraph graph, PgxVertex root)Create a BFS traversal in the given graph rooted at the given vertex.static TraversalinDFS(PgxGraph graph, PgxVertex root)Create a DFS traversal in the given graph rooted at the given vertex.Traversalnavigator(java.util.function.Predicate<PgxVertex> navigator)If the navigator is false, do not consider the neighbors of this vertex in the traversal.static voidstopTraversal()Abort the current traversal.
-
-
-
Method Detail
-
inBFS
static Traversal inBFS(PgxGraph graph, PgxVertex root)
Create a BFS traversal in the given graph rooted at the given vertex.- Parameters:
graph-root-- Returns:
-
inDFS
static Traversal inDFS(PgxGraph graph, PgxVertex root)
Create a DFS traversal in the given graph rooted at the given vertex.- Parameters:
graph-root-- Returns:
-
currentLevel
static int currentLevel()
Get the current level of the BFS/DFS traversal.- Returns:
-
stopTraversal
static void stopTraversal()
Abort the current traversal.
-
filter
Traversal filter(java.util.function.Predicate<PgxVertex> filter)
Filter the vertices in the BFS/DFS traversal.- Parameters:
filter-- Returns:
-
navigator
Traversal navigator(java.util.function.Predicate<PgxVertex> navigator)
If the navigator is false, do not consider the neighbors of this vertex in the traversal.- Parameters:
navigator-- Returns:
-
forward
Traversal forward(java.util.function.Consumer<PgxVertex> forward)
Visit the vertex in the forward direction of the BFS traversal.- Parameters:
forward-- Returns:
-
backwardFilter
Traversal backwardFilter(java.util.function.Predicate<PgxVertex> filter)
Filter the vertices in the BFS/DFS traversal when going backward.- Parameters:
filter-- Returns:
-
backward
Traversal backward(java.util.function.Consumer<PgxVertex> backward)
Visit the vertex in the backward direction of the traversal.- Parameters:
backward-- Returns:
-
direction
Traversal direction(Traversal.Direction direction)
Set the direction of the BFS/DFS traversal.- Parameters:
direction-- Returns:
-
-