Dijkstra, but it doesn't work
This commit is contained in:
parent
96ad8eb6a8
commit
95ee5f84d1
|
|
@ -1,4 +1,5 @@
|
|||
#include "extendedgraph.h"
|
||||
#include <map>
|
||||
|
||||
ExtendedGraph::ExtendedGraph() { // Default Constructor
|
||||
this->vertices =
|
||||
|
|
@ -220,4 +221,24 @@ int ExtendedGraph::resolveVertex(const std::string &vertexName) {
|
|||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ExtendedGraph::performDijkstraPath(std::string sourceVertex,
|
||||
std::string targetVertex) {
|
||||
|
||||
int distances[this->vertices.size()] = {INT_MAX};
|
||||
bool visited[this->vertices.size()] = {false};
|
||||
distances[this->resolveVertex(sourceVer)] = 0;
|
||||
|
||||
visited[this->resolveVertex(sourceVer)] = true;
|
||||
|
||||
for (int i = 0; i < this->vertices.size(); i++) {
|
||||
}
|
||||
|
||||
std::vector<std::pair<bool, int>> data;
|
||||
std::string currentVertex = sourceVertex;
|
||||
// std::map<std::string, int> sptSet;
|
||||
|
||||
for (const std::string &neighbour : this->neighbours(currentVertex)) {
|
||||
}
|
||||
}
|
||||
|
|
@ -63,4 +63,5 @@ public:
|
|||
// neighbouring vertices of the parameter vertex...
|
||||
// ...Neighbours are all vertices that a given
|
||||
// vertex is connected to through OUTGOING edges
|
||||
void performDijkstraPath(std::string sourceVertex, std::string targetVertex);
|
||||
};
|
||||
Loading…
Reference in New Issue