tclique_branch.c
Go to the documentation of this file.
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 142 /* clique2 has an element not contained in clique1: clique2 is lex-smaller, but probably clique1 is 231 /** ensures, that the clique hash table is able to store at least the given number of cliques */ 278 /** searches the given clique in the clique hash table and returns whether it (or a stronger clique) exists */ 314 /* we found the correct insertion position for the clique, but it might be contained in a lex-smaller clique */ 387 debugMessage("extending temporary clique (size %d) with zero-weighted nodes (nVzero=%d)\n", *ncurcliquenodes, nVzero); 403 /* put zero-weighted candidates into the clique, and remove non-adjacent nodes from the candidate set */ 417 nzerocands = selectadjnodes(tcliquegraph, curcliquenodes[(*ncurcliquenodes)-1], zerocands, nzerocands, zerocands); 421 /** calls user callback after a new solution was found, that is better than the current incumbent 423 * The callback decides, whether this solution should be accepted as new incumbent, and whether the solution process 483 newsol(tcliquedata, curcliquenodes, ncurcliquenodes, curcliqueweight, maxcliqueweight, &acceptsol, stopsolving); 485 /* if clique was accepted, clear the clique hash table; otherwise, insert it into the clique hash table, such that 521 debugMessage(" -> clique %s (weight %d):", acceptsol ? "accepted" : "rejected", curcliqueweight); 625 reduced(getweights, isedge, tcliquegraph, V, nV, apbound, tmpcliquenodes, ntmpcliquenodes, tmpcliqueweight); 637 /** gets the index of the node of V with the maximum apriori bound; returns -1, if no node exists */ 666 /** gets the index of the node of V with the maximum apriori bound, but ignores nodes with weights 704 /** branches the searching tree, branching nodes are selected in decreasing order of their apriori bound, 735 TCLIQUE_WEIGHT maxfirstnodeweight, /**< maximum weight of branching nodes in level 0; 0 if not used 739 int backtrackfreq, /**< frequency to backtrack to first level of tree (0: no premature backtracking) */ 741 int fixednode, /**< node that is forced to be in the clique, or -1; must have positive weight */ 776 debugMessage("(level %d, treenode %d) maxclique = %d, curclique = %d [mem=%"SCIP_LONGINT_FORMAT" (%"SCIP_LONGINT_FORMAT"), cliques=%d]\n", 803 /* use coloring relaxation to generate an upper bound for the current subtree and a heuristic solution */ 820 * if the user wanted to have a fixed variable inside the clique and we are in level 0, we first have to 842 /* discard subtree, if the upper bound is not better than the weight of the currently best clique; 843 * if only 2 nodes are left, the maximal weighted clique was already calculated in boundSubgraph() and nothing 845 * however, if the user wanted to have a fixed node and we are in the first decision level, we have to continue 865 debugMessage("============================ branching level %d ===============================\n", level); 872 /* check if we meet the backtracking frequency - in this case abort the search until we have reached first level */ 902 debugMessage("%d. branching in level %d (treenode %d): bidx=%d, node %d, weight %d, upperbound: %d+%d = %d, maxclique=%d\n", 932 backtracklevel = branch(getnnodes, getweights, isedge, selectadjnodes, tcliquegraph, newsol, tcliquedata, 944 debugMessage("branching on node %d was optimal - ignoring remaining candidates\n", branchingnode); 953 debugMessage("========================== branching level %d end =============================\n\n", level); 959 /* check, whether any branchings have been applied, or if this node is a leaf of the branching tree */ 969 debugMessage("found clique of weight %d at node %d in level %d\n", *curcliqueweight, *ntreenodes, level); 970 newSolution(selectadjnodes, tcliquegraph, newsol, tcliquedata, cliquehash, buffer, Vzero, nVzero, 1005 TCLIQUE_GRAPH* tcliquegraph, /**< pointer to graph data structure that is passed to graph callbacks */ 1011 TCLIQUE_WEIGHT maxfirstnodeweight, /**< maximum weight of branching nodes in level 0; 0 if not used 1015 int backtrackfreq, /**< frequency to backtrack to first level of tree (0: no premature backtracking) */ 1017 int fixednode, /**< node that is forced to be in the clique, or -1; must have positive weight */ 1111 backtracklevel = branch(getnnodes, getweights, isedge, selectadjnodes, tcliquegraph, newsol, tcliquedata, mem, 1115 maxfirstnodeweight, &nbbtreenodes, maxntreenodes, backtrackfreq, maxnzeroextensions, fixednode, status);
static void newSolution(TCLIQUE_SELECTADJNODES((*selectadjnodes)), TCLIQUE_GRAPH *tcliquegraph, TCLIQUE_NEWSOL((*newsol)), TCLIQUE_DATA *tcliquedata, CLIQUEHASH *cliquehash, int *buffer, int *Vzero, int nVzero, int maxnzeroextensions, int *curcliquenodes, int ncurcliquenodes, TCLIQUE_WEIGHT curcliqueweight, int *maxcliquenodes, int *nmaxcliquenodes, TCLIQUE_WEIGHT *maxcliqueweight, TCLIQUE_Bool *stopsolving) Definition: tclique_branch.c:427 tclique defines static void extendCliqueZeroWeight(TCLIQUE_SELECTADJNODES((*selectadjnodes)), TCLIQUE_GRAPH *tcliquegraph, int *buffer, int *Vzero, int nVzero, int maxnzeroextensions, int *curcliquenodes, int *ncurcliquenodes) Definition: tclique_branch.c:365 static int getMaxApBoundIndexNotMaxWeight(int *V, int nV, const TCLIQUE_WEIGHT *apbound, const TCLIQUE_WEIGHT *weights, TCLIQUE_WEIGHT maxweight) Definition: tclique_branch.c:672 TCLIQUE_WEIGHT tcliqueColoring(TCLIQUE_GETNNODES((*getnnodes)), TCLIQUE_GETWEIGHTS((*getweights)), TCLIQUE_SELECTADJNODES((*selectadjnodes)), TCLIQUE_GRAPH *tcliquegraph, BMS_CHKMEM *mem, int *buffer, int *V, int nV, NBC *gsd, TCLIQUE_Bool *iscolored, TCLIQUE_WEIGHT *apbound, int *clique, int *nclique, TCLIQUE_WEIGHT *weightclique) Definition: tclique_coloring.c:219 static TCLIQUE_WEIGHT boundSubgraph(TCLIQUE_GETNNODES((*getnnodes)), TCLIQUE_GETWEIGHTS((*getweights)), TCLIQUE_ISEDGE((*isedge)), TCLIQUE_SELECTADJNODES((*selectadjnodes)), TCLIQUE_GRAPH *tcliquegraph, BMS_CHKMEM *mem, int *buffer, int *V, int nV, NBC *gsd, TCLIQUE_Bool *iscolored, TCLIQUE_WEIGHT *apbound, int *tmpcliquenodes, int *ntmpcliquenodes, TCLIQUE_WEIGHT *tmpcliqueweight) Definition: tclique_branch.c:601 static void ensureCliquehashSize(CLIQUEHASH *cliquehash, int num) Definition: tclique_branch.c:233 static void insertClique(CLIQUEHASH *cliquehash, CLIQUE *clique, int insertpos) Definition: tclique_branch.c:329 Definition: tclique.h:55 tclique user interface coloring part of algorithm for maximum cliques Definition: cons_sos1.c:205 void tcliqueMaxClique(TCLIQUE_GETNNODES((*getnnodes)), TCLIQUE_GETWEIGHTS((*getweights)), TCLIQUE_ISEDGE((*isedge)), TCLIQUE_SELECTADJNODES((*selectadjnodes)), TCLIQUE_GRAPH *tcliquegraph, TCLIQUE_NEWSOL((*newsol)), TCLIQUE_DATA *tcliquedata, int *maxcliquenodes, int *nmaxcliquenodes, TCLIQUE_WEIGHT *maxcliqueweight, TCLIQUE_WEIGHT maxfirstnodeweight, TCLIQUE_WEIGHT minweight, int maxntreenodes, int backtrackfreq, int maxnzeroextensions, int fixednode, int *ntreenodes, TCLIQUE_STATUS *status) Definition: tclique_branch.c:1000 static TCLIQUE_Bool inCliquehash(CLIQUEHASH *cliquehash, CLIQUE *clique, int *insertpos) Definition: tclique_branch.c:280 Definition: tclique.h:53 static void createCliquehash(CLIQUEHASH **cliquehash, int tablesize) Definition: tclique_branch.c:183 static void reduced(TCLIQUE_GETWEIGHTS((*getweights)), TCLIQUE_ISEDGE((*isedge)), TCLIQUE_GRAPH *tcliquegraph, int *V, int nV, TCLIQUE_WEIGHT *apbound, int *tmpcliquenodes, int *ntmpcliquenodes, TCLIQUE_WEIGHT *tmpcliqueweight) Definition: tclique_branch.c:533 static int compSubcliques(CLIQUE *clique1, CLIQUE *clique2) Definition: tclique_branch.c:116 struct _NBC NBC static int getMaxApBoundIndex(int nV, TCLIQUE_WEIGHT *apbound) Definition: tclique_branch.c:639 static int branch(TCLIQUE_GETNNODES((*getnnodes)), TCLIQUE_GETWEIGHTS((*getweights)), TCLIQUE_ISEDGE((*isedge)), TCLIQUE_SELECTADJNODES((*selectadjnodes)), TCLIQUE_GRAPH *tcliquegraph, TCLIQUE_NEWSOL((*newsol)), TCLIQUE_DATA *tcliquedata, BMS_CHKMEM *mem, CLIQUEHASH *cliquehash, int *buffer, int level, int *V, int nV, int *Vzero, int nVzero, NBC *gsd, TCLIQUE_Bool *iscolored, int *K, TCLIQUE_WEIGHT weightK, int *maxcliquenodes, int *nmaxcliquenodes, TCLIQUE_WEIGHT *maxcliqueweight, int *curcliquenodes, int *ncurcliquenodes, TCLIQUE_WEIGHT *curcliqueweight, int *tmpcliquenodes, TCLIQUE_WEIGHT maxfirstnodeweight, int *ntreenodes, int maxntreenodes, int backtrackfreq, int maxnzeroextensions, int fixednode, TCLIQUE_STATUS *status) Definition: tclique_branch.c:708 Definition: tclique.h:54 static void createClique(CLIQUE **clique, int *nodes, int nnodes) Definition: tclique_branch.c:70 struct _LIST_ITV LIST_ITV memory allocation routines |