Commit ca28ee70 authored by Colby Green's avatar Colby Green
Browse files

updates

parent 07f8e61c
......@@ -53,15 +53,16 @@ public:
}
}
v[minIndex].visited = true;
Vertex &minVertex = v[minIndex];
minVertex.visited = true;
numVisited++;
for (size_t i = 0; i < length; i++){
Vertex &vertex = v[i];
if (!vertex.visited){
double distance = distanceMatrix[v[minIndex].index][vertex.index];
double distance = distanceMatrix[minVertex.index][vertex.index];
if (distance == 0){
distance = pokeDistance(v[minIndex].index, vertex.index);
distanceMatrix[v[minIndex].index][vertex.index] = distance;
distance = pokeDistance(minVertex.index, vertex.index);
distanceMatrix[minVertex.index][vertex.index] = distance;
}
if (distance < vertex.minDistanceTo){
vertex.minDistanceTo = distance;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment