44 static void dijkstra(
const QgsGraph *source,
int startVertexIdx,
int criterionNum, QVector<int> *resultTree =
nullptr, QVector<double> *resultCost =
nullptr );
58 QVector<int> treeResult;
59 QVector<double> costResult;
62 PyObject *l1 = PyList_New( treeResult.size() );
67 PyObject *l2 = PyList_New( costResult.size() );
73 for ( i = 0; i < costResult.size(); ++i )
75 PyObject *Int = PyLong_FromLong( treeResult[i] );
76 PyList_SET_ITEM( l1, i, Int );
77 PyObject *Float = PyFloat_FromDouble( costResult[i] );
78 PyList_SET_ITEM( l2, i, Float );
81 sipRes = PyTuple_New( 2 );
82 PyTuple_SET_ITEM( sipRes, 0, l1 );
83 PyTuple_SET_ITEM( sipRes, 1, l2 );
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.