Scippy

    SCIP

    Solving Constraint Integer Programs

    sepa_flower.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 sepa_flower.h
    26 * @ingroup SEPARATORS
    27 * @brief flower-inequality separator
    28 * @author Matthias Walter
    29 *
    30 * Separator for flower inequalities that are valid for the mulitlinear polytope \f$ P(G) \f$ of a hypergraph
    31 * \f$ G = (V,E) \f$, defined as the convex hull of all vectors \f$ z \in \{0,1\}^{V + E} \f$ that
    32 * satisfy \f$ z_e = \prod_{v \in e} z_v \f$ for all \f$ e \in E \f$. In other words, the variable associated with each
    33 * (hyper-)edge is equal to the product of the variables associated with the vertices.
    34 *
    35 * The hypergraph \f$ G \f$ is computed in the first separation round in which this separator is called. The edges
    36 * correspond to all AND constraints (see \ref cons_and.h), where \f$ z_e \f$ is the resultant \f$ r \f$ of
    37 * \f$ r = x_1 \land x_2 \land \dotsb \land x_n \f$ and its incident vertices correspond to the \f$ x_i \f$.
    38 * Moreover, also (nonlinear) product expressions (see \ref expr_product.h) are scanned. For these, the involved
    39 * variables are not necessarily binary, i.e., we have \f$ \ell_i \leq x_i \leq u_i \f$, and there might be an
    40 * additional constant scaling factor \f$ c \f$. Such expressions \f$ r = c \prod\limits_{i=1}^n x_i \f$ are only taken
    41 * into account if \f$ \ell_i \geq 0 \f$ for all \f$ i \f$ since in this case the cut can be applied to the space
    42 * \f$ (r',x') \f$ with \f$ r' = \frac{ r }{ c \cdot u_1 \cdot u_2 \cdot \dotsc \cdot u_n } \f$ and
    43 * \f$ x'_i = \frac{ x_i }{ u_i } \f$ for all \f$ i \f$.
    44 *
    45 * ### Flower inequalities ###
    46 *
    47 * The implemented cuts are <em>k-flower inequalities</em> for \f$ k=1,2 \f$. Such a cut is determined by a
    48 * <em>base edge</em> \f$ e \f$ and \f$ k \f$ adjacent edges \f$ f_1, f_2, \dotsc, f_k \f$ that satisfy
    49 * \f$ f_i \cap e \neq \emptyset \f$ but are disjoint in \f$ e \f$, i.e., \f$ f_i \cap f_j \cap e = \emptyset \f$ for
    50 * all \f$ i \neq j \f$ holds. The set \f$ R \f$ of <em>remaining nodes</em> is defined as
    51 * \f$ R := e \setminus \bigcup_{i=1}^k f_i \f$. The inequality reads
    52 * \f[ z_e + \sum\limits_{i=1}^k (1-z_{f_i}) + \sum\limits_{v \in R} (1-z_v) \geq 1. \f]
    53 * Validity follows from the fact that the left-hand side is a sum of nonnegative binary terms, and can thus only
    54 * be violated if (in particular) \f$ z_{f_i} = 1 \f$ for \f$ i=1,2,\dotsc,k \f$ and \f$ z_v = 1 \f$ for all
    55 * \f$ v \in R \f$ holds. This, however, implies \f$ z_v = 1 \f$ for all \f$ v \in e \f$ and thus \f$ z_e = 1 \f$.
    56 *
    57 * Separation can either be done in time \f$ \mathcal{O}( |E|^{k+1} ) \f$ by enumeration or as follows:
    58 * Replacing an adjacent edge \f$ f_i \f$ by another edge \f$ f_i' \f$ with the same <em>overlap</em> with the base
    59 * edge, i.e., \f$ f'_i \cap e = f_i \cap e \f$ improves the violation if \f$ 1-z_{f'_i} < 1 - z_{f_i} \f$.
    60 * Consequently, we compute the set of all <em>overlap sets</em> \f$ \{ e \cap f \mid e,f \in E \} \f$
    61 * (see \ref hypergraph.h) and compute \f$ \min \{ 1-z_e \mid e \in E : U \subseteq e \} \f$ for all such \f$ U \f$.
    62 * If the number of overlap sets incident to an edge is constant (say, if \f$ |e| \f$ is constant), then the running
    63 * time reduces to \f$ \mathcal{O} ( |E| ) \f$.
    64 */
    65
    66/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    67
    68#ifndef __SCIP_SEPA_MULTILINEAR_H__
    69#define __SCIP_SEPA_MULTILINEAR_H__
    70
    71
    72#include "scip/scip.h"
    73
    74#ifdef __cplusplus
    75extern "C" {
    76#endif
    77
    78/** creates the flower separator and includes it in SCIP
    79 *
    80 * @ingroup SeparatorIncludes
    81 */
    82SCIP_EXPORT
    84 SCIP* scip /**< SCIP data structure */
    85 );
    86
    87#ifdef __cplusplus
    88}
    89#endif
    90
    91#endif
    SCIP_RETCODE SCIPincludeSepaFlower(SCIP *scip)
    Definition: sepa_flower.c:1428
    SCIP callable library.
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63