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

update

parent ca28ee70
......@@ -20,7 +20,7 @@ public:
};
bool promising(size_t permLength){
if ((path.size() - permLength) <= 6){
if ((path.size() - permLength) <= 5){
return true;
}
......@@ -61,8 +61,8 @@ public:
if (!vertex.visited){
double distance = distanceMatrix[minVertex.index][vertex.index];
if (distance == 0){
distance = pokeDistance(minVertex.index, vertex.index);
distanceMatrix[minVertex.index][vertex.index] = distance;
distanceMatrix[minVertex.index][vertex.index] = distanceMatrix[vertex.index][minVertex.index] = distance = pokeDistance(minVertex.index, vertex.index);
}
if (distance < vertex.minDistanceTo){
vertex.minDistanceTo = distance;
......@@ -129,8 +129,7 @@ public:
// add to current path length
double temp = distanceMatrix[path[permLength - 1]][path[permLength]];
if (temp == 0){
temp = pokeDistance(path[permLength - 1], path[permLength]);
distanceMatrix[path[permLength - 1]][path[permLength]] = temp;
distanceMatrix[path[permLength - 1]][path[permLength]] = distanceMatrix[path[permLength]][path[permLength - 1]] = temp = pokeDistance(path[permLength - 1], path[permLength]);
}
curPathDistance += temp;
genPerms(permLength + 1);
......
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