twoOpt.h
Go to the documentation of this file.
1 //==================================================================
2 // File : twoOpt.h
3 // Author : rsagalyn
4 // Date : Aug 25, 2013
5 // Description : Perform optimizations on graph
6 //==================================================================
7 #ifndef MYGRAPH_H
8 #define MYGRAPH_H
9 
10 #include <vector>
11 #include <stack>
12 #include <iostream>
13 //#include <cstdlib>
14 //#include <cmath>
15 
16 using namespace std;
17 
18 // Non-looping version of two-opt optimization heuristic
19 double twoOpt(double **graph, vector<int> &path, double &pathLength, int n);
20 
21 // 2-Opt helper function: swap two nodes
22 int is_path_shorter(double **graph, int v1, int v2, int v3, int v4, double &total_distance);
23 
24 void reverse(vector<int> &path, int start, int end, int n);
25 
26 
27 
28 
29 // move this to tsp class
30 double get_path_length(double **graph, vector<int> &path, int size);
31 
32 
33 #endif
void reverse(vector< int > &path, int start, int end, int n)
Definition: twoOpt.cpp:12
double get_path_length(double **graph, vector< int > &path, int size)
Definition: twoOpt.cpp:88
int is_path_shorter(double **graph, int v1, int v2, int v3, int v4, double &total_distance)
Definition: twoOpt.cpp:27
double twoOpt(double **graph, vector< int > &path, double &pathLength, int n)
Definition: twoOpt.cpp:40


co_scan
Author(s):
autogenerated on Mon Feb 28 2022 23:00:56