class AllPaths extends Arguments with Serializable with WithDirection with WithLocalCheckpoints with WithCheckpointInterval with WithIntermediateStorageLevel

Computes all simple paths between source and destination vertices.

This algorithm enumerates paths up to maxPathLength hops. It supports directed and undirected traversal as well as optional edge filtering. It returns all simple paths between source and destination vertices. Here the term "simple" means no repeated vertices. For example, if there are paths A-B-C, A-D-C and the edge B-A, user asked to find all the paths between "A" and "C" only A-B-C and A-D-C will be returned, but not the A-B-A-D-C. The default value of the maxPathLength is 5. Keep in mind that requesting maxPathLength of the scale of the graph diameter may tend this algorithm will try to return (almost) all simple paths in the graph that can create huge performance degradation or even OOM-like errors. Algorithm supports both directed and undirected graphs.

Returned DataFrame schema:

  • path: array of vertex ids in traversal order
  • len: number of edges in the path (Long)

Note: in the case of undirected graph an algorithm run on the internal graph made by union edges and reversed edges. It is assumed that graph does not have multi-edges. Results may be unstable and unpredictable for the graph with multi-edges.

Linear Supertypes
WithIntermediateStorageLevel, WithCheckpointInterval, Logging, WithLocalCheckpoints, WithDirection, Serializable, Arguments, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AllPaths
  2. WithIntermediateStorageLevel
  3. WithCheckpointInterval
  4. Logging
  5. WithLocalCheckpoints
  6. WithDirection
  7. Serializable
  8. Arguments
  9. AnyRef
  10. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from AllPaths toany2stringadd[AllPaths] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (AllPaths, B)
    Implicit
    This member is added by an implicit conversion from AllPaths toArrowAssoc[AllPaths] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val checkpointInterval: Int
    Attributes
    protected
    Definition Classes
    WithCheckpointInterval
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  9. def edgeFilter(value: String): AllPaths.this.type

    Sets an optional filter expression applied to edges during traversal.

    Sets an optional filter expression applied to edges during traversal. Only edges satisfying this condition will be considered.

    value

    a SQL expression string evaluated against edge attributes

    returns

    this instance for method chaining

  10. def edgeFilter(value: Column): AllPaths.this.type

    Sets an optional filter expression applied to edges during traversal.

    Sets an optional filter expression applied to edges during traversal. Only edges satisfying this condition will be considered.

    value

    a Column expression evaluated against edge attributes

    returns

    this instance for method chaining

  11. def ensuring(cond: (AllPaths) => Boolean, msg: => Any): AllPaths
    Implicit
    This member is added by an implicit conversion from AllPaths toEnsuring[AllPaths] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (AllPaths) => Boolean): AllPaths
    Implicit
    This member is added by an implicit conversion from AllPaths toEnsuring[AllPaths] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: => Any): AllPaths
    Implicit
    This member is added by an implicit conversion from AllPaths toEnsuring[AllPaths] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): AllPaths
    Implicit
    This member is added by an implicit conversion from AllPaths toEnsuring[AllPaths] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  17. def fromExpr(value: String): AllPaths.this.type

    Sets the expression identifying the source (starting) vertices.

    Sets the expression identifying the source (starting) vertices.

    value

    a SQL expression string evaluated against vertex attributes to select source vertices

    returns

    this instance for method chaining

  18. def fromExpr(value: Column): AllPaths.this.type

    Sets the expression identifying the source (starting) vertices.

    Sets the expression identifying the source (starting) vertices.

    value

    a Column expression evaluated against vertex attributes to select source vertices

    returns

    this instance for method chaining

  19. def getCheckpointInterval: Int

    Gets checkpoint interval.

    Gets checkpoint interval.

    Definition Classes
    WithCheckpointInterval
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  21. def getIntermediateStorageLevel: StorageLevel

    Gets storage level for intermediate datasets that require multiple passes.

    Gets storage level for intermediate datasets that require multiple passes.

    Definition Classes
    WithIntermediateStorageLevel
  22. def getIsDirected: Boolean

    Gets should graph be considered as directed.

    Gets should graph be considered as directed.

    returns

    true if directed

    Definition Classes
    WithDirection
  23. def getUseLocalCheckpoints: Boolean

    Gets whether local checkpoints are being used instead of regular checkpoints.

    Gets whether local checkpoints are being used instead of regular checkpoints.

    returns

    true if local checkpoints are enabled, false otherwise

    Definition Classes
    WithLocalCheckpoints
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  25. val intermediateStorageLevel: StorageLevel
    Attributes
    protected
    Definition Classes
    WithIntermediateStorageLevel
  26. val isDirected: Boolean
    Attributes
    protected
    Definition Classes
    WithDirection
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. def logDebug(s: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  29. def logInfo(s: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  30. def logTrace(s: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  31. def logWarn(s: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  32. def maxPathLength(value: Int): AllPaths.this.type

    Sets the maximum path length (number of edges) for the enumerated paths.

    Sets the maximum path length (number of edges) for the enumerated paths.

    Setting a large value (e.g. on the scale of the graph diameter) may cause the algorithm to attempt to collect a very large number of paths, leading to severe performance degradation or out-of-memory errors. Use with caution on large or densely connected graphs.

    value

    the maximum number of edges in a path; must be greater than 0. Default is 5.

    returns

    this instance for method chaining

  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  35. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  36. def resultIsPersistent(): Unit
    Attributes
    protected
    Definition Classes
    Logging
  37. def run(): DataFrame

    Executes the AllPaths algorithm and returns all simple paths between the specified source and destination vertices.

    Executes the AllPaths algorithm and returns all simple paths between the specified source and destination vertices.

    returns

    a DataFrame with the following columns:

    • path: an array of vertex ids in traversal order
    • len: the number of edges in the path (Long)
  38. def setCheckpointInterval(value: Int): AllPaths.this.type

    Sets checkpoint interval in terms of number of iterations (default: 2).

    Sets checkpoint interval in terms of number of iterations (default: 2). Checkpointing regularly helps recover from failures, clean shuffle files, shorten the lineage of the computation graph, and reduce the complexity of plan optimization. As of Spark 2.0, the complexity of plan optimization would grow exponentially without checkpointing. Hence, disabling or setting longer-than-default checkpoint intervals are not recommended. Checkpoint data is saved under org.apache.spark.SparkContext.getCheckpointDir with prefix of the algorithm name. If the checkpoint directory is not set, this throws a java.io.IOException. Set a nonpositive value to disable checkpointing. This parameter is only used when the algorithm is set to "graphframes". Its default value might change in the future.

    Definition Classes
    WithCheckpointInterval
    See also

    org.apache.spark.SparkContext.setCheckpointDir in Spark API doc

  39. def setIntermediateStorageLevel(value: StorageLevel): AllPaths.this.type

    Sets storage level for intermediate datasets that require multiple passes (default: MEMORY_AND_DISK).

    Sets storage level for intermediate datasets that require multiple passes (default: MEMORY_AND_DISK).

    Definition Classes
    WithIntermediateStorageLevel
  40. def setIsDirected(value: Boolean): AllPaths.this.type

    Sets should graph be cosidered as directed.

    Sets should graph be cosidered as directed.

    value

    true to handle graph as directed

    Definition Classes
    WithDirection
  41. def setUseLocalCheckpoints(value: Boolean): AllPaths.this.type

    Sets whether to use local checkpoints instead of regular checkpoints (default: false).

    Sets whether to use local checkpoints instead of regular checkpoints (default: false). Local checkpoints are faster but less reliable as they don't survive node failures.

    value

    true to use local checkpoints, false for regular checkpoints

    returns

    this instance

    Definition Classes
    WithLocalCheckpoints
  42. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  43. def toExpr(value: String): AllPaths.this.type

    Sets the expression identifying the destination (target) vertices.

    Sets the expression identifying the destination (target) vertices.

    value

    a SQL expression string evaluated against vertex attributes to select destination vertices

    returns

    this instance for method chaining

  44. def toExpr(value: Column): AllPaths.this.type

    Sets the expression identifying the destination (target) vertices.

    Sets the expression identifying the destination (target) vertices.

    value

    a Column expression evaluated against vertex attributes to select destination vertices

    returns

    this instance for method chaining

  45. def toString(): String
    Definition Classes
    AnyRef → Any
  46. val useLocalCheckpoints: Boolean
    Attributes
    protected
    Definition Classes
    WithLocalCheckpoints
  47. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from AllPaths toStringFormat[AllPaths] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (AllPaths, B)
    Implicit
    This member is added by an implicit conversion from AllPaths toArrowAssoc[AllPaths] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from WithIntermediateStorageLevel

Inherited from WithCheckpointInterval

Inherited from Logging

Inherited from WithLocalCheckpoints

Inherited from WithDirection

Inherited from Serializable

Inherited from Arguments

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromAllPaths to any2stringadd[AllPaths]

Inherited by implicit conversion StringFormat fromAllPaths to StringFormat[AllPaths]

Inherited by implicit conversion Ensuring fromAllPaths to Ensuring[AllPaths]

Inherited by implicit conversion ArrowAssoc fromAllPaths to ArrowAssoc[AllPaths]

Ungrouped