GPUdb C++ API  Version 7.2.2.4
gpudb::SolveGraphRequest Struct Reference

A set of parameters for GPUdb::solveGraph. More...

#include <gpudb/protocol/solve_graph.h>

Public Member Functions

 SolveGraphRequest ()
 Constructs a SolveGraphRequest object with default parameters. More...
 
 SolveGraphRequest (const std::string &graphName_, const std::vector< std::string > &weightsOnEdges_, const std::vector< std::string > &restrictions_, const std::string &solverType_, const std::vector< std::string > &sourceNodes_, const std::vector< std::string > &destinationNodes_, const std::string &solutionTable_, const std::map< std::string, std::string > &options_)
 Constructs a SolveGraphRequest object with the specified parameters. More...
 

Public Attributes

std::string graphName
 Name of the graph resource to solve. More...
 
std::vector< std::string > weightsOnEdges
 Additional weights to apply to the edges of an existing graph. More...
 
std::vector< std::string > restrictions
 Additional restrictions to apply to the nodes/edges of an existing graph. More...
 
std::string solverType
 The type of solver to use for the graph. More...
 
std::vector< std::string > sourceNodes
 It can be one of the nodal identifiers - e.g: 'NODE_WKTPOINT' for source nodes. More...
 
std::vector< std::string > destinationNodes
 It can be one of the nodal identifiers - e.g: 'NODE_WKTPOINT' for destination (target) nodes. More...
 
