1    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2    	/*                                                                           */
3    	/*                  This file is part of the program and library             */
4    	/*         SCIP --- Solving Constraint Integer Programs                      */
5    	/*                                                                           */
6    	/*  Copyright (c) 2002-2023 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
51   	extern "C" {
52   	#endif
53   	
54   	/** creates the locks primal heuristic and includes it in SCIP
55   	 *
56   	 *  @ingroup PrimalHeuristicIncludes
57   	 */
58   	SCIP_EXPORT
59   	SCIP_RETCODE SCIPincludeHeurLocks(
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   	 */
68   	SCIP_EXPORT
69   	SCIP_RETCODE SCIPapplyLockFixings(
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
81