Previous versions of this page
Based on A* algorithm, the bidirectional search finds a shortest path from
a starting vertex (start_vid
) to an ending vertex (end_vid
).
It runs two simultaneous searches: one forward from the start_vid
, and one backward from the end_vid
,
stopping when the two meet in the middle.
This implementation can be used with a directed graph and an undirected graph.
The main Characteristics are:
edges_sql:  an SQL query, which should return a set of rows with the following columns: 

Column  Type  Default  Description 

id  ANYINTEGER 
Identifier of the edge.  
source  ANYINTEGER 
Identifier of the first end point vertex of the edge.  
target  ANYINTEGER 
Identifier of the second end point vertex of the edge.  
cost  ANYNUMERICAL 
Weight of the edge (source, target)


reverse_cost  ANYNUMERICAL 
1  Weight of the edge (target, source),

x1  ANYNUMERICAL 
X coordinate of source vertex.  
y1  ANYNUMERICAL 
Y coordinate of source vertex.  
x2  ANYNUMERICAL 
X coordinate of target vertex.  
y2  ANYNUMERICAL 
Y coordinate of target vertex. 
Where:
ANYINTEGER:  SMALLINT, INTEGER, BIGINT 

ANYNUMERICAL:  SMALLINT, INTEGER, BIGINT, REAL, FLOAT 
Parameter  Type  Description 

edges_sql  TEXT 
Edges SQL query as described above. 
start_vid  ANYINTEGER 
Starting vertex identifier. 
start_vids  ARRAY[ANYINTEGER] 
Starting vertices identifierers. 
end_vid  ANYINTEGER 
Ending vertex identifier. 
end_vids  ARRAY[ANYINTEGER] 
Ending vertices identifiers. 
directed  BOOLEAN 

heuristic  INTEGER 
(optional). Heuristic number. Current valid values 0~5. Default

factor  FLOAT 
(optional). For units manipulation. \(factor > 0\). Default 1 . see Factor 
epsilon  FLOAT 
(optional). For less restricted results. \(epsilon >= 1\). Default 1 . 