Scippy

    SCIP

    Solving Constraint Integer Programs

    type_concsolver.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-2026 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 type_concsolver.h
    26 * @ingroup TYPEDEFINITIONS
    27 * @brief type definitions for concurrent solvers
    28 * @author Leona Gottwald
    29 * @author Marc Pfetsch
    30 *
    31 * This file defines the interface for concurrent solvers.
    32 *
    33 */
    34
    35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    36
    37#ifndef __SCIP_TYPE_CONCSOLVER_H__
    38#define __SCIP_TYPE_CONCSOLVER_H__
    39
    40#include "scip/def.h"
    41#include "scip/type_scip.h"
    42#include "scip/type_stat.h"
    43#include "scip/type_lp.h"
    44#include "scip/type_syncstore.h"
    45
    46#ifdef __cplusplus
    47extern "C" {
    48#endif
    49
    50typedef struct SCIP_ConcSolverType SCIP_CONCSOLVERTYPE; /**< the struct defining a concurrent solver class */
    51typedef struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA; /**< concurrent solver class user data */
    52typedef struct SCIP_ConcSolver SCIP_CONCSOLVER; /**< struct for an instance of a concurrent solver */
    53typedef struct SCIP_ConcSolverData SCIP_CONCSOLVERDATA; /**< concurrent solver user data */
    54
    55/** creates a concurrent solver instance
    56 *
    57 * input:
    58 * - scip : SCIP main data structure
    59 * - concsolvertype : type of concurrent solver an instance should be created for
    60 * - concsolver : pointer to return concurrent solver instance
    61 *
    62 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    63 */
    64#define SCIP_DECL_CONCSOLVERCREATEINST(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONCSOLVERTYPE* concsolvertype, SCIP_CONCSOLVER* concsolver)
    65
    66/** destroys a concurrent solver instance
    67 *
    68 * input:
    69 * - scip : SCIP main data structure
    70 * - concsolver : concurrent solver instance to destroy
    71 *
    72 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    73 */
    74#define SCIP_DECL_CONCSOLVERDESTROYINST(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONCSOLVER* concsolver)
    75
    76/** frees data of a concurrent solver type
    77 *
    78 * input:
    79 * - data : concurrent solver type data to free
    80 *
    81 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    82 */
    83#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x) void x (SCIP_CONCSOLVERTYPEDATA** data)
    84
    85/** initialize random seeds of a concurrent solver
    86 *
    87 * input:
    88 * - concsolver : concurrent solver data structure
    89 * - seed : seed for initializing the solver's internal random seeds
    90 *
    91 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    92 */
    93#define SCIP_DECL_CONCSOLVERINITSEEDS(x) SCIP_RETCODE x (SCIP_CONCSOLVER* concsolver, unsigned int seed)
    94
    95/** synchronization method of concurrent solver for writing data
    96 *
    97 * Syncronizes with other solvers. The concurrent solver should pass new solutions
    98 * and bounds to the syncstore. For the solutions, no more than maxcandsols of the best solutions
    99 * should be considered for sharing. Additionally a maximum if maxsharedsols should be
    100 * passed to the syncstore.
    101 *
    102 * input:
    103 * - concsolver : concurrent solver data structure
    104 * - syncstore : pointer to the SCIP synchronization store
    105 * - syncdata : synchronization data
    106 * - maxcandsols : maximal number of best solutions that should be considered for sharing
    107 * - maxsharedsols : maximum number of solutions that should be shared
    108 * - nsolsshared : pointer to return the number of solutions shared
    109 *
    110 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    111 */
    112#define SCIP_DECL_CONCSOLVERSYNCWRITE(x) SCIP_RETCODE x (SCIP_CONCSOLVER* concsolver, SCIP_SYNCSTORE* syncstore, SCIP_SYNCDATA* syncdata, int maxcandsols, int maxsharedsols, int* nsolsshared)
    113
    114/** synchronization method of concurrent solver for reading data
    115 *
    116 * The concurrent solver should read the solutions and bounds stored in the
    117 * given synchronization data.
    118 *
    119 * input:
    120 * - concsolver : concurrent solver data structure
    121 * - syncstore : pointer to the SCIP synchronization store
    122 * - syncdata : synchronization data
    123 * - nsolsrecvd : pointer to return the number of received solutions
    124 * - ntighterbnds : pointer to return the number of tighter bounds
    125 * - ntighterintbnds : pointer to return the number of tighter integer bounds
    126 *
    127 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    128 */
    129#define SCIP_DECL_CONCSOLVERSYNCREAD(x) SCIP_RETCODE x (SCIP_CONCSOLVER* concsolver, SCIP_SYNCSTORE* syncstore, SCIP_SYNCDATA* syncdata, int* nsolsrecvd, int* ntighterbnds, int* ntighterintbnds)
    130
    131/** execution method of concurrent solver
    132 *
    133 * start solving of the problem given during initialization
    134 *
    135 * input:
    136 * - concsolver : concurrent solver data structure
    137 * - solvingtime : pointer to return the used solving time
    138 * - nlpiterations : pointer to return the used number of LP iterations
    139 * - nnodes : pointer to return the used number of branch-and-bound nodes
    140 *
    141 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    142 */
    143#define SCIP_DECL_CONCSOLVEREXEC(x) SCIP_RETCODE x (SCIP_CONCSOLVER* concsolver, SCIP_Real* solvingtime, SCIP_Longint* nlpiterations, SCIP_Longint* nnodes)
    144
    145/** stop the solving as soon as possible
    146 *
    147 * input:
    148 * - concsolver : concurrent solver data structure
    149 *
    150 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    151 */
    152#define SCIP_DECL_CONCSOLVERSTOP(x) SCIP_RETCODE x (SCIP_CONCSOLVER* concsolver)
    153
    154/** extract the solving data from the concurrent solver
    155 *
    156 * The concurrent solver should get the data and store it into the SCIP datastructure, so that this SCIP instance has
    157 * the optimal solution and reports the correct status and statistics.
    158 *
    159 * input:
    160 * - concsolver : concurrent solver data structure
    161 * - scip : SCIP datastructure
    162 *
    163 * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
    164 */
    165#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x) SCIP_RETCODE x (SCIP_CONCSOLVER* concsolver, SCIP* scip)
    166
    167#ifdef __cplusplus
    168}
    169#endif
    170
    171#endif
    common defines and data types used in all packages of SCIP
    struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
    struct SCIP_ConcSolverData SCIP_CONCSOLVERDATA
    type definitions for LP management
    type definitions for SCIP's main datastructure
    type definitions for problem statistics
    the type definitions for the synchronization store