13 #ifndef TSP_CONCORDE_INCLUDED
14 #define TSP_CONCORDE_INCLUDED
30 #include "UtilMacros.h"
39 cout <<
"ConcordeSubtour: ";
40 for(
int i = 0; i < static_cast<int>(inS.size()); i++){
72 const double * edgeWeight,
73 const double tol = 1.0e-6){
78 m_edgeList.reserve(2*nEdges);
79 m_edgeValue.reserve(nEdges);
80 for(i = 0; i < nEdges; i++){
81 if(edgeWeight[i] <= tol)
84 m_edgeValue.push_back(edgeWeight[i]);
85 m_edgeList.push_back(uv.first);
86 m_edgeList.push_back(uv.second);
97 int n_edgeList =
static_cast<int>(m_edgeValue.size());
109 for(c = 0; c < n_subtour; c++){
113 subtourCut.
S.push_back(i);
114 subtourCut.
inS[i] =
true;
117 subtourCuts.push_back(subtourCut);
118 tsp_cut = tsp_cut->
next;
121 for (tsp_cut = tsp_cuts; tsp_cut; tsp_cut = tsp_cut_next){
122 tsp_cut_next = tsp_cut->
next;
127 return static_cast<int>(subtourCuts.size());
void buildSubGraph(const int nVerts, const int nEdges, const double *edgeWeight, const double tol=1.0e-6)
pair< int, int > UtilBothEndsU(const int index)
#define CC_FOREACH_NODE_IN_CLIQUE(i, c, tmp)
ConcordeSubtourCut(const int nVerts)
vector< double > m_edgeValue
int generateCutsSubtour(vector< ConcordeSubtourCut > &subtourCuts)
void CCtsp_free_lpcut_in(CCtsp_lpcut_in *c)
struct CCtsp_lpcut_in * next
int CCtsp_exact_subtours(CCtsp_lpcut_in **cuts, int *cutcount, int ncount, int ecount, int *elist, double *x)