Network Graphs

Kinetica provides support for graph creation and management in SQL. Graphs represent topological relationships (both geospatial and non-geospatial) via nodes that are connected by edges.

Graph features accessible via SQL include:


CREATE GRAPH

Creates a new graph. The nodes and edges of a graph are optionally weighted and/or restricted to aid in calculating various ways to traverse the graph. Graphs comprise a maximum of four components that each have unique specifications and ways they can be combined to define the graph. Review Components and Identifiers and Identifier Combinations for more information.

CREATE GRAPH Syntax
1
2
3
4
5
6
7
8
CREATE [DIRECTED] GRAPH <graph name>
(
    EDGES => INPUT_TABLE(<select statement>),
    [NODES => INPUT_TABLE(<select statement>)],
    [WEIGHTS => INPUT_TABLE(<select statement>)],
    [RESTRICTIONS => INPUT_TABLE(<select statement>)],
    [OPTIONS => <KV_PAIRS>('<option key>' = '<option value>'[,...])]
)
ParametersDescription
DIRECTEDOptional keyword used to create the graph as directed
<graph name>Name of the graph, which can be referenced in subsequent commands
EDGESGraph component, provided as table column names, expressions, or constants using the SQL INPUT TABLE function, to use for identifying the edges of the graph; review Components and Identifiers and Identifier Combinations for more information
NODESOptional graph component, provided as column names, expressions, or constants using the SQL INPUT TABLE function, to use for identifying the nodes of the graph; review Components and Identifiers and Identifier Combinations for more information
WEIGHTSOptional graph component, provided as column names, expressions, or constants using the SQL INPUT TABLE function, to use for identifying the weights of the graph; review Components and Identifiers and Identifier Combinations for more information
RESTRICTIONSOptional graph component, provided as column names, expressions, or constants using the SQL INPUT TABLE function, to use for identifying the restrictions of the graph; review Components and Identifiers and Identifier Combinations for more information
OPTIONS

Optional indicator that a list of connection option/value assignments will follow, passed as a comma-delimited list of key/value pairs to the KV_PAIRS function

OptionDescription
restriction_threshold_valueValue-based restriction comparison. Any node or edge with a RESTRICTIONS_VALUECOMPARED value greater than the specified value will not be included in the graph.
merge_thresholdIf node geospatial positions are input (e.g., POINT(X Y)), determines the minimum separation allowed between unique nodes. If nodes are within the tolerance of each other, they will be merged as a single node. The default value is '1.0E-4'.
min_xMinimum x (longitude) value for spatial graph associations. The default value is '-180.0'.
max_xMaximum x (longitude) value for spatial graph associations. The default value is '180.0'.
min_yMinimum y (latitude) value for spatial graph associations. The default value is '-90.0'.
max_yMaximum y (latitude) value for spatial graph associations. The default value is '90.0'.
recreateIf set to true and the graph already exists, the graph is deleted and recreated. The default value is false.
modifyIf set to true, recreate is set to true, and the graph already exists, the graph is updated with the given components. The default value is false.
export_create_resultsIf set to true, returns the graph topology in the response as arrays. The default value is false.
enable_graph_drawIf set to true, adds an 'EDGE_WKTLINE' column identifier to the specified graph_table so the graph can be viewed via WMS; for social and non-geospatial graphs, the EDGE_WKTLINE column identifier will be populated with spatial coordinates derived from a flattening layout algorithm so the graph can still be viewed. The default value is false.
save_persistIf set to true, the graph will be saved in the persist directory (see the config reference for more information). If set to false, the graph will be removed when the graph server is shutdown. The default value is false.
sync_dbIf set to true and save_persist is true, the graph will be fully reconstructed upon a database restart and be updated to align with any source table(s) updates made since the creation of the graph. If dynamic graph updates upon table inserts are desired, use add_table_monitor instead. The default value is false.
add_table_monitorAdds a table monitor to every table used in the creation of the graph; this table monitor will trigger the graph to update dynamically upon inserts to the source table(s). Note that upon database restart, if save_persist is also set to true, the graph will be fully reconstructed and the table monitors will be reattached. For more details on table monitors, see Table Monitors. The default value is false.
graph_tableIf specified, the created graph is also created as a table with the given name, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. The table will have the following identifier columns: EDGE_ID, EDGE_NODE1_ID, EDGE_NODE2_ID. If left blank, no table is created. The default value is ''.
remove_label_onlyWhen RESTRICTIONS is specified, if set to true this will NOT delete the entity but only the label associated with the entity. Otherwise (default), it'll delete the label AND the entity. The default value is false.
add_turnsAdds dummy "pillowed" edges around intersection nodes where there are more than three edges so that additional weight penalties can be imposed by the solve endpoints (increases the total number of edges). The default value is false.
turn_angleValue in degrees modifies the thresholds for attributing right, left, sharp turns, and sections. It is the vertical deviation angle from the incoming edge to the intersection node. The larger the value, the larger the threshold for sharp turns and intersections; the smaller the value, the larger the threshold for right and left turns; 0 < turn_angle > 90. The default value is '60'.
server_idIndicates which graph server(s) to send the request to. Default is to send to the server with the most available memory.
use_rtreeUse a range tree structure to accelerate and improve the accuracy of snapping, especially to edges.

To create a graph featuring edges and weights:

CREATE GRAPH with Edges Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
CREATE GRAPH sample_graph (
  EDGES => INPUT_TABLE(
    SELECT 
      id AS EDGE_ID, 
      wktline AS EDGE_WKTLINE 
    FROM example_geospatial.sample_map
  ),
  WEIGHTS => INPUT_TABLE(
    SELECT 
      id AS WEIGHTS_EDGE_ID, 
      cost AS WEIGHTS_VALUESPECIFIED 
    FROM example_geospatial.sample_map
  ),
  OPTIONS => KV_PAIRS(
    'enable_graph_draw' = 'true', 
    'recreate' = 'true', 
    'graph_table' = 'example_geospatial.sample_graph_table'
  )
)

To create a graph featuring nodes, edges, and weights:

CREATE GRAPH with Nodes & Edges Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
CREATE GRAPH big_cities_graph (
  NODES => INPUT_TABLE(
    SELECT
      city_location AS NODE_WKTPOINT 
    FROM example_geospatial.big_cities
  ),
  EDGES => INPUT_TABLE(
    SELECT 
      city1_location AS EDGE_NODE1_WKTPOINT, 
      city2_location AS EDGE_NODE2_WKTPOINT 
    FROM example_geospatial.big_cities_map
  ),
  WEIGHTS => INPUT_TABLE(
    SELECT
      (REMOVE_NULLABLE(ST_MAKELINE(city1_location, city2_location))) AS WEIGHTS_EDGE_WKTLINE,
      trip_time AS WEIGHTS_VALUESPECIFIED
    FROM example_geospatial.big_cities_map
  ),
  OPTIONS => KV_PAIRS(
    'enable_graph_draw' = 'true', 
    'recreate' = 'true', 
    'graph_table' = 'example_geospatial.big_cities_graph_table'
  )
)

SOLVE_GRAPH

Solves an existing graph using one of the supported solver types. The SOLVE GRAPH function can be called either within a SELECT statement as a table function or within an EXECUTE FUNCTION call.

