function kspProvider (timestamp, svid, evid, depth, edges, skip = 0, limit = 1,
{ vFilter, eFilter, weightExpr } = {}) {
const result = validate([
timestamp, svid, evid, depth, skip, limit,
{ edges, vFilter, eFilter, weightExpr }
],
providerSchemas)
checkValidation(result)
const args = result.values
timestamp = args[0]
svid = args[1]
evid = args[2]
depth = args[3]
edges = args[6].edges
skip = args[4]
limit = args[5]
const options = omit(args[6], 'edges')
return kspOp(timestamp, svid, evid, depth, edges, skip, limit, options)
}
module.exports = {
kShortestPaths,
kspProvider
}
kspProvider
Returns k shortest historic paths between vertices, matching the given filters.
Args:
timestamp
- The unix timestamp (sec) for which to traverse node states. Precision: 0.1μs. Example: timestamp=1581583228.2800217. Default: Current Time.svid
- The id of the starting vertex from which to begin traversal.evid
- The id of the ending vertex at which to end traversal.depth
- The max depth to which the traversal should execute.edges
- The edge collections to traverse along with their specified directions.skip
- The number of paths to skip. Default:0
.limit
- The max number of shortest paths to return. Default:1
.options
- An optional object, containing any combination of the following keys:vFilter
- The filter expression to apply on the traversed vertices.eFilter
- The filter expression to apply on the traversed edges.weightExpr
- The weight expression to evaluate cost per edge. Default1
.Return:
The contents of the result returned by the method is identical to the contents of the response body of the corresponding HTTP API, invoked with identical input, except when the method throws an error. In the latter case, the error message would be identical to the error response of the HTTP call.
Errors:
Any error that occurs while executing the method is thrown back to the caller.
Examples: