Updated on 2023-03-03 GMT+08:00

Filtered All Pairs Shortest Paths

Overview

The Filtered All Pairs Shortest Paths algorithm is used to search for the shortest path between any two vertices in the graph that meets the condition. In a specific application scenario, you need to set a start vertex set (sources) and end vertex set (targets) as input for this algorithm. This algorithm returns the required shortest paths between the start and the end vertex sets.

Application Scenarios

This algorithm applies to relationship mining, path planning, and network planning.

Parameter Description

Table 1 Parameters

Name

Mandatory

Description

Type

Value Range

Default

sources

Yes

Set of start vertex IDs. The value is in the standard CSV input format, that is, multiple vertex IDs are separated by commas (,).

String

The number of source vertices cannot exceed 10,000.

-

-

targets

Yes

Set of end vertex IDs. The value is in the standard CSV input format, that is, multiple vertex IDs are separated by commas (,).

String

The number of target vertices cannot exceed 10,000.

-

-

directed

No

Whether the edges are directed

Bool

The value can be true or false.

-

cutoff

No

Maximum length

Int

1-100

6

path_limit

No

Maximum number of paths

Int

  • For synchronous tasks:

The value ranges from 1 to 100000. The default value is 100000.

  • For asynchronous tasks:

The value ranges from 1 to 1000000. The default value is 1000000.

1000000

100000/1000000

Example

Configure the parameters as follows: directed=true, sources="Alice,Vivian", targets="Jay,Bonnie", and set the edge search condition labelName=friends. The shortest paths between each pair of start and end vertices are returned in JSON format.