Scippy

SCIP

Solving Constraint Integer Programs

branch_coloring.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file branch_coloring.h
26  * @brief default branching rule for the vertex coloring problem
27  * @author Gerald Gamrath
28  *
29  * This file implements the standard branching rule for the coloring algorithm.
30  *
31  * As we use column generation, we may not branch on the variables themselves,
32  * but on some sort of constraints that we introduce in the pricing problem.
33  *
34  * In our case, we choose two nodes v and w, which are not adjacent in the current graph, and
35  * consider the following two constraints: SAME(v,w) and DIFFER(v,w). SAME(v,w) requires that both
36  * nodes v and w get the same color, whereas DIFFER(v,w) forbids this. For each pair of nodes, each
37  * feasible solution fulfills exactly one of these constraints. Hence, splitting the solution space
38  * into two parts, one fulfilling SAME(v,w) and the other DIFFER(v,w), does not cut off any feasible
39  * solution and can therefore be used as the branching rule.
40  *
41  * The branching is done as follows: Given the optimal (fractional) solution of the current
42  * branch-and-bound node, choose the most fractional variable and the corresponding stable set
43  * s1. Now choose two nodes v, w and another stable set s2, such that v is part of both stable sets,
44  * whereas w is part of exactly one of the stable sets. Create two children of the current node,
45  * one with the restriction SAME(v,w), the other one with restriction DIFFER(v,w). Therefore, each
46  * node gets a constraint of type @c cons_storeGraph, which enforces the branching decision and
47  * assures that each coloring of the nodes in the respective subgraph assigns to both nodes the same
48  * color/different colors by fixing stable sets to 0 that violate this constraint.
49  */
50 
51 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
52 
53 #ifndef __SCIP_BRANCH_COLORING_H__
54 #define __SCIP_BRANCH_COLORING_H__
55 
56 
57 #include "scip/scip.h"
58 #include "probdata_coloring.h"
59 #include "cons_storeGraph.h"
60 #include "scip/cons_setppc.h"
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 /** creates the coloring branching rule and includes it in SCIP */
68  SCIP* scip /**< SCIP data structure */
69  );
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif
problem data for vertex coloring algorithm
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_RETCODE SCIPincludeBranchruleColoring(SCIP *scip)
constraint handler for storing the graph at each node of the tree
Constraint handler for the set partitioning / packing / covering constraints .
SCIP callable library.