std::string solutionTable
 Name of the table to store the solution, in [ schema_name. More...
 
std::map< std::string, std::string > options
 Additional parameters. More...
 

Detailed Description

A set of parameters for GPUdb::solveGraph.

Solves an existing graph for a type of problem (e.g., shortest path, page rank, travelling salesman, etc.) using source nodes, destination nodes, and additional, optional weights and restrictions.

IMPORTANT: It's highly recommended that you review the Graphs & Solvers concepts documentation, the Graph REST Tutorial, and/or some /solve/graph examples before using this endpoint.

Definition at line 26 of file solve_graph.h.

Constructor & Destructor Documentation

◆ SolveGraphRequest() [1/2]

gpudb::SolveGraphRequest::SolveGraphRequest ( )
inline

Constructs a SolveGraphRequest object with default parameters.

Definition at line 31 of file solve_graph.h.

◆ SolveGraphRequest() [2/2]

gpudb::SolveGraphRequest::SolveGraphRequest ( const std::string &  graphName_,
const std::vector< std::string > &  weightsOnEdges_,
const std::vector< std::string > &  restrictions_,
const std::string &  solverType_,
const std::vector< std::string > &  sourceNodes_,
const std::vector< std::string > &  destinationNodes_,
const std::string &  solutionTable_,
const std::map< std::string, std::string > &  options_ 
)
inline

Constructs a SolveGraphRequest object with the specified parameters.

Parameters
[in]graphName_Name of the graph resource to solve.
[in]weightsOnEdges_Additional weights to apply to the edges of an existing graph. Weights must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS WEIGHTS_EDGE_ID', expressions, e.g., 'ST_LENGTH(wkt) AS WEIGHTS_VALUESPECIFIED', or constant values, e.g., '{4, 15, 2} AS WEIGHTS_VALUESPECIFIED'. Any provided weights will be added (in the case of 'WEIGHTS_VALUESPECIFIED') to or multiplied with (in the case of 'WEIGHTS_FACTORSPECIFIED') the existing weight(s). If using constant values in an identifier combination, the number of values specified must match across the combination. The default value is an empty vector.
[in]restrictions_Additional restrictions to apply to the nodes/edges of an existing graph. Restrictions must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS RESTRICTIONS_EDGE_ID', expressions, e.g., 'column/2 AS RESTRICTIONS_VALUECOMPARED', or constant values, e.g., '{0, 0, 0, 1} AS RESTRICTIONS_ONOFFCOMPARED'. If using constant values in an identifier combination, the number of values specified must match across the combination. If remove_previous_restrictions option is set to true, any provided restrictions will replace the existing restrictions. Otherwise, any provided restrictions will be added (in the case of 'RESTRICTIONS_VALUECOMPARED') to or replaced (in the case of 'RESTRICTIONS_ONOFFCOMPARED'). The default value is an empty vector.
[in]solverType_The type of solver to use for the graph. Supported values:
  • solve_graph_SHORTEST_PATH: Solves for the optimal (shortest) path based on weights and restrictions from one source to destinations nodes. Also known as the Dijkstra solver.
  • solve_graph_PAGE_RANK: Solves for the probability of each destination node being visited based on the links of the graph topology. Weights are not required to use this solver.
  • solve_graph_PROBABILITY_RANK: Solves for the transitional probability (Hidden Markov) for each node based on the weights (probability assigned over given edges).
  • solve_graph_CENTRALITY: Solves for 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.
  • solve_graph_MULTIPLE_ROUTING: Solves for finding the minimum cost cumulative path for a round-trip starting from the given source and visiting each given destination node once then returning to the source. Also known as the travelling salesman problem.
  • solve_graph_INVERSE_SHORTEST_PATH: Solves for finding the optimal path cost for each destination node to route to the source node. Also known as inverse Dijkstra or the service man routing problem.
  • solve_graph_BACKHAUL_ROUTING: Solves for optimal routes that connect remote asset nodes to the fixed (backbone) asset nodes.
  • solve_graph_ALLPATHS: Solves for paths that would give costs between max and min solution radia - Make sure to limit by the 'max_solution_targets' option. Min cost shoudl be >= shortest_path cost.
  • solve_graph_STATS_ALL: Solves for graph statistics such as graph diameter, longest pairs, vertex valences, topology numbers, average and max cluster sizes, etc.
  • solve_graph_CLOSENESS: Solves for the centrality closeness score per node as the sum of the inverse shortest path costs to all nodes in the graph.
The default value is solve_graph_SHORTEST_PATH.
[in]sourceNodes_It can be one of the nodal identifiers - e.g: 'NODE_WKTPOINT' for source nodes. For BACKHAUL_ROUTING, this list depicts the fixed assets. The default value is an empty vector.
[in]destinationNodes_It can be one of the nodal identifiers
  • e.g: 'NODE_WKTPOINT' for destination (target) nodes. For BACKHAUL_ROUTING, this list depicts the remote assets. The default value is an empty vector.
[in]solutionTable_Name of the table to store the solution, in [schema_name.]table_name format, using standard name resolution rules. The default value is 'graph_solutions'.
[in]options_Additional parameters.
  • solve_graph_max_solution_radius: For ALLPATHS, SHORTEST_PATH and INVERSE_SHORTEST_PATH solvers only. Sets the maximum solution cost radius, which ignores the destinationNodes_ list and instead outputs the nodes within the radius sorted by ascending cost. If set to '0.0', the setting is ignored. The default value is '0.0'.
  • solve_graph_min_solution_radius: For ALLPATHS, 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 destinationNodes_ list and instead outputs the nodes within the radius sorted by ascending cost. If set to '0.0', the setting is ignored. The default value is '0.0'.
  • solve_graph_max_solution_targets: For ALLPATHS, SHORTEST_PATH and INVERSE_SHORTEST_PATH solvers only. Sets the maximum number of solution targets, which ignores the destinationNodes_ 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 setting is ignored. The default value is '1000'.
  • solve_graph_uniform_weights: When specified, assigns the given value to all the edges in the graph. Note that weights provided in weightsOnEdges_ will override this value.
  • solve_graph_left_turn_penalty: This will add an additonal weight over the edges labelled as 'left turn' if the 'add_turn' option parameter of the GPUdb::createGraph was invoked at graph creation. The default value is '0.0'.
  • solve_graph_right_turn_penalty: This will add an additonal weight over the edges labelled as' right turn' if the 'add_turn' option parameter of the GPUdb::createGraph was invoked at graph creation. The default value is '0.0'.
  • solve_graph_intersection_penalty: This will add an additonal weight over the edges labelled as 'intersection' if the 'add_turn' option parameter of the GPUdb::createGraph was invoked at graph creation. The default value is '0.0'.
  • solve_graph_sharp_turn_penalty: This will add an additonal weight over the edges labelled as 'sharp turn' or 'u-turn' if the 'add_turn' option parameter of the GPUdb::createGraph was invoked at graph creation. The default value is '0.0'.
  • solve_graph_num_best_paths: For MULTIPLE_ROUTING solvers only; sets the number of shortest paths computed from each node. This is the heuristic criterion. Default value of zero allows the number to be computed automatically by the solver. The user may want to override this parameter to speed-up the solver. The default value is '0'.
  • solve_graph_max_num_combinations: For MULTIPLE_ROUTING solvers only; sets the cap on the combinatorial sequences generated. If the default value of two millions is overridden to a lesser value, it can potentially speed up the solver. The default value is '2000000'.
  • solve_graph_output_edge_path: If true then concatenated edge ids will be added as the EDGE path column of the solution table for each source and target pair in shortest path solves. Supported values: The default value is solve_graph_false.
  • solve_graph_output_wkt_path: If true then concatenated wkt line segments will be added as the Wktroute column of the solution table for each source and target pair in shortest path solves. Supported values: The default value is solve_graph_true.
  • solve_graph_server_id: Indicates 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 type, the input is split amongst the server containing the corresponding graph.
  • solve_graph_convergence_limit: For PAGE_RANK solvers only; Maximum percent relative threshold on the pagerank scores of each node between consecutive iterations to satisfy convergence. Default value is 1 (one) percent. The default value is '1.0'.
  • solve_graph_max_iterations: For PAGE_RANK solvers only; Maximum number of pagerank iterations for satisfying convergence. Default value is 100. The default value is '100'.
  • solve_graph_max_runs: For all CENTRALITY solvers 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. The default value is '0'.
  • solve_graph_output_clusters: For STATS_ALL solvers only; the cluster index for each node will be inserted as an additional column in the output. Supported values: The default value is solve_graph_false.
  • solve_graph_solve_heuristic: Specify heuristic search criterion only for the geo graphs and shortest path solves towards a single target. Supported values: The default value is solve_graph_none.
  • solve_graph_astar_radius: For path solvers only when 'solve_heuristic' option is 'astar'. The shortest path traversal front includes nodes only within this radius (kilometers) as it moves towards the target location. The default value is '70'.
The default value is an empty map.

Definition at line 438 of file solve_graph.h.

Member Data Documentation

◆ destinationNodes

std::vector<std::string> gpudb::SolveGraphRequest::destinationNodes

It can be one of the nodal identifiers - e.g: 'NODE_WKTPOINT' for destination (target) nodes.

For BACKHAUL_ROUTING, this list depicts the remote assets. The default value is an empty vector.

Definition at line 564 of file solve_graph.h.

◆ graphName

std::string gpudb::SolveGraphRequest::graphName

Name of the graph resource to solve.

Definition at line 453 of file solve_graph.h.

◆ options

std::map<std::string, std::string> gpudb::SolveGraphRequest::options

Additional parameters.

The default value is an empty map.

Definition at line 746 of file solve_graph.h.

◆ restrictions

std::vector<std::string> gpudb::SolveGraphRequest::restrictions

Additional restrictions to apply to the nodes/edges of an existing graph.

Restrictions must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS RESTRICTIONS_EDGE_ID', expressions, e.g., 'column/2 AS RESTRICTIONS_VALUECOMPARED', or constant values, e.g., '{0, 0, 0, 1} AS RESTRICTIONS_ONOFFCOMPARED'. If using constant values in an identifier combination, the number of values specified must match across the combination. If remove_previous_restrictions option is set to true, any provided restrictions will replace the existing restrictions. Otherwise, any provided restrictions will be added (in the case of 'RESTRICTIONS_VALUECOMPARED') to or replaced (in the case of 'RESTRICTIONS_ONOFFCOMPARED'). The default value is an empty vector.

Definition at line 492 of file solve_graph.h.

◆ solutionTable

std::string gpudb::SolveGraphRequest::solutionTable

Name of the table to store the solution, in [ schema_name.

\ ]table_name format, using standard name resolution rules. The default value is 'graph_solutions'.

Definition at line 573 of file solve_graph.h.

◆ solverType

std::string gpudb::SolveGraphRequest::solverType

The type of solver to use for the graph.

Supported values:

  • solve_graph_SHORTEST_PATH: Solves for the optimal (shortest) path based on weights and restrictions from one source to destinations nodes. Also known as the Dijkstra solver.
  • solve_graph_PAGE_RANK: Solves for the probability of each destination node being visited based on the links of the graph topology. Weights are not required to use this solver.
  • solve_graph_PROBABILITY_RANK: Solves for the transitional probability (Hidden Markov) for each node based on the weights (probability assigned over given edges).
  • solve_graph_CENTRALITY: Solves for 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.
  • solve_graph_MULTIPLE_ROUTING: Solves for finding the minimum cost cumulative path for a round-trip starting from the given source and visiting each given destination node once then returning to the source. Also known as the travelling salesman problem.
  • solve_graph_INVERSE_SHORTEST_PATH: Solves for finding the optimal path cost for each destination node to route to the source node. Also known as inverse Dijkstra or the service man routing problem.
  • solve_graph_BACKHAUL_ROUTING: Solves for optimal routes that connect remote asset nodes to the fixed (backbone) asset nodes.
  • solve_graph_ALLPATHS: Solves for paths that would give costs between max and min solution radia - Make sure to limit by the 'max_solution_targets' option. Min cost shoudl be >= shortest_path cost.
  • solve_graph_STATS_ALL: Solves for graph statistics such as graph diameter, longest pairs, vertex valences, topology numbers, average and max cluster sizes, etc.
  • solve_graph_CLOSENESS: Solves for the centrality closeness score per node as the sum of the inverse shortest path costs to all nodes in the graph.

The default value is solve_graph_SHORTEST_PATH.

Definition at line 548 of file solve_graph.h.

◆ sourceNodes

std::vector<std::string> gpudb::SolveGraphRequest::sourceNodes

It can be one of the nodal identifiers - e.g: 'NODE_WKTPOINT' for source nodes.

For BACKHAUL_ROUTING, this list depicts the fixed assets. The default value is an empty vector.

Definition at line 556 of file solve_graph.h.

◆ weightsOnEdges

std::vector<std::string> gpudb::SolveGraphRequest::weightsOnEdges

Additional weights to apply to the edges of an existing graph.

Weights must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS WEIGHTS_EDGE_ID', expressions, e.g., 'ST_LENGTH(wkt) AS WEIGHTS_VALUESPECIFIED', or constant values, e.g., '{4, 15, 2} AS WEIGHTS_VALUESPECIFIED'. Any provided weights will be added (in the case of 'WEIGHTS_VALUESPECIFIED') to or multiplied with (in the case of 'WEIGHTS_FACTORSPECIFIED') the existing weight(s). If using constant values in an identifier combination, the number of values specified must match across the combination. The default value is an empty vector.

Definition at line 472 of file solve_graph.h.


The documentation for this struct was generated from the following file: