1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the program and library */ 4 /* SCIP --- Solving Constraint Integer Programs */ 5 /* */ 6 /* Copyright (C) 2002-2021 Konrad-Zuse-Zentrum */ 7 /* fuer Informationstechnik Berlin */ 8 /* */ 9 /* SCIP is distributed under the terms of the ZIB Academic License. */ 10 /* */ 11 /* You should have received a copy of the ZIB Academic License */ 12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */ 13 /* */ 14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 16 /**@file cons_stp.h 17 * @brief Constraint handler for Steiner problems 18 * @author Gerald Gamrath 19 * @author Daniel Rehfeldt 20 * @author Michael Winkler 21 * 22 * This file checks solutions for feasibility and separates violated model constraints. For more details see \ref STP_CONS page. 23 */ 24 25 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 26 27 #ifndef __SCIP_CONS_STP_H__ 28 #define __SCIP_CONS_STP_H__ 29 30 31 #include "scip/scip.h" 32 #include "grph.h" 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif 37 38 39 #ifndef RESTRICT 40 #define RESTRICT restrict 41 #endif 42 43 /** creates the handler for element constraints and includes it in SCIP */ 44 SCIP_RETCODE SCIPincludeConshdlrStp( 45 SCIP* scip /**< SCIP data structure */ 46 ); 47 48 /** creates and captures a stp constraint */ 49 SCIP_RETCODE SCIPcreateConsStp( 50 SCIP* scip, /**< SCIP data structure */ 51 SCIP_CONS** cons, /**< pointer to hold the created constraint */ 52 const char* name, /**< name of constraint */ 53 GRAPH* graph /**< graph data structure */ 54 ); 55 56 /** sets graph */ 57 void SCIPStpConshdlrSetGraph( 58 SCIP* scip, /**< SCIP data structure */ 59 const GRAPH* g /**< graph data structure */ 60 ); 61 62 /** dual ascent heuristic */ 63 SCIP_RETCODE SCIPStpDualAscent( 64 SCIP* scip, /**< SCIP data structure */ 65 const GRAPH* g, /**< graph data structure */ 66 SCIP_Real* RESTRICT redcost, /**< array to store reduced costs or NULL */ 67 SCIP_Real* RESTRICT nodearrreal, /**< real vertices array for internal computations or NULL */ 68 SCIP_Real* objval, /**< pointer to store objective value */ 69 SCIP_Bool addcuts, /**< should dual ascent add Steiner cuts? */ 70 SCIP_Bool ascendandprune, /**< should the ascent-and-prune heuristic be executed? */ 71 GNODE** gnodearrterms, /**< gnode terminals array for internal computations or NULL */ 72 const int* result, /**< solution array (solution needs to be provided) */ 73 int* RESTRICT edgearrint, /**< int edges array for internal computations or NULL */ 74 int* RESTRICT nodearrint, /**< int vertices array for internal computations or NULL */ 75 int root, /**< the root */ 76 SCIP_Bool is_pseudoroot, /**< is the root a pseudo root? */ 77 SCIP_Real damaxdeviation, /**< number of dual ascent runs */ 78 STP_Bool* RESTRICT nodearrchar /**< char vertices array for internal computations or NULL */ 79 ); 80 81 /** dual ascent heuristic for the PCSPG and the MWCSP */ 82 SCIP_RETCODE SCIPStpDualAscentPcMw( 83 SCIP* scip, /**< SCIP data structure */ 84 GRAPH* g, /**< graph data structure */ 85 SCIP_Real* redcost, /**< array to store reduced costs or NULL */ 86 SCIP_Real* objval, /**< pointer to store objective value */ 87 SCIP_Bool addcuts, /**< should dual ascent add Steiner cuts? */ 88 SCIP_Bool ascendandprune, /**< perform ascend-and-prune and add solution? */ 89 int nruns /**< number of dual ascent runs */ 90 ); 91 92 93 #ifdef __cplusplus 94 } 95 #endif 96 97 #endif 98