65 if( (*gr)->nodes ==
NULL )
72 if( (*gr)->edges ==
NULL )
81 (*gr)->nedgesnonzero = m/2;
121 if( (*gr)->nuses == 0 )
137 printf (
"Unable to allocate memory\n");
145 if (
number == (
long *) 0 )
147 printf (
"Unable to allocate memory\n");
188 nptr->scan_ptr =
nptr->scan_ptr->next;
196 for (
i = 0
L;
i <= n;
i++ )
205 level =
rear->dist + 1L;
216 nptr->dist = (int) level;
245 if (
nptr->unmarked &&
nptr->alive )
247 nptr->dist = (int) n;
290 nptr->scan_ptr =
nptr->scan_ptr->next;
304 m =
gr->nedgesnonzero;
312 for (
i = n;
i >= 0
L;
i-- )
325 level =
q_rear->dist + 1L;
331 if (
eptr->adjac->unmarked &&
eptr->back->rcap >
EPS )
335 nptr->dist = (int) level;
355 if (
nptr->unmarked )
360 s_ptr->dist = (int) n;
375 s_ptr->excess -= cap;
376 eptr->back->rcap += cap;
486 nptr->dist = (int) n;
493 aptr->dist = (int) n;
534 aptr->dist = (int) n;
557 return (
int) (
t_ptr->excess - 1.0L);
568 while(
i !=
j &&
j != 0 )
570 j =
gr->nodes[
j].parent->id;
594 for(
int i = 1;
i <
gr->nnodes;
i++ )
596 if(
gr->nodes[
i].mincap < 2.0 - minviol )
599 for(
int j = 1 ;
j <
gr->nnodes;
j++ )
615 for(
int i = 1;
i <
gr->nnodes;
i++ )
616 cuts[0][
i]=
gr->nodes[
i].unmarked;
678 if ( !
tptr->parent->alive )
static void constructSingleCut(GRAPH *gr, SCIP_Bool **cuts)
static void global_relabel(GRAPH *gr, GRAPHNODE *tptr)
void capture_graph(GRAPH *gr)
static SCIP_Bool nodeOnRootPath(GRAPH *gr, int i, int j)
SCIP_Bool create_graph(int n, int m, GRAPH **gr)
static GRAPHNODE ** active
static double maxflow(GRAPH *gr, GRAPHNODE *s_ptr, GRAPHNODE *t_ptr)
static void fini_maxflow(void)
static void constructCutList(GRAPH *gr, SCIP_Bool **cuts, int *ncuts, double minviol)
static SCIP_Bool co_check
SCIP_Bool ghc_tree(GRAPH *gr, SCIP_Bool **cuts, int *ncuts, double minviol)
void release_graph(GRAPH **gr)
static SCIP_Bool init_maxflow(long n)
static void free_graph(GRAPH **gr)
generator for global cuts in undirected graphs
assert(minobj< SCIPgetCutoffbound(scip))
#define BMSfreeMemory(ptr)
#define BMSallocMemoryArray(ptr, num)
#define BMSfreeMemoryArray(ptr)
#define BMSallocMemory(ptr)
C++ wrapper classes for SCIP.