SOLVE_GRAPH Table Function Syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SELECT * FROM TABLE (
    SOLVE_GRAPH
    (
        GRAPH => '<graph name>',
        SOLVER_TYPE => '<solver type>',
        SOURCE_NODES => INPUT_TABLE(<select statement>),
        [DESTINATION_NODES => INPUT_TABLE(<select statement>)],
        [WEIGHTS_ON_EDGES => INPUT_TABLE(<select statement>)],
        [RESTRICTIONS => INPUT_TABLE(<select statement>)],
        [OPTIONS => <KV_PAIRS>('<option name>' = '<option value>'[,...])]
    )
)
SOLVE_GRAPH EXECUTE FUNCTION Syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
EXECUTE FUNCTION SOLVE_GRAPH(
    GRAPH => '<graph name>',
    SOLVER_TYPE => '<solver type>',
    SOURCE_NODES => INPUT_TABLE(<select statement>),
    SOLUTION_TABLE => '<[<schema name>.]table name>',
    [DESTINATION_NODES => INPUT_TABLE(<select statement>)],
    [WEIGHTS_ON_EDGES => INPUT_TABLE(<select statement>)],
    [RESTRICTIONS => INPUT_TABLE(<select statement>)],
    [OPTIONS => <KV_PAIRS>('<option name>' = '<option value>'[,...])
)
ParametersDescription
GRAPHName of the graph to solve
SOLVER_TYPE

The type of solver to use for the operation.

SolverDescriptionCPU Parallel
ALLPATHSDetermines all reasonable paths between a source and destination pair.X
BACKHAUL_ROUTINGDetermines the optimal routes between remote asset nodes and fixed asset nodes.X
CENTRALITYCalculates the degree of a node to depict how many pairs of individuals that would have to go through the node to reach one another in the minimum number of hops. Also known as betweenness.X
CLOSENESSCalculates the centrality closeness score per node as the sum of the inverse shortest path costs to all nodes in the graph.X
INVERSE_SHORTEST_PATHDetermines the shortest path downstream using multiple technician routing.X
MULTIPLE_ROUTINGCalculates the shortest possible route between the nodes and returns to the origin node -- also known as the traveling salesman.X
PAGE_RANKCalculates how connected the nodes are and determines which nodes are the most important. Weights are not required.X
PROBABILITY_RANKCalculates the probability of a node being connected to another node using hidden Markov chains.X
SHORTEST_PATHDetermines the shortest path upstream between given source(s) and destination(s).X
STATS_ALLCalculates graph statistics such as graph diameter, longest pairs, vertex valences, topology numbers, average and max cluster sizes, etc.X

SOURCE_NODESThe node(s) used as the origin point(s) for the solution specified using the SQL INPUT TABLE function
SOLUTION_TABLEOnly applicable when using EXECUTE FUNCTION syntax. Name of the table to store the solution in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria
DESTINATION_NODESThe node(s) used as the destination point(s) for the solution specified using the SQL INPUT TABLE function
WEIGHTS_ON_EDGESAdditional weights to apply to the edges of an existing graph specified using the SQL INPUT TABLE function; review Components and Identifiers and Identifier Combinations for more information
RESTRICTIONSAdditional restrictions to apply to the nodes/edges of an existing graph specified using the SQL INPUT TABLE function; review Components and Identifiers and Identifier Combinations for more information
OPTIONS

Optional indicator that a comma-delimited list of connection option/value assignments will follow.

OptionDescription
max_solution_radiusFor SHORTEST_PATH and INVERSE_SHORTEST_PATH solvers only. Sets the maximum solution cost radius, which ignores the DESTINATION_NODES list and instead outputs the nodes within the radius sorted by ascending cost. If set to 0.0 (the default), the setting is ignored
min_solution_radiusFor SHORTEST_PATH and INVERSE_SHORTEST_PATH solvers only. Applicable only when max_solution_radius is set. Sets the minimum solution cost radius, which ignores the DESTINATION_NODES list and instead outputs the nodes within the radius sorted by ascending cost. If set to 0.0 (the default), the setting is ignored
max_solution_targetsFor SHORTEST_PATH and INVERSE_SHORTEST_PATH solvers only. Sets the maximum number of solution targets, which ignores the DESTINATION_NODES list and instead outputs no more than n number of nodes sorted by ascending cost where n is equal to the setting value. If set to 0 (the default), the setting is ignored
export_solve_resultsReturns solution results inside the result_per_destination_node array in the response if set to true. The default is false.
remove_previous_restrictionsIgnore the restrictions applied to the graph during the creation stage and only use the restrictions specified in this request if set to true. The default value is false.
restriction_threshold_valueValue-based restriction comparison. Any node or edge with a RESTRICTIONS_VALUECOMPARED value greater than the specified value will not be included in the solution.
uniform_weightsWhen specified, assigns the given value to all the edges in the graph. Note that weights provided using weights_on_edges will override this value.
left_turn_penaltyThis will add an additional weight over the edges labelled as left_turn if the add_turn option was invoked during graph creation. The default value is 0.0.
right_turn_penaltyThis will add an additional weight over the edges labelled as right_turn if the add_turn option was invoked during graph creation. The default value is 0.0.
intersection_penaltyThis will add an additional weight over the edges labelled as intersection if the add_turn option was invoked during graph creation. The default value is 0.0.
sharp_turn_penaltyThis will add an additional weight over the edges labelled as sharp_turn or u_turn if the add_turn option was invoked during graph creation. The default value is 0.0.
num_best_pathsFor MULTIPLE_ROUTING solver only. Sets the number of shortest paths computed from each node. This is the heuristic criterion. If set to 0 (the default), the number will be determined automatically by the solver. Users may want to override this parameter to speed up the solver.
max_num_combinationsFor MULTIPLE_ROUTING solver only. Sets the cap on the combinatorial sequence generated. If the default value (2000000) is overridden, it potentially speed up the solver.
accurate_snapsValid for single source destination pair solves if points are described as NODE_WKPOINT identifiers. When set to true (default), the solver will snap to the nearest node of the defined graph; otherwise, the solver will search for the closest entity that could be part of an edge in the defined graph. For the latter case (false), the solver modifies the resulting cost with the weights proportional to the ratio of the snap location within the edge. If the value is false, performance may be adversely affected, though the accuracy of the calculation may only improve by 1%.
output_edge_pathIf set to true, concatenated edge IDs will be added as an EDGE_PATH column to the solution table for each source and target pair in the SHORTEST_PATH solves. The default value is false
output_wkt_pathIf set to true, WKT line segments will be added as a WKTROUTE column to the solution table for each source and target pair in SHORTEST_PATH solves. The default value is true.
server_idIndicates which graph server(s) to send the request to. Default is to send to the server, amongst those containing the corresponding graph, that has the most computational bandwidth. For SHORTEST_PATH solver, the input is split among the server containing the corresponding graph.
convergence_limitFor PAGE_RANK solver only; maximum percent relative threshold on the pagerank scores of each node between consecutive iterations to satisfy convergence. Default value is 1%.
max_iterationsFor PAGE_RANK solver only; maximum number of pagerank iterations for satisfying convergence. Default value is 100.
max_runsFor CENTRALITY solver only; sets the maximum number of shortest path runs; maximum possible value is the number of nodes in the graph. Default value of 0 enables this value to be auto computed by the solver.
output_clustersFor STATS_ALL solver only; the cluster index for each node will be inserted as an additional column in the output.

To solve a graph using the SHORTEST_PATH solver and the table function syntax:

SOLVE_GRAPH Table Function Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SELECT * FROM TABLE(
  SOLVE_GRAPH(
    GRAPH => 'sample_graph',
    SOLVER_TYPE => 'SHORTEST_PATH',
    SOURCE_NODES => INPUT_TABLE(SELECT ST_GEOMFROMTEXT('POINT(0 0)') AS NODE_WKTPOINT),
    DESTINATION_NODES => INPUT_TABLE(SELECT ST_GEOMFROMTEXT('POINT(-5 -5)') AS NODE_WKTPOINT),
    OPTIONS => KV_PAIRS(
      'export_solve_results' = 'true',
      'output_edge_path' = 'true'
    )
  )
)

To solve a graph using the SHORTEST_PATH solver and the EXECUTE FUNCTION syntax (note the additional SOLUTION_TABLE parameter):

SOLVE_GRAPH EXECUTE FUNCTION Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
EXECUTE FUNCTION SOLVE_GRAPH(
  GRAPH => 'sample_graph',
  SOLVER_TYPE => 'SHORTEST_PATH',
  SOURCE_NODES => INPUT_TABLE(SELECT ST_GEOMFROMTEXT('POINT(0 0)') AS NODE_WKTPOINT),
  DESTINATION_NODES => INPUT_TABLE(SELECT ST_GEOMFROMTEXT('POINT(-5 -5)') AS NODE_WKTPOINT),
  SOLUTION_TABLE => 'sample_graph_solved_shortest_path',
  OPTIONS => KV_PAIRS(
    'export_solve_results' = 'true',
    'output_edge_path' = 'true'
  )
)

QUERY_GRAPH

Queries an existing graph using unique query identifiers and combinations. The QUERY_GRAPH function can be called either within a SELECT statement as a table function or within an EXECUTE FUNCTION call.

QUERY_GRAPH Table Function Syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
SELECT * FROM TABLE(
    QUERY_GRAPH
    (
        GRAPH => '<graph name>',
        QUERIES => INPUT_TABLE(<select statement>),
        RINGS => <integer>,
        [RESTRICTIONS => INPUT_TABLE(<select statement>)],
        [OPTIONS => <KV_PAIRS>('<option name>' = '<option value>'[,...])]
    )
)
QUERY_GRAPH EXECUTE FUNCTION Syntax
1
2
3
4
5
6
7
8
EXECUTE FUNCTION QUERY_GRAPH(
    GRAPH => '<graph name>',
    QUERIES => INPUT_TABLE(<select statement>),
    ADJACENCY_TABLE => '<[<schema name>.]table name>',
    RINGS => <integer>,
    [RESTRICTIONS => INPUT_TABLE(<select statement>)],
    [OPTIONS => <KV_PAIRS>('<option name>' = '<option value>'[,...])]
)
ParametersDescription
GRAPHName of the graph to query
QUERIESNodes or edges to be queried specified using the SQL INPUT TABLE function; review Query Identifiers and Query Identifier Combinations for more information
ADJACENCY_TABLEOnly applicable when using EXECUTE FUNCTION syntax. Name of the table to store the resulting adjacencies in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria
RINGSSets the number of rings around the node to query for adjacency
RESTRICTIONSAdditional restrictions to apply to the nodes/edges of an existing graph specified using the SQL INPUT TABLE function; review Components and Identifiers and Identifier Combinations for more information
OPTIONS

Optional indicator that a comma-delimited list of connection option/value assignments will follow.

OptionDescription
force_undirectedIf set to true, all inbound and outbound edges relative to the node will be returned. If set to false, only outbound edges relative to the node will be returned. This parameter is only applicable if the graph is directed and when querying nodes. Consult Directed Graphs for more details. The default is false.
limitWhen specified, limits the number of query results. Note that if target_nodes_table is provided, the size of the corresponding table will be limited by this value.
target_nodes_tableName of the table to store the list of the final nodes reached during traversal, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. If this value is left as the default, the table name will default to the provided ADJACENCY_TABLE value, if specified, plus a _nodes suffix, e.g., <ADJACENCY_TABLE value>_nodes. The default value is ''.
restriction_threshold_valueValue-based restriction comparison. Any node or edge with a RESTRICTIONS_VALUECOMPARED value greater than the specified value will not be included in the solution.
export_query_resultsReturns query results in the response. If set to true, the output adjacency integer, string, or WKT array (depending on what was queried for) will be populated with the results. If set to false, none of the arrays will be populated. The default value is false.
enable_graph_drawIf set to true, adds a QUERY_EDGE_WKTLINE column identifier to the specified ADJACENCY_TABLE so the solution can be viewed via WMS; for social and non-geospatial solutions, the QUERY_EDGE_WKTLINE column identifier will be populated with spatial coordinates derived from a flattening layout algorithm so the solution can still be viewed. The default value is false.
and_labelsIf set to true, the result of the query has entities that satisfy all of the target labels instead of any of the labels. The default value is false.
server_idIndicates which graph server(s) to send the request to. Default is to send to the server, amongst those containing the corresponding graph, that has the most computational bandwidth.

To query a graph node within one ring using the table function syntax:

QUERY_GRAPH Table Function Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
SELECT * FROM TABLE(
  QUERY_GRAPH(
    GRAPH => 'sample_graph',
    QUERIES => INPUT_TABLE(SELECT ST_GEOMFROMTEXT('POINT(0 0)') AS QUERY_NODE_WKTPOINT),
    RINGS => 1,
    OPTIONS => KV_PAIRS(
      'enable_graph_draw' = 'true'
    )
  )
)

To query a different graph node within two rings using the execute function syntax (note the additional required ADJACENCY_TABLE parameter):

QUERY_GRAPH EXECUTE FUNCTION Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
EXECUTE FUNCTION QUERY_GRAPH(
  GRAPH => 'sample_graph',
  QUERIES => INPUT_TABLE(SELECT ST_GEOMFROMTEXT('POINT(5 5)') AS QUERY_NODE_WKTPOINT),
  RINGS => 2,
  ADJACENCY_TABLE => 'sample_graph_node_query2',
  OPTIONS => KV_PAIRS(
    'export_query_results' = 'true',
    'enable_graph_draw' = 'true'
  )
)

MATCH_GRAPH

Matches an existing graph to a dataset using one of the supported solver types and sample points which are defined using unique match identifiers and combinations. The MATCH_GRAPH function can be called either within a SELECT statement as a table function or within an EXECUTE FUNCTION call.

MATCH_GRAPH Table Function Syntax
1
2
3
4
5
6
7
8
9
SELECT * FROM TABLE(
    MATCH_GRAPH
    (
        GRAPH => '<graph name>',
        SAMPLE_POINTS => INPUT_TABLE(<select statement>),
        SOLVE_METHOD => '<solver type>',
        [OPTIONS => <KV_PAIRS>('<option name>' = '<option value>'[,...])]
    )
)
MATCH_GRAPH EXECUTE FUNCTION Syntax
1
2
3
4
5
6
7
EXECUTE FUNCTION MATCH_GRAPH(
    GRAPH => '<graph name>',
    SAMPLE_POINTS => INPUT_TABLE(<select statement>),
    SOLVE_METHOD => '<solver type>',
    SOLUTION_TABLE => '<[<schema name>.]table name>',
    [OPTIONS => <KV_PAIRS>('<option name>' = '<option value>'[,...])]
)
ParametersDescription
GRAPHName of the graph to match
SAMPLE_POINTSSample points used to match an underlying geospatial graph specified using the SQL INPUT TABLE function. Sample points are specified as identifiers, which are grouped into combinations.
SOLVE_METHOD

The type of solve method to use for the operation; review Match Identifier Combinations for more information.

SolverDescriptionCPU Parallel
MARKOV_CHAINMatches sample points to the graph using the Hidden Markov Model (HMM)-based method, which conducts a range-tree closest-edge search to find the best combinations of possible road segments for each sample point to create the best route. The route is secured one point at a time, so the prediction is corrected after each point. This solution type is the most accurate, but also the most computationally intensive.X
MATCH_BATCH_SOLVESMatches each provided sample source and destination pair using the shortest path between the points.X
MATCH_LOOPSMatches closed loops (Eulerian paths) originating and ending at each graph node between min and max hops (levels).X
MATCH_OD_PAIRSMatches sample points to find the most probable path between origin and destination (OD) pairs with given cost constraints.X
MATCH_SUPPLY_DEMANDMatches sample generic supply depots to generic demand points using abstract transportation (referred to as trucks). Each route is determined by a truck's ability (size) to service demand at each demand point.X

SOLUTION_TABLEOnly applicable when using EXECUTE FUNCTION syntax. Name of the table to store the solution in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria
OPTIONS

Optional indicator that a comma-delimited list of connection option/value assignments will follow.

OptionDescription
gps_noiseGPS noise value (in meters) to remove redundant sample points. Use -1 to disable noise reduction. The default value (5.0) accounts for 95% of point variation (±5 meters)
num_segmentsMaximum number of potentially matching road segments for each sample point. The default is 3.
search_radiusMaximum search radius used when snapping sample points onto potentially matching surrounding segments. The default value (0.001) corresponds to approximately 100 meters.
chain_widthFor the MARKOV_CHAIN solver only. Length of the sample points lookahead window within the Markov kernel; the larger the number, the more accurate the solution. The default value is 9.
sourceOptional WKT starting point from SAMPLE_POINTS for the solver. The default behavior for the endpoint is to use time to determine the starting point. The default value is POINT NULL.
destinationOptional WKT ending point from SAMPLE_POINTS for the solver. The default behavior for the endpoint is to use time to determine the destination point. The default value is POINT NULL.
partial_loadingFor the MATCH_SUPPLY_DEMAND solver only. When false (non-default), trucks do not off-load at the demand (store) side if the remainder is less than the store's need.
max_combinationsFor the MATCH_SUPPLY_DEMAND solver only. This is the cutoff for the number of generated combinations for sequencing the demand locations. The maximum number of combinations is 2000000. The default value is 10000.
left_turn_penaltyThis will add an additional weight over the edges labelled as left_turn if the add_turn option was invoked during graph creation. The default value is 0.0.
right_turn_penaltyThis will add an additional weight over the edges labelled as right_turn if the add_turn option was invoked during graph creation. The default value is 0.0.
intersection_penaltyThis will add an additional weight over the edges labelled as intersection if the add_turn option was invoked during graph creation. The default value is 0.0.
sharp_turn_penaltyThis will add an additional weight over the edges labelled as sharp_turn or u_turn if the add_turn option was invoked during graph creation. The default value is 0.0.
aggregated_outputFor the MATCH_SUPPLY_DEMAND solver only. When set to true (default), each record in the output table shows a particular truck's scheduled cumulative round trip path (MULTILINESTRING) and the corresponding aggregated cost. Otherwise, each record shows a single scheduled truck route (LINESTRING) towards a particular demand location (store ID) with its corresponding cost.
output_tracksFor the MATCH_SUPPLY_DEMAND solver only. When it is true (non-default), the output will be in tracks format for all the round trips of each truck in which the timestamps are populated directly from the edge weights starting from their originating depots.
max_trip_costFor the MATCH_SUPPLY_DEMAND solver only. If this constraint is greater than 0 (default), then the trucks will skip traveling from one demand location to another if the cost between them is greater than this number (distance or time). The default value means no check is performed.
filter_folding_pathsFor the MARKOV_CHAIN solver only. When set to true (non-default), the paths per sequence combination is checked for folding over patterns and can significantly increase the execution time depending on the chain width and the number of GPS samples.
unit_unloading_costFor the MATCH_SUPPLY_DEMAND solver only. The unit cost per load amount to be delivered. If this value is greater than 0 (default) then the additional cost of this unit load multiplied by the total dropped load will be added over to the trip cost to the demand location
max_num_threadsFor the MARKOV_CHAIN solver only. If specified value is greater than 0 (default), the maximum number of threads will not be greater than the specified value. It can be lower due to the memory and number of cores available. The default value allows the algorithm to set the optimal number of threads within these constraints.
truck_service_limitFor the MATCH_SUPPLY_DEMAND solver only. If specified, any truck's total service cost (distance or time) will be limited by the specified value including multiple rounds of drop-off (if set). The default value is 0.0.
enable_truck_reuseFor the MATCH_SUPPLY_DEMAND solver only. If set to true (non-default) all trucks can be scheduled for additional rounds of supply drop-off from their originating depots.
max_truck_stopsFor the MATCH_SUPPLY_DEMAND solver only. If specified (greater than zero), a truck can at most have this many stops (demand locations) in one round trip. Otherwise, it is unlimited. If enable_truck_reuse is on, this condition will be applied separately at each round trip use of the same truck.
server_idIndicates which graph server(s) to send the request to. Default is to send to the server, among those containing the corresponding graph, that has the most computational bandwidth.
inverse_solveFor the MATCH_BATCH_SOLVES solver only. Solves source-destination pairs using inverse shortest path solver.
min_loop_levelFor the MATCH_LOOPS solver only. Finds closed loops around each node deducible not less than this minimal hop (level) deep.
max_loop_levelFor the MATCH_LOOPS solver only. Finds closed loops around each node deducible not more than this maximal hop (level) deep.
search_limitFor the MATCH_LOOPS solver only. Searches within this limit of nodes per vertex to detect loops. The value zero means there is no limit.
output_batch_sizeFor the MATCH_LOOPS solver only. Uses this value as the batch size of the number of loops in flushing (inserting) to the output table.

To match a graph to its parent dataset using the table function syntax:

MATCH_GRAPH Table Function Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
SELECT * FROM TABLE(
  MATCH_GRAPH(
    GRAPH => 'big_cities_graph',
    SAMPLE_POINTS => INPUT_TABLE(
      SELECT
        city1_location AS SAMPLE_ORIGIN_WKTPOINT,
        city2_location AS SAMPLE_DESTINATION_WKTPOINT,
        trip_time AS SAMPLE_OD_TIME
      FROM example_geospatial.big_cities_map
    ),
    SOLVE_METHOD => 'match_od_pairs'
  )
)

To match the same graph to its parent set instead using the EXECUTE FUNCTION syntax (note the additional required SOLUTION_TABLE parameter):

MATCH_GRAPH EXECUTE FUNCTION Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
EXECUTE FUNCTION MATCH_GRAPH(
  GRAPH => 'big_cities_graph',
  SAMPLE_POINTS => INPUT_TABLE(
    SELECT
      city1_location AS SAMPLE_ORIGIN_WKTPOINT,
      city2_location AS SAMPLE_DESTINATION_WKTPOINT,
      trip_time AS SAMPLE_OD_TIME
    FROM example_geospatial.big_cities_map
  ),
  SOLVE_METHOD => 'match_od_pairs',
  SOLUTION_TABLE => 'big_cities_graph_matched'
)