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-2025 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 * @author Julian Meffert
    29 *
    30 * This file implements the standard branching rule for the coloring algorithm.
    31 *
    32 * As we use column generation, we may not branch on the variables themselves,
    33 * but on some sort of constraints that we introduce in the pricing problem.
    34 *
    35 * In our case, we choose two nodes v and w, which are not adjacent in the current graph, and
    36 * consider the following two constraints: SAME(v,w) and DIFFER(v,w). SAME(v,w) requires that both
    37 * nodes v and w get the same color, whereas DIFFER(v,w) forbids this. For each pair of nodes, each
    38 * feasible solution fulfills exactly one of these constraints. Hence, splitting the solution space
    39 * into two parts, one fulfilling SAME(v,w) and the other DIFFER(v,w), does not cut off any feasible
    40 * solution and can therefore be used as the branching rule.
    41 *
    42 * The branching is done as follows: Given the optimal (fractional) solution of the current
    43 * branch-and-bound node, choose the least/most fractional variable and the corresponding stable set
    44 * s1. Now choose two nodes v, w and another stable set s2, such that v is part of both stable sets,
    45 * whereas w is part of exactly one of the stable sets. Create two children of the current node,
    46 * one with the restriction SAME(v,w), the other one with restriction DIFFER(v,w). Therefore, each
    47 * node gets a constraint of type @c cons_storeGraph, which enforces the branching decision and
    48 * assures that each coloring of the nodes in the respective subgraph assigns to both nodes the same
    49 * color/different colors by fixing stable sets to 0 that violate this constraint.
    50 */
    51
    52/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    53
    54#ifndef __SCIP_BRANCH_COLORING_H__
    55#define __SCIP_BRANCH_COLORING_H__
    56
    57
    58#include "scip/scip.h"
    59#include "probdata_coloring.h"
    60#include "cons_storeGraph.h"
    61#include "scip/cons_setppc.h"
    62
    63#ifdef __cplusplus
    64extern "C" {
    65#endif
    66
    67/** creates the coloring branching rule and includes it in SCIP */
    69 SCIP* scip /**< SCIP data structure */
    70 );
    71
    72#ifdef __cplusplus
    73}
    74#endif
    75
    76#endif
    SCIP_RETCODE SCIPincludeBranchruleColoring(SCIP *scip)
    Constraint handler for the set partitioning / packing / covering constraints .
    constraint handler for storing the graph at each node of the tree
    problem data for vertex coloring algorithm
    SCIP callable library.
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63