15 #ifndef TSP_CONCORDE_INCLUDED
16 #define TSP_CONCORDE_INCLUDED
32 #include "UtilMacros.h"
41 cout <<
"ConcordeSubtour: ";
42 for(
int i = 0; i < static_cast<int>(inS.size()); i++){
74 const double * edgeWeight,
75 const double tol = 1.0e-6){
80 m_edgeList.reserve(2*nEdges);
81 m_edgeValue.reserve(nEdges);
82 for(i = 0; i < nEdges; i++){
83 if(edgeWeight[i] <= tol)
86 m_edgeValue.push_back(edgeWeight[i]);
87 m_edgeList.push_back(uv.first);
88 m_edgeList.push_back(uv.second);
99 int n_edgeList =
static_cast<int>(m_edgeValue.size());
111 for(c = 0; c < n_subtour; c++){
115 subtourCut.
S.push_back(i);
116 subtourCut.
inS[i] =
true;
119 subtourCuts.push_back(subtourCut);
120 tsp_cut = tsp_cut->
next;
123 for (tsp_cut = tsp_cuts; tsp_cut; tsp_cut = tsp_cut_next){
124 tsp_cut_next = tsp_cut->
next;
129 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)