图引擎服务 GES-最短路径(shortest_path)(2.1.5)

时间:2024-04-29 11:34:09

最短路径(shortest_path)(2.1.5)

表1 parameters参数说明

参数

是否必选

说明

类型

取值范围

默认值

source

输入路径的起点ID。

String

-

-

target

输入路径的终点ID。target取值不能与source取值相同。

String

-

-

weight

边上权重。

String

空或字符串。

  • 空:边上的权重、距离默认为“1”
  • 字符串:对应的边上的属性将作为权重,当某边没有对应属性时,权重将默认为1。
    说明:

    边上权重应大于0。

-

directed

是否考虑边的方向。

Boolean

true或false。

false

timeWindow

用于进行时间过滤的时间窗

Object

具体请参见表2

说明:

timeWindow目前不支持带weight的最短路,即timeWindow与weight不可同时输入。

-

表2 timeWindow参数说明

参数

是否必选

说明

类型

取值范围

默认值

filterName

用于进行时间过滤的时间属性名称

String

字符串:对应的点/边上的属性作为时间

-

filterType

在点或边上过滤

String

V:点上

E:边上

BOTH:点和边上

BOTH

startTime

起始时间

String

Date型字符串或时间戳

-

endTime

终止时间

String

Date型字符串或时间戳

-

表3 response_data参数说明

参数

类型

说明

path

List

最短路径,格式:

[vertexId,...]

其中,

vertexId:string类型

source

String

起点ID

target

String

终点ID

support.huaweicloud.com/api-ges/ges_03_0143.html