云服务器内容精选

  • 点集最短路(shortest_path_of_vertex_sets) 表1 parameters参数说明 参数 是否必选 说明 类型 取值范围 默认值 sources 是 起点ID集合 String 标准csv格式,ID之间以英文逗号分隔,例如:“Alice,Nana”。 个数不大于100000。 - targets 是 终点ID集合 String 标准csv格式,ID之间以英文逗号分隔,例如:“Alice,Nana”。 个数不大于100000。 - directed 否 是否考虑边的方向 Boolean 取值为true,不支持false。 true timeWindow 否 用于进行时间过滤的时间窗 Object 具体请参见表2。 - 表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 父主题: 算法API参数参考
  • 最短路径(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 父主题: 算法API参数参考
  • 连通分量(connected_component)(1.0.0) 当前该算法不需要输入parameters参数就可以运行。 表1 response_data参数说明 参数 类型 说明 Max_WCC_size Integer 最大连通分量中节点的个数 Max_WCC_id String 最大连通分量对应的连通集合ID community List 各节点对应的连通集合(community),格式:[{vertexId:communityId},...] 其中, vertexId: string类型 communityId: string类型 父主题: 算法API参数参考
  • louvain算法(louvain)(2.2.1) 表1 parameters参数说明 参数 是否必选 说明 类型 取值范围 默认值 convergence 否 收敛精度。 Double 0~1,不包括0和1。 0.00001 max_iterations 否 最大迭代次数。 Integer API调用限制为[1,2147483647],前端调用限制为[1,2000],默认值为100。 100 weight 否 边上权重 String 空或字符串 空:边上的权重、距离默认为“1” 字符串:对应的边上的属性将作为权重,当某边没有对应属性时,权重将默认为“1” 说明: 边上权重应大于0。 weight 关于迭代次数(iterations)和收敛精度(convergence)参数如何调节,请参考迭代次数和收敛精度的关系。 表2 reponse_data参数说明 参数 类型 说明 modularity Double 模块度。 community_num Integer 社团数量。 community List 各节点对应的社团(community),格式: [{vertexId:communityId},...] 其中, vertexId: string类型 communityId: string类型 父主题: 算法API参数参考
  • 请求示例 带过滤的n_paths算法,算法名称是filtered_n_paths,跳数是6,路径数是100,起始点是111,终点是56。 POST http://IP:PORT/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-algorithm{ "algorithmName": "filtered_n_paths", "filters": [ { "edge_filter": { "property_filter": { "leftvalue": { "label_name": "labelName" }, "predicate": "=", "rightvalue": { "value": "default" } } } }], "parameters": { "k": 6, "n": 100, "source": "111", "target": "56" }}
  • 任务返回示例 { "data": { "outputs": { "data_return_size": 3, "paths": [ [ "111", "119", "58", "96", "82", "57", "56" ], [ "111", "119", "58", "61", "76", "57", "56" ], [ "111", "119", "58", "79", "76", "57", "56" ] ], "runtime": 0.000308, "source": "111", "path_length": 6, "data_offset": 0, "paths_number": 3, "data_total_size": 3, "target": "56" } }, "status": "success"}
  • 请求参数 表1 body体格式 字段名 是否必选 类型 说明 algorithmName 是 String 对应值为“filtered_n_paths”。 parameters 是 Json格式 具体格式见表parameters参数说明。 filters 是 JSon Array 过滤条件列表,数组的每个元素分别对应每一层要做的查询和过滤条件。具体格式见表filters元素格式。 表2 parameters参数说明 参数 是否必选 说明 类型 取值范围 默认值 source 是 起始点 String 图内部点 无 target 是 目标点 String 图内部点 无 k 是 跳数 Int [2,6] 2 n 是 路径数 Int [1,1000] 1 表3 filters元素格式 参数 是否必选 类型 取值范围 默认值 说明 edge_filter 否 json 无 无 全图查询边时的过滤条件。 vertex_filter 否 json 无 无 全图查询点时的过滤条件。 表4 response_data参数说明 字段名 是否必选 类型 说明 path_length 是 int 路径长度。 paths_number 是 int 路径数量。 paths 是 JsonArray 路径集合,["111","119","58","96","82","57","56"]。 source 是 String 起始点。 target 是 String 目标点。