QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsGraphAnalyzer Class Reference

Performs graph analysis, e.g. More...

#include <qgsgraphanalyzer.h>

Static Public Member Functions

static void dijkstra (const QgsGraph *source, int startVertexIdx, int criterionNum, QVector< int > *resultTree=nullptr, QVector< double > *resultCost=nullptr)
 Solve shortest path problem using Dijkstra algorithm.
static QgsGraphshortestTree (const QgsGraph *source, int startVertexIdx, int criterionNum)
 Returns shortest path tree with root-node in startVertexIdx.

Detailed Description

Performs graph analysis, e.g.

calculates shortest path between two points using different strategies with Dijkstra's algorithm.

Definition at line 31 of file qgsgraphanalyzer.h.

Member Function Documentation

◆ dijkstra()

void QgsGraphAnalyzer::dijkstra ( const QgsGraph * source,
int startVertexIdx,
int criterionNum,
QVector< int > * resultTree = nullptr,
QVector< double > * resultCost = nullptr )
static

Solve shortest path problem using Dijkstra algorithm.

Parameters
sourcesource graph
startVertexIdxindex of the start vertex
criterionNumindex of the optimization strategy
resultTreearray that represents shortest path tree. resultTree[ vertexIndex ] == inboundingArcIndex if vertex reachable, otherwise resultTree[ vertexIndex ] == -1. Note that the startVertexIdx will also have a value of -1 and may need special handling by callers.
resultCostarray of the path's costs

Definition at line 26 of file qgsgraphanalyzer.cpp.

◆ shortestTree()

QgsGraph * QgsGraphAnalyzer::shortestTree ( const QgsGraph * source,
int startVertexIdx,
int criterionNum )
static

Returns shortest path tree with root-node in startVertexIdx.

Parameters
sourcesource graph
startVertexIdxindex of the start vertex
criterionNumindex of the optimization strategy

Definition at line 92 of file qgsgraphanalyzer.cpp.


The documentation for this class was generated from the following files: