37 assert( graph !=
NULL );
38 assert( sourcegraph !=
NULL );
41 int n = sourcegraph->
nnodes;
42 int m = sourcegraph->
nedges;
49 for(
int i = 0; i < n; ++i)
54 assert(sourcenode->
id == i);
56 node->
x = sourcenode->
x;
57 node->
y = sourcenode->
y;
58 node->
id = sourcenode->
id;
64 for(
int i = 0; i < n - 1; ++i)
66 GRAPHNODE * nodestart = &((*graph)->nodes[i]);
67 for(
int j = i + 1; j < n; ++j)
69 GRAPHNODE * nodeend = &((*graph)->nodes[j]);
71 GRAPHEDGE * edgeforw = &((*graph)->edges[e]);
72 GRAPHEDGE * edgebackw = &((*graph)->edges[e + m]);
75 edgeforw->
adjac = nodeend;
76 edgebackw->
adjac = nodestart;
77 edgeforw->
back = edgebackw;
78 edgebackw->
back = edgeforw;
131 assert( sourceprobdatatsp !=
NULL );
132 GRAPH * sourcegraph = sourceprobdatatsp->graph_;
133 assert( sourcegraph !=
NULL );
141 for(
int e = 0; e < m; ++e)
154 edgebackw->
var = edgeforw->
var;
160 assert( probdatatsp !=
NULL );
163 assert( objprobdata !=
NULL );
164 *objprobdata = probdatatsp;
185 for(
int i = 0; i < graph_->nedges; i++ )
207 for(
int i = 0; i < graph_->nedges; i++ )
236 assert( objprobdata !=
NULL );
237 assert( deleteobject !=
NULL );
239 assert( graph_ !=
NULL );
246 int m = transgraph->
nedges;
247 for(
int e = 0; e < m; ++e)
252 assert( graph_->edges[e].var !=
NULL );
255 edgebackw->
var = edgeforw->
var;
256 assert( edgebackw->
var !=
NULL );
262 assert( transprobdatatsp !=
NULL );
265 assert( objprobdata !=
NULL );
266 *objprobdata = transprobdatatsp;
271 *deleteobject =
TRUE;
enum SCIP_Result SCIP_RESULT
SCIP_Bool create_graph(int n, int m, GRAPH **gr)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
virtual SCIP_RETCODE scip_copy(SCIP *scip, SCIP *sourcescip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, ObjProbData **objprobdata, SCIP_Bool global, SCIP_RESULT *result)
enum SCIP_Retcode SCIP_RETCODE
generator for global cuts in undirected graphs
virtual SCIP_RETCODE scip_delorig(SCIP *scip)
C++ wrapper for user problem data.
struct GraphEdge * first_edge
C++ wrapper classes for SCIP.
C++ problem data for TSP.
virtual SCIP_RETCODE scip_trans(SCIP *scip, ObjProbData **objprobdata, SCIP_Bool *deleteobject)
scip::ObjProbData * SCIPgetObjProbData(SCIP *scip)
SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
static SCIP_RETCODE copy_graph(GRAPH **graph, GRAPH *sourcegraph)
virtual SCIP_RETCODE scip_deltrans(SCIP *scip)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
void release_graph(GRAPH **gr)