Scippy

    SCIP

    Solving Constraint Integer Programs

    type_hypergraph.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 type_hypergraph.h
    26 * @ingroup TYPEDEFINITIONS
    27 * @brief type definitions for hypergraphs
    28 * @author Matthias Walter
    29 */
    30
    31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    32
    33#ifndef __SCIP_TYPE_HYPERGRAPH_H__
    34#define __SCIP_TYPE_HYPERGRAPH_H__
    35
    36#ifdef __cplusplus
    37extern "C" {
    38#endif
    39
    40#include "scip/def.h"
    41
    42/** a hypergraph with vertices, edges and overlaps of edge pairs */
    44
    45/** data for iterating over adjacent edges. */
    47
    48/** locally defined data for each vertex in a hypergraph */
    49typedef struct SCIP_Hypergraph_NodeData SCIP_HYPERGRAPH_VERTEXDATA;
    50
    51/** locally defined data for each edge in a hypergraph */
    52typedef struct SCIP_Hypergraph_EdgeData SCIP_HYPERGRAPH_EDGEDATA;
    53
    54/** locally defined data for each overlap set in a hypergraph */
    55typedef struct SCIP_Hypergraph_OverlapData SCIP_HYPERGRAPH_OVERLAPDATA;
    56
    57/** vertex in a hypergraph */
    59
    60/** edge in a hypergraph */
    62
    63/** overlap set in a hypergraph */
    65
    66
    67/** Called by \ref SCIPhypergraphOverlapFind, \ref SCIPhypergraphIntersectEdges and \ref SCIPhypergraphComputeOverlaps
    68 * whenever a new overlap set is created or an existing overlap is found.
    69 */
    70#define SCIP_DECL_HYPERGRAPH_OVERLAP(x) SCIP_RETCODE x (SCIP_HYPERGRAPH* hypergraph, SCIP_HYPERGRAPH_OVERLAP overlap, \
    71 SCIP_HYPERGRAPH_OVERLAPDATA* data, SCIP_HYPERGRAPH_EDGE first, SCIP_HYPERGRAPH_EDGE second, SCIP_Bool created, \
    72 void* userdata)
    73
    74
    75/** masks to control the iteration over adjacent edges. */
    77{
    78 SCIP_HYPERGRAPH_ITERCTRL_MINOVERLAP = 255, /**< Mask for minimum required size of edge intersections. */
    79 SCIP_HYPERGRAPH_ITERCTRL_ONLYLATER = 256, /**< Whether to only consider edges with larger index than the base. */
    80 SCIP_HYPERGRAPH_ITERCTRL_FINDOVERLAPS = 512 /**< Whether to compute the corresponding overlaps. */
    81};
    82typedef enum SCIP_Hypergraph_IterCtrl SCIP_HYPERGRAPH_ITERCTRL; /**< controls the iteration over adjacent edges. */
    83
    84/** data for iterating over adjacent edges. */
    86{
    87 SCIP_HYPERGRAPH_EDGE base; /**< Base edge for iteration. */
    88 int vertexidx; /**< Index of incident vertex w.r.t. to base; initially -1; invalid if -2 */
    89 SCIP_HYPERGRAPH_VERTEX minvertex; /**< Incident vertex. */
    90 int edgeidx; /**< Index of the adjacent edge w.r.t. to the vertex. */
    91 SCIP_HYPERGRAPH_EDGE adjacent; /**< Adjacent edge. */
    92 int ncommonvertices; /**< Number of common vertices. */
    93 int sizecommonvertices; /**< Memory allocated for common vertices. */
    94 SCIP_HYPERGRAPH_VERTEX* commonvertices; /**< Array of common vertices. */
    95 SCIP_HYPERGRAPH_OVERLAP overlap; /**< Overlap set of the intersection, if available; -2 if disabled. */
    96 unsigned int minoverlapsize : 6; /**< Minimum size of the overlap. */
    97 unsigned int onlylater : 1; /**< Whether to only consider edges greater than the base edge. */
    98 unsigned int findoverlaps : 1; /**< Whether to compute the overlap sets. */
    99};
    100
    101#ifdef __cplusplus
    102}
    103#endif
    104
    105#endif
    106
    common defines and data types used in all packages of SCIP
    unsigned int minoverlapsize
    SCIP_HYPERGRAPH_EDGE base
    SCIP_HYPERGRAPH_OVERLAP overlap
    SCIP_HYPERGRAPH_EDGE adjacent
    SCIP_HYPERGRAPH_VERTEX * commonvertices
    unsigned int onlylater
    unsigned int findoverlaps
    SCIP_HYPERGRAPH_VERTEX minvertex
    int SCIP_HYPERGRAPH_EDGE
    int SCIP_HYPERGRAPH_OVERLAP
    SCIP_Hypergraph_IterCtrl
    @ SCIP_HYPERGRAPH_ITERCTRL_ONLYLATER
    @ SCIP_HYPERGRAPH_ITERCTRL_MINOVERLAP
    @ SCIP_HYPERGRAPH_ITERCTRL_FINDOVERLAPS
    struct SCIP_Hypergraph_OverlapData SCIP_HYPERGRAPH_OVERLAPDATA
    struct SCIP_Hypergraph_NodeData SCIP_HYPERGRAPH_VERTEXDATA
    enum SCIP_Hypergraph_IterCtrl SCIP_HYPERGRAPH_ITERCTRL
    int SCIP_HYPERGRAPH_VERTEX
    struct SCIP_Hypergraph_EdgeData SCIP_HYPERGRAPH_EDGEDATA