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

Filtered All Shortest Paths

Parameters

Table 1 parameters parameter description

Parameter

Mandatory

Description

Type

Value Range

Default Value

source

Yes

Source vertex ID

String

-

-

-

target

Yes

Target vertex ID

String

-

-

directed

No

Whether an edge is directed

Boolean

The value can be true or false.

false

Table 2 response_data parameter description

Parameter

Type

Description

paths

List

Paths between the source and target vertices. The format is as follows:

[[path1],[path2]]

where

For the format of each path, see Shortest Path.

paths_number

Integer

Number of paths

source

String

Source vertex ID

target

String

Target vertex ID

Example Request

POST    /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-algorithm
{
    "algorithmName": "filtered_all_shortest_paths",
    "edge_filter": {
        "property_filter": {
            "leftvalue": {
                "label_name": "labelName"
            },
            "predicate": "=",
            "rightvalue": {
                "value": "friends"
            }
        }
    },
    "parameters": {
        "source": "Alice",
        "target": "Jay",
        "directed": true
    }
}

Response

{
    "data": {
        "outputs": {
            "data_return_size": 8,
            "paths": [
                [
                    "Alice",
                    "Janet",
                    "Yvette",
                    "Willy",
                    "Jay"
                ],
                ...
                [
                    "Alice",
                    "Jacob",
                    "Jimmy",
                    "Cary",
                    "Jay"
                ]
            ],
            "runtime": 0.005276,
            "source": "Alice",
            "data_offset": 0,
            "paths_number": 8,
            "data_total_size": 8,
            "target": "Jay"
        }
    }
}
Table 3 response_data parameter description

Parameter

Type

Description

paths

List

Paths between the source and target vertices. The format is as follows:

[[path1],[path2]]

where

For the format of each path, see Shortest Path.

paths_number

Integer

Number of paths

source

String

Source vertex ID

target

String

Target vertex ID