Minor if-else simplification
This commit is contained in:
@@ -565,14 +565,7 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps,
|
|||||||
// ...jezeli niespelnione - pomijamy ruch
|
// ...jezeli niespelnione - pomijamy ruch
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(nextRouteLength == -1)
|
if(nextRouteLength == -1 || nextRouteLength > neighbourRouteLength)
|
||||||
{
|
|
||||||
nextRouteLength = neighbourRouteLength;
|
|
||||||
nextRoute = neighbourRoute;
|
|
||||||
nextTabu.at(1) = i;
|
|
||||||
nextTabu.at(2) = j;
|
|
||||||
}
|
|
||||||
else if(nextRouteLength > neighbourRouteLength)
|
|
||||||
{
|
{
|
||||||
nextRouteLength = neighbourRouteLength;
|
nextRouteLength = neighbourRouteLength;
|
||||||
nextRoute = neighbourRoute;
|
nextRoute = neighbourRoute;
|
||||||
|
|||||||
Reference in New Issue
Block a user