Scippy

    SCIP

    Solving Constraint Integer Programs

    heur_locks.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 heur_locks.h
    26 * @ingroup PRIMALHEURISTICS
    27 * @brief locks primal heuristic
    28 * @author Michael Winkler
    29 * @author Gerald Gamrath
    30 *
    31 * The locks heuristic is a start heuristic that first tries to fix all binary variables, then solves the resulting LP
    32 * and tries to round the solution and finally solves a sub-MIP on the remaining problem if the LP solution could not be
    33 * rounded. The fixing works as follows: First, all variables are sorted by their total number of rounding locks (up-
    34 * and down-locks summed up). Then, looking at the variable with the highest number of locks first, the variable is
    35 * fixed to the bound where there are fewer locks (in case of ties, the bound which is better w.r.t. the objective
    36 * function). This fix is propagated and the activities of all LP rows are updated. If any LP row becomes redundant
    37 * w.r.t. the updated bounds, we adjust the rounding locks.
    38 */
    39
    40/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    41
    42#ifndef __SCIP_HEUR_LOCKS_H__
    43#define __SCIP_HEUR_LOCKS_H__
    44
    45#include "scip/def.h"
    46#include "scip/type_heur.h"
    47#include "scip/type_retcode.h"
    48#include "scip/type_scip.h"
    49
    50#ifdef __cplusplus
    51extern "C" {
    52#endif
    53
    54/** creates the locks primal heuristic and includes it in SCIP
    55 *
    56 * @ingroup PrimalHeuristicIncludes
    57 */
    58SCIP_EXPORT
    60 SCIP* scip /**< SCIP data structure */
    61 );
    62
    63
    64/** apply fix-and-propagate scheme based on variable locks
    65 *
    66 * @note probing mode of SCIP needs to be enabled before
    67 */
    68SCIP_EXPORT
    70 SCIP* scip, /**< SCIP data structure */
    71 SCIP_HEURDATA* heurdata, /**< primal heuristic data */
    72 SCIP_Bool* cutoff, /**< pointer to store if a cutoff was detected */
    73 SCIP_Bool* allrowsfulfilled /**< pointer to store if all rows became redundant */
    74 );
    75
    76#ifdef __cplusplus
    77}
    78#endif
    79
    80#endif
    common defines and data types used in all packages of SCIP
    #define SCIP_Bool
    Definition: def.h:91
    SCIP_RETCODE SCIPincludeHeurLocks(SCIP *scip)
    Definition: heur_locks.c:1083
    SCIP_RETCODE SCIPapplyLockFixings(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_Bool *cutoff, SCIP_Bool *allrowsfulfilled)
    Definition: heur_locks.c:191
    type definitions for primal heuristics
    struct SCIP_HeurData SCIP_HEURDATA
    Definition: type_heur.h:77
    type definitions for return codes for SCIP methods
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    type definitions for SCIP's main datastructure