Updated on 2024-01-04 GMT+08:00

Shortest Path

Table 1 parameters parameter description

Parameter

Mandatory

Type

Description

source

Yes

String

Source vertex ID of a path

target

Yes

String

Target vertex ID of a path

directed

No

Boolean

Whether to consider the edge direction. The value is true.

timeWindow

No

Object

Time window for time filtering. For details, see Table 2.

NOTE:

timeWindow does not support the shortest path with weight. That is, parameters timeWindow and weight cannot be both specified.

Table 2 timeWindow parameter description

Parameter

Mandatory

Type

Description

filterName

Yes

String

Character string: The property on the corresponding vertex/edge is used as the time.

filterType

No

String

Filters vertices or edges. The default value is BOTH.

  • V: filtering by vertex
  • E: filtering by edge
  • BOTH: filtering by vertex and edge

startTime

No

String

Start time, which is a string of the date type or a timestamp.

endTime

No

String

End time, which is a string of the date type or a timestamp.

Table 3 response_data parameter description

Parameter

Type

Description

path

List

Shortest path. The format is as follows:

[vertexId,...]

where

vertexId is of the string type.

source

String

Source vertex ID

target

String

Target vertex ID