Commit 5da9e3e0 authored by Colby Green's avatar Colby Green
Browse files

no references

parent 5a437225
......@@ -59,9 +59,9 @@ public:
for (size_t i = 0; i < length; i++){
Vertex &vertex = v[i];
if (!vertex.visited){
double &distance = distanceMatrix[minVertex.index][vertex.index];
double distance = distanceMatrix[minVertex.index][vertex.index];
if (distance == 0){
distanceMatrix[vertex.index][minVertex.index] = distance = pokeDistance(minVertex.index, vertex.index);
distanceMatrix[vertex.index][minVertex.index] = distanceMatrix[minVertex.index][vertex.index] = distance = pokeDistance(minVertex.index, vertex.index);
}
if (distance < vertex.minDistanceTo){
......@@ -85,8 +85,8 @@ public:
double minDistanceFromFirst = numeric_limits<double>::infinity();
for (size_t i = 0; i < length; i++){
Vertex &vertex = v[i];
double &distancePrev = distanceMatrix[vertex.index][path[permLength - 1]];
double &distanceFirst = distanceMatrix[vertex.index][path[0]];
double distancePrev = distanceMatrix[vertex.index][path[permLength - 1]];
double distanceFirst = distanceMatrix[vertex.index][path[0]];
if (distancePrev == 0){
distanceMatrix[vertex.index][path[permLength - 1]] = distanceMatrix[path[permLength - 1]][vertex.index] = distancePrev = pokeDistance(vertex.index, path[permLength - 1]);
}
......@@ -127,9 +127,9 @@ public:
for (size_t i = permLength; i < path.size(); ++i) {
swap(path[permLength], path[i]);
// add to current path length
double &temp = distanceMatrix[path[permLength - 1]][path[permLength]];
double temp = distanceMatrix[path[permLength - 1]][path[permLength]];
if (temp == 0){
distanceMatrix[path[permLength]][path[permLength - 1]] = temp = pokeDistance(path[permLength - 1], path[permLength]);
distanceMatrix[path[permLength]][path[permLength - 1]] = distanceMatrix[path[permLength - 1]][path[permLength]] = temp = pokeDistance(path[permLength - 1], path[permLength]);
}
curPathDistance += temp;
genPerms(permLength + 1);
......
......@@ -6,7 +6,7 @@
#include <iomanip>
#include "MST.h"
#include "FASTTSP.h"
#include "OPTTSP.cpp"
#include "OPTTSP.h"
#include "xcode_redirect.hpp"
using namespace std;
......
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