feat: all paths between two nodes by SemyonSinchenko · Pull Request #828 · graphframes/graphframes · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions connect/src/main/protobuf/graphframes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,17 @@ object GraphFramesConnectUtils {
.maxPathLength(bfsProto.getMaxPathLength)
.run()
}
case proto.GraphFramesAPI.MethodCase.ALL_PATHS => {
val allPathsProto = apiMessage.getAllPaths
graphFrame.allPaths
.toExpr(parseColumnOrExpression(allPathsProto.getToExpr, planner))
.fromExpr(parseColumnOrExpression(allPathsProto.getFromExpr, planner))
.edgeFilter(parseColumnOrExpression(allPathsProto.getEdgeFilter, planner))
.maxPathLength(allPathsProto.getMaxPathLength)
.setIsDirected(allPathsProto.getIsDirected)
.setUseLocalCheckpoints(allPathsProto.getUseLocalCheckpoints)
.run()
}
case proto.GraphFramesAPI.MethodCase.CONNECTED_COMPONENTS => {
val cc = apiMessage.getConnectedComponents
val ccBuilder = graphFrame.connectedComponents
Expand Down
9 changes: 9 additions & 0 deletions core/src/main/scala/org/graphframes/GraphFrame.scala
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,15 @@ class GraphFrame private (
*/
def bfs: BFS = new BFS(this)

/**
* Enumerate all paths between source and destination vertices.
*
* See [[org.graphframes.lib.AllPaths]] for details.
*
* @group stdlib
*/
def allPaths: AllPaths = new AllPaths(this)

/**
* Aggregate information from neighboring vertices and edges through a controlled traversal.
*
Expand Down
208 changes: 208 additions & 0 deletions core/src/main/scala/org/graphframes/lib/AllPaths.scala
Loading
Loading