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");
141 number = (
long *) malloc ((n+1L) *
sizeof (
long));
145 if (
number == (
long *) 0 )
147 printf (
"Unable to allocate memory\n");
182 for ( nptr = &(gr->
nodes[n-1L]); nptr >= gr->
nodes; nptr-- )
196 for (
i = 0L;
i <= n;
i++ )
205 level = rear->
dist + 1L;
207 while ( eptr !=
NULL )
216 nptr->
dist = (int) level;
243 for ( nptr = &(gr->
nodes[n-1L]); nptr >= gr->
nodes; nptr-- )
247 nptr->
dist = (int) n;
286 for ( nptr = &(gr->
nodes[n-1L]); nptr >= gr->
nodes; nptr-- )
294 fprintf(stderr,
"isolated node in input graph\n");
306 for ( eptr = &(gr->
edges[m-1L]); eptr >= gr->
edges; eptr-- )
309 for ( eptr = &(gr->
edges[m0+m-1L]); eptr >= &(gr->
edges[m0]); eptr-- )
312 for (
i = n;
i >= 0L;
i-- )
325 level = q_rear->
dist + 1L;
328 while ( eptr !=
NULL )
335 nptr->
dist = (int) level;
343 if ( q_rear == q_front )
353 for ( nptr = &(gr->
nodes[n-1]); nptr >= gr->
nodes; --nptr )
360 s_ptr->
dist = (int) n;
368 while ( eptr !=
NULL )
379 if ( nptr != t_ptr && nptr->
excess <= cap +
EPS )
400 while ( aptr !=
NULL )
418 if ( incre <= eptr->rcap )
479 for ( nptr = &(gr->
nodes[n-1L]); nptr >= gr->
nodes; nptr-- )
486 nptr->
dist = (int) n;
493 aptr->
dist = (int) n;
504 while ( eptr !=
NULL )
517 if ( ++dmin <
bound )
521 aptr->
dist = (int) dmin;
534 aptr->
dist = (int) n;
546 if ( n_discharge == n )
557 return (
int) (t_ptr->
excess - 1.0L);
568 while(
i != j && j != 0 )
599 for(
int j = 1 ; j < gr->
nnodes; j++ )
653 nptrn = &(gr->
nodes[n-1L]);
654 for ( nptr = nptrn; nptr >= nptr1; nptr-- )
657 for ( sptr = &(gr->
nodes[1L]); sptr <= nptrn; sptr++ )
660 maxfl =
maxflow(gr, sptr, tptr);
672 for ( nptr = &(gr->
nodes[1L]); nptr <= nptrn; nptr++ )
674 if ( nptr != sptr && ! nptr->
alive && nptr->
parent == tptr )
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.
struct GraphEdge * first_edge
struct GraphNode * bfs_link
struct GraphEdge * scan_ptr
struct GraphNode * parent
struct GraphNode * stack_link