Files
ortools-clone/docs/cpp/integer__search_8h_source.html
2020-09-02 09:43:05 +02:00

358 lines
65 KiB
HTML

<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: integer_search.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OR-Tools
&#160;<span id="projectnumber">8.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('integer__search_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">integer_search.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="integer__search_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// Copyright 2010-2018 Google LLC</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment">// limitations under the License.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">// This file contains all the top-level logic responsible for driving the search</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">// of a satisfiability integer problem. What decision we take next, which new</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment">// Literal associated to an IntegerLiteral we create and when we restart.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">// For an optimization problem, our algorithm solves a sequence of decision</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment">// problem using this file as an entry point. Note that some heuristics here</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment">// still use the objective if there is one in order to orient the search towards</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment">// good feasible solution though.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#ifndef OR_TOOLS_SAT_INTEGER_SEARCH_H_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#define OR_TOOLS_SAT_INTEGER_SEARCH_H_</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="integer_8h.html">ortools/sat/integer.h</a>&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sat__base_8h.html">ortools/sat/sat_base.h</a>&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sat__solver_8h.html">ortools/sat/sat_solver.h</a>&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceoperations__research.html">operations_research</a> {</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span>sat {</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="comment">// Model struct that contains the search heuristics used to find a feasible</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment">// solution to an integer problem.</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="comment">// This is reset by ConfigureSearchHeuristics() and used by</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment">// SolveIntegerProblem(), see below.</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1SearchHeuristics.html"> 40</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1SearchHeuristics.html">SearchHeuristics</a> {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="comment">// Decision and restart heuristics. The two vectors must be of the same size</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="comment">// and restart_policies[i] will always be used in conjunction with</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="comment">// decision_policies[i].</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#ae2d8f00a94944421f2f4e195eb5994c9"> 44</a></span>&#160; std::vector&lt;std::function&lt;LiteralIndex()&gt;&gt; <a class="code" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#ae2d8f00a94944421f2f4e195eb5994c9">decision_policies</a>;</div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#a0d0b8f29f3557e2ee84f53b45d817e02"> 45</a></span>&#160; std::vector&lt;std::function&lt;bool()&gt;&gt; <a class="code" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#a0d0b8f29f3557e2ee84f53b45d817e02">restart_policies</a>;</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="comment">// Index in the vector above that indicate the current configuration.</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#af2155539e87804108c670c32478e123d"> 48</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#af2155539e87804108c670c32478e123d">policy_index</a>;</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="comment">// Two special decision functions that are constructed at loading time.</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="comment">// These are used by ConfigureSearchHeuristics() to fill the policies above.</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#a4902aee8a3adc40ba39616dff46888b6"> 52</a></span>&#160; std::function&lt;LiteralIndex()&gt; <a class="code" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#a4902aee8a3adc40ba39616dff46888b6">fixed_search</a> = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#ade6f16e4ac7bfbe99c5dcf105fe2d67f"> 53</a></span>&#160; std::function&lt;LiteralIndex()&gt; <a class="code" href="structoperations__research_1_1sat_1_1SearchHeuristics.html#ade6f16e4ac7bfbe99c5dcf105fe2d67f">hint_search</a> = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;};</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="comment">// Given a base &quot;fixed_search&quot; function that should mainly control in which</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment">// order integer variables are lazily instantiated (and at what value), this</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment">// uses the current solver parameters to set the SearchHeuristics class in the</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="comment">// given model.</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a7ac1d9dc3254d77ade7bdbf984884b7e">ConfigureSearchHeuristics</a>(<a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment">// Callbacks that will be called when the search goes back to level 0.</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="comment">// Callbacks should return false if the propagation fails.</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1LevelZeroCallbackHelper.html"> 64</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1LevelZeroCallbackHelper.html">LevelZeroCallbackHelper</a> {</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1LevelZeroCallbackHelper.html#ac008fdb20ed4a9c84c490d4cbff755ac"> 65</a></span>&#160; std::vector&lt;std::function&lt;bool()&gt;&gt; <a class="code" href="structoperations__research_1_1sat_1_1LevelZeroCallbackHelper.html#ac008fdb20ed4a9c84c490d4cbff755ac">callbacks</a>;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;};</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="comment">// Tries to find a feasible solution to the current model.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="comment">// This function continues from the current state of the solver and loop until</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="comment">// all variables are instantiated (i.e. the next decision is kNoLiteralIndex) or</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="comment">// a search limit is reached. It uses the heuristic from the SearchHeuristics</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="comment">// class in the model to decide when to restart and what next decision to take.</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="comment">// Each time a restart happen, this increment the policy index modulo the number</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="comment">// of heuristics to act as a portfolio search.</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<a class="code" href="classoperations__research_1_1sat_1_1SatSolver.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">SatSolver::Status</a> <a class="code" href="namespaceoperations__research_1_1sat.html#a8bea9a6a0de60c8fdab99ad7dfdf8498">SolveIntegerProblem</a>(<a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="comment">// Resets the solver to the given assumptions before calling</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="comment">// SolveIntegerProblem().</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<a class="code" href="classoperations__research_1_1sat_1_1SatSolver.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">SatSolver::Status</a> <a class="code" href="namespaceoperations__research_1_1sat.html#a17b20b0845d9e02829d417294aded36a">ResetAndSolveIntegerProblem</a>(</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keyword">const</span> std::vector&lt;Literal&gt;&amp; assumptions, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="comment">// Only used in tests. Move to a test utility file.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="comment">// This configures the model SearchHeuristics with a simple default heuristic</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="comment">// and then call ResetAndSolveIntegerProblem() without any assumptions.</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<a class="code" href="classoperations__research_1_1sat_1_1SatSolver.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">SatSolver::Status</a> <a class="code" href="namespaceoperations__research_1_1sat.html#a48d1aae59a778d6f39609f9add7cd0a5">SolveIntegerProblemWithLazyEncoding</a>(<a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="comment">// Helper methods to return up (&gt;=) and down (&lt;=) branching decisions.</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;LiteralIndex <a class="code" href="namespaceoperations__research_1_1sat.html#af73dd5cdec05a6bbd9fb677f45fac2be">BranchDown</a>(IntegerVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>, IntegerValue <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;LiteralIndex <a class="code" href="namespaceoperations__research_1_1sat.html#aea96708896c3142cfb0d6c8dadd071fc">BranchUp</a>(IntegerVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>, IntegerValue <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;<span class="comment">// Returns decision corresponding to var at its lower bound. Returns</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="comment">// kNoLiteralIndex if the variable is fixed.</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;LiteralIndex <a class="code" href="namespaceoperations__research_1_1sat.html#a1aeef60fc8c9e76ebdd6ee5652e86ba9">AtMinValue</a>(IntegerVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>, <a class="code" href="classoperations__research_1_1sat_1_1IntegerTrail.html">IntegerTrail</a>* integer_trail,</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntegerEncoder.html">IntegerEncoder</a>* integer_encoder);</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="comment">// Returns decision corresponding to var &gt;= lb + max(1, (ub - lb) / 2). It also</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="comment">// CHECKs that the variable is not fixed.</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;LiteralIndex <a class="code" href="namespaceoperations__research_1_1sat.html#ae6b68e19d66776a0728fc418c3a1fa14">GreaterOrEqualToMiddleValue</a>(IntegerVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="comment">// This method first tries var &lt;= value. If this does not reduce the domain it</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="comment">// tries var &gt;= value. If that also does not reduce the domain then returns</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="comment">// kNoLiteralIndex.</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;LiteralIndex <a class="code" href="namespaceoperations__research_1_1sat.html#a1565b56602e84a6362d53b11163aedbc">SplitAroundGivenValue</a>(IntegerVariable positive_var,</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; IntegerValue <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="comment">// Returns decision corresponding to var &lt;= round(lp_value). If the variable</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="comment">// does not appear in the LP, this method returns kNoLiteralIndex.</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;LiteralIndex <a class="code" href="namespaceoperations__research_1_1sat.html#a55a7ac53a157135c072ad9d31bd47c38">SplitAroundLpValue</a>(IntegerVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="comment">// Returns decision corresponding to var &lt;= best_solution[var]. If no solution</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="comment">// has been found, this method returns kNoLiteralIndex. This was suggested in</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="comment">// paper: &quot;Solution-Based Phase Saving for CP&quot; (2018) by Emir Demirovic,</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="comment">// Geoffrey Chu, and Peter J. Stuckey</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a77b16f43c9fc18688bfda50a953cbce0"> 117</a></span>&#160;LiteralIndex <a class="code" href="namespaceoperations__research_1_1sat.html#a77b16f43c9fc18688bfda50a953cbce0">SplitDomainUsingBestSolutionValue</a>(IntegerVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>,</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="comment">// Decision heuristic for SolveIntegerProblemWithLazyEncoding(). Returns a</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="comment">// function that will return the literal corresponding to the fact that the</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="comment">// first currently non-fixed variable value is &lt;= its min. The function will</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="comment">// return kNoLiteralIndex if all the given variables are fixed.</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="comment">// Note that this function will create the associated literal if needed.</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;std::function&lt;LiteralIndex()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a37d0780b10099ec4c75b6a7e1651e0cf">FirstUnassignedVarAtItsMinHeuristic</a>(</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keyword">const</span> std::vector&lt;IntegerVariable&gt;&amp; vars, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="comment">// Decision heuristic for SolveIntegerProblemWithLazyEncoding(). Like</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="comment">// FirstUnassignedVarAtItsMinHeuristic() but the function will return the</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="comment">// literal corresponding to the fact that the currently non-assigned variable</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="comment">// with the lowest min has a value &lt;= this min.</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;std::function&lt;LiteralIndex()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#aae2d3b2f98c316d8644c349b79d1561f">UnassignedVarWithLowestMinAtItsMinHeuristic</a>(</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keyword">const</span> std::vector&lt;IntegerVariable&gt;&amp; vars, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="comment">// Set the first unassigned Literal/Variable to its value.</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="comment">// TODO(user): This is currently quadratic as we scan all variables to find the</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="comment">// first unassigned one. Fix. Note that this is also the case in many other</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="comment">// heuristics and should be fixed.</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html"> 141</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html">BooleanOrIntegerVariable</a> {</div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html#aa5d493d0ceaa64f8e71d9aa540db7d90"> 142</a></span>&#160; BooleanVariable <a class="code" href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html#aa5d493d0ceaa64f8e71d9aa540db7d90">bool_var</a> = <a class="code" href="namespaceoperations__research_1_1sat.html#add67896a84f6372a648154c5770a0ae0">kNoBooleanVariable</a>;</div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html#ae5143331fa20cd81b3339d4279826439"> 143</a></span>&#160; IntegerVariable <a class="code" href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html#ae5143331fa20cd81b3339d4279826439">int_var</a> = <a class="code" href="namespaceoperations__research_1_1sat.html#a5bd8c44473618b7eafd33ba978db2f06">kNoIntegerVariable</a>;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;};</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;std::function&lt;LiteralIndex()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#aebc63ea48859616e1fb66c1adc807502">FollowHint</a>(</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keyword">const</span> std::vector&lt;BooleanOrIntegerVariable&gt;&amp; vars,</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keyword">const</span> std::vector&lt;IntegerValue&gt;&amp; values, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="comment">// Combines search heuristics in order: if the i-th one returns kNoLiteralIndex,</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;<span class="comment">// ask the (i+1)-th. If every heuristic returned kNoLiteralIndex,</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;<span class="comment">// returns kNoLiteralIndex.</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;std::function&lt;LiteralIndex()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a73bb705d68ce7ab22c3c0d0d1256db99">SequentialSearch</a>(</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; std::vector&lt;std::function&lt;LiteralIndex()&gt;&gt; heuristics);</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; </div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="comment">// Changes the value of the given decision by &#39;var_selection_heuristic&#39;. We try</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;<span class="comment">// to see if the decision is &quot;associated&quot; with an IntegerVariable, and if it is</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;<span class="comment">// the case, we choose the new value by the first &#39;value_selection_heuristics&#39;</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="comment">// that is applicable (return value != kNoLiteralIndex). If none of the</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="comment">// heuristics are applicable then the given decision by</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;<span class="comment">// &#39;var_selection_heuristic&#39; is returned.</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;std::function&lt;LiteralIndex()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a3da014a0d45b3fb4fd8f57a38eaabad8">SequentialValueSelection</a>(</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; std::vector&lt;std::function&lt;LiteralIndex(IntegerVariable)&gt;&gt;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; value_selection_heuristics,</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; std::function&lt;LiteralIndex()&gt; var_selection_heuristic, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; </div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;<span class="comment">// Changes the value of the given decision by &#39;var_selection_heuristic&#39;</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="comment">// according to various value selection heuristics. Looks at the code to know</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;<span class="comment">// exactly what heuristic we use.</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;std::function&lt;LiteralIndex()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a3a5581c87eda08d55eea884ef35b7533">IntegerValueSelectionHeuristic</a>(</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; std::function&lt;LiteralIndex()&gt; var_selection_heuristic, <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;<span class="comment">// Returns the LiteralIndex advised by the underliying SAT solver.</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;std::function&lt;LiteralIndex()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#af7c6dddbeb211b4060454e9ef775acd7">SatSolverHeuristic</a>(<a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;<span class="comment">// Gets the branching variable using pseudo costs and combines it with a value</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="comment">// for branching.</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;std::function&lt;LiteralIndex()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a8ee53722dd03d97d576732ad2722de72">PseudoCost</a>(<a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="comment">// Returns true if the number of variables in the linearized part represent</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<span class="comment">// a large enough proportion of all the problem variables.</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="namespaceoperations__research_1_1sat.html#aeaaccdd218e3f0aa5c218d3a0cc5c3f1">LinearizedPartIsLarge</a>(<a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; </div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="comment">// A restart policy that restarts every k failures.</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;std::function&lt;bool()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a5fcdf1d56a24d096d0c381a9708d4fa9">RestartEveryKFailures</a>(<span class="keywordtype">int</span> k, <a class="code" href="classoperations__research_1_1sat_1_1SatSolver.html">SatSolver</a>* solver);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="comment">// A restart policy that uses the underlying sat solver&#39;s policy.</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;std::function&lt;bool()&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a527a6ee26b7f573def70daf9b2a9e577">SatSolverRestartPolicy</a>(<a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; </div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="comment">// Appends model-owned automatic heuristics to input_heuristics in a new vector.</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;std::vector&lt;std::function&lt;LiteralIndex()&gt;&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a411bdf3cd00369241403fc6c276b3d24">AddModelHeuristics</a>(</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keyword">const</span> std::vector&lt;std::function&lt;LiteralIndex()&gt;&gt;&amp; input_heuristics,</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; </div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;<span class="comment">// Concatenates each input_heuristic with a default heuristic that instantiate</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="comment">// all the problem&#39;s Boolean variables, into a new vector.</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;std::vector&lt;std::function&lt;LiteralIndex()&gt;&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#ae56a0b3cb09b881015f12910fb0fb866">CompleteHeuristics</a>(</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keyword">const</span> std::vector&lt;std::function&lt;LiteralIndex()&gt;&gt;&amp; incomplete_heuristics,</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keyword">const</span> std::function&lt;LiteralIndex()&gt;&amp; completion_heuristic);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;} <span class="comment">// namespace sat</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;} <span class="comment">// namespace operations_research</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; </div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;<span class="preprocessor">#endif // OR_TOOLS_SAT_INTEGER_SEARCH_H_</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aexpr__array_8cc_html_a472a99923cbe11ae7b5a5d157d9ad465"><div class="ttname"><a href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a></div><div class="ttdeci">IntVar * var</div><div class="ttdef"><b>Definition:</b> <a href="expr__array_8cc_source.html#l01858">expr_array.cc:1858</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1SearchHeuristics_html_ade6f16e4ac7bfbe99c5dcf105fe2d67f"><div class="ttname"><a href="structoperations__research_1_1sat_1_1SearchHeuristics.html#ade6f16e4ac7bfbe99c5dcf105fe2d67f">operations_research::sat::SearchHeuristics::hint_search</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; hint_search</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00053">integer_search.h:53</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a3a5581c87eda08d55eea884ef35b7533"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a3a5581c87eda08d55eea884ef35b7533">operations_research::sat::IntegerValueSelectionHeuristic</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; IntegerValueSelectionHeuristic(std::function&lt; LiteralIndex()&gt; var_selection_heuristic, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00254">integer_search.cc:254</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a5fcdf1d56a24d096d0c381a9708d4fa9"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a5fcdf1d56a24d096d0c381a9708d4fa9">operations_research::sat::RestartEveryKFailures</a></div><div class="ttdeci">std::function&lt; bool()&gt; RestartEveryKFailures(int k, SatSolver *solver)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00514">integer_search.cc:514</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_aebc63ea48859616e1fb66c1adc807502"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#aebc63ea48859616e1fb66c1adc807502">operations_research::sat::FollowHint</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; FollowHint(const std::vector&lt; BooleanOrIntegerVariable &gt; &amp;vars, const std::vector&lt; IntegerValue &gt; &amp;values, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00455">integer_search.cc:455</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a5bd8c44473618b7eafd33ba978db2f06"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a5bd8c44473618b7eafd33ba978db2f06">operations_research::sat::kNoIntegerVariable</a></div><div class="ttdeci">const IntegerVariable kNoIntegerVariable(-1)</div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_af73dd5cdec05a6bbd9fb677f45fac2be"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#af73dd5cdec05a6bbd9fb677f45fac2be">operations_research::sat::BranchDown</a></div><div class="ttdeci">LiteralIndex BranchDown(IntegerVariable var, IntegerValue value, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00037">integer_search.cc:37</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a55a7ac53a157135c072ad9d31bd47c38"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a55a7ac53a157135c072ad9d31bd47c38">operations_research::sat::SplitAroundLpValue</a></div><div class="ttdeci">LiteralIndex SplitAroundLpValue(IntegerVariable var, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00109">integer_search.cc:109</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1SearchHeuristics_html_a0d0b8f29f3557e2ee84f53b45d817e02"><div class="ttname"><a href="structoperations__research_1_1sat_1_1SearchHeuristics.html#a0d0b8f29f3557e2ee84f53b45d817e02">operations_research::sat::SearchHeuristics::restart_policies</a></div><div class="ttdeci">std::vector&lt; std::function&lt; bool()&gt; &gt; restart_policies</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00045">integer_search.h:45</a></div></div>
<div class="ttc" id="ademon__profiler_8cc_html_a21edc7ca4cc5802c8779d68556bc09cf"><div class="ttname"><a href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a></div><div class="ttdeci">int64 value</div><div class="ttdef"><b>Definition:</b> <a href="demon__profiler_8cc_source.html#l00043">demon_profiler.cc:43</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a8bea9a6a0de60c8fdab99ad7dfdf8498"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a8bea9a6a0de60c8fdab99ad7dfdf8498">operations_research::sat::SolveIntegerProblem</a></div><div class="ttdeci">SatSolver::Status SolveIntegerProblem(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00655">integer_search.cc:655</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a1aeef60fc8c9e76ebdd6ee5652e86ba9"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a1aeef60fc8c9e76ebdd6ee5652e86ba9">operations_research::sat::AtMinValue</a></div><div class="ttdeci">LiteralIndex AtMinValue(IntegerVariable var, IntegerTrail *integer_trail, IntegerEncoder *integer_encoder)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00055">integer_search.cc:55</a></div></div>
<div class="ttc" id="anamespaceoperations__research_html"><div class="ttname"><a href="namespaceoperations__research.html">operations_research</a></div><div class="ttdoc">The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...</div><div class="ttdef"><b>Definition:</b> <a href="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1SearchHeuristics_html_a4902aee8a3adc40ba39616dff46888b6"><div class="ttname"><a href="structoperations__research_1_1sat_1_1SearchHeuristics.html#a4902aee8a3adc40ba39616dff46888b6">operations_research::sat::SearchHeuristics::fixed_search</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; fixed_search</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00052">integer_search.h:52</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1LevelZeroCallbackHelper_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1LevelZeroCallbackHelper.html">operations_research::sat::LevelZeroCallbackHelper</a></div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00064">integer_search.h:64</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a37d0780b10099ec4c75b6a7e1651e0cf"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a37d0780b10099ec4c75b6a7e1651e0cf">operations_research::sat::FirstUnassignedVarAtItsMinHeuristic</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; FirstUnassignedVarAtItsMinHeuristic(const std::vector&lt; IntegerVariable &gt; &amp;vars, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00161">integer_search.cc:161</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1IntegerTrail_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntegerTrail.html">operations_research::sat::IntegerTrail</a></div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l00534">integer.h:534</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_ae56a0b3cb09b881015f12910fb0fb866"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#ae56a0b3cb09b881015f12910fb0fb866">operations_research::sat::CompleteHeuristics</a></div><div class="ttdeci">std::vector&lt; std::function&lt; LiteralIndex()&gt; &gt; CompleteHeuristics(const std::vector&lt; std::function&lt; LiteralIndex()&gt;&gt; &amp;incomplete_heuristics, const std::function&lt; LiteralIndex()&gt; &amp;completion_heuristic)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00643">integer_search.cc:643</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1LevelZeroCallbackHelper_html_ac008fdb20ed4a9c84c490d4cbff755ac"><div class="ttname"><a href="structoperations__research_1_1sat_1_1LevelZeroCallbackHelper.html#ac008fdb20ed4a9c84c490d4cbff755ac">operations_research::sat::LevelZeroCallbackHelper::callbacks</a></div><div class="ttdeci">std::vector&lt; std::function&lt; bool()&gt; &gt; callbacks</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00065">integer_search.h:65</a></div></div>
<div class="ttc" id="asat__solver_8h_html"><div class="ttname"><a href="sat__solver_8h.html">sat_solver.h</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1SearchHeuristics_html_af2155539e87804108c670c32478e123d"><div class="ttname"><a href="structoperations__research_1_1sat_1_1SearchHeuristics.html#af2155539e87804108c670c32478e123d">operations_research::sat::SearchHeuristics::policy_index</a></div><div class="ttdeci">int policy_index</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00048">integer_search.h:48</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1BooleanOrIntegerVariable_html_aa5d493d0ceaa64f8e71d9aa540db7d90"><div class="ttname"><a href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html#aa5d493d0ceaa64f8e71d9aa540db7d90">operations_research::sat::BooleanOrIntegerVariable::bool_var</a></div><div class="ttdeci">BooleanVariable bool_var</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00142">integer_search.h:142</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1Model_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Model.html">operations_research::sat::Model</a></div><div class="ttdoc">Class that owns everything related to a particular optimization model.</div><div class="ttdef"><b>Definition:</b> <a href="sat_2model_8h_source.html#l00038">sat/model.h:38</a></div></div>
<div class="ttc" id="asat__base_8h_html"><div class="ttname"><a href="sat__base_8h.html">sat_base.h</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_ae6b68e19d66776a0728fc418c3a1fa14"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#ae6b68e19d66776a0728fc418c3a1fa14">operations_research::sat::GreaterOrEqualToMiddleValue</a></div><div class="ttdeci">LiteralIndex GreaterOrEqualToMiddleValue(IntegerVariable var, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00067">integer_search.cc:67</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1SatSolver_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1SatSolver.html">operations_research::sat::SatSolver</a></div><div class="ttdef"><b>Definition:</b> <a href="sat__solver_8h_source.html#l00058">sat_solver.h:58</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a77b16f43c9fc18688bfda50a953cbce0"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a77b16f43c9fc18688bfda50a953cbce0">operations_research::sat::SplitDomainUsingBestSolutionValue</a></div><div class="ttdeci">LiteralIndex SplitDomainUsingBestSolutionValue(IntegerVariable var, Model *model)</div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a17b20b0845d9e02829d417294aded36a"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a17b20b0845d9e02829d417294aded36a">operations_research::sat::ResetAndSolveIntegerProblem</a></div><div class="ttdeci">SatSolver::Status ResetAndSolveIntegerProblem(const std::vector&lt; Literal &gt; &amp;assumptions, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00841">integer_search.cc:841</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1BooleanOrIntegerVariable_html_ae5143331fa20cd81b3339d4279826439"><div class="ttname"><a href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html#ae5143331fa20cd81b3339d4279826439">operations_research::sat::BooleanOrIntegerVariable::int_var</a></div><div class="ttdeci">IntegerVariable int_var</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00143">integer_search.h:143</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1IntegerEncoder_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntegerEncoder.html">operations_research::sat::IntegerEncoder</a></div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l00278">integer.h:278</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_aea96708896c3142cfb0d6c8dadd071fc"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#aea96708896c3142cfb0d6c8dadd071fc">operations_research::sat::BranchUp</a></div><div class="ttdeci">LiteralIndex BranchUp(IntegerVariable var, IntegerValue value, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00046">integer_search.cc:46</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a527a6ee26b7f573def70daf9b2a9e577"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a527a6ee26b7f573def70daf9b2a9e577">operations_research::sat::SatSolverRestartPolicy</a></div><div class="ttdeci">std::function&lt; bool()&gt; SatSolverRestartPolicy(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00528">integer_search.cc:528</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a411bdf3cd00369241403fc6c276b3d24"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a411bdf3cd00369241403fc6c276b3d24">operations_research::sat::AddModelHeuristics</a></div><div class="ttdeci">std::vector&lt; std::function&lt; LiteralIndex()&gt; &gt; AddModelHeuristics(const std::vector&lt; std::function&lt; LiteralIndex()&gt;&gt; &amp;input_heuristics, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00633">integer_search.cc:633</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_add67896a84f6372a648154c5770a0ae0"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#add67896a84f6372a648154c5770a0ae0">operations_research::sat::kNoBooleanVariable</a></div><div class="ttdeci">const BooleanVariable kNoBooleanVariable(-1)</div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1SatSolver_html_a67a0db04d321a74b7e7fcfd3f1a3f70b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1SatSolver.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">operations_research::sat::SatSolver::Status</a></div><div class="ttdeci">Status</div><div class="ttdef"><b>Definition:</b> <a href="sat__solver_8h_source.html#l00181">sat_solver.h:181</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a3da014a0d45b3fb4fd8f57a38eaabad8"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a3da014a0d45b3fb4fd8f57a38eaabad8">operations_research::sat::SequentialValueSelection</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; SequentialValueSelection(std::vector&lt; std::function&lt; LiteralIndex(IntegerVariable)&gt;&gt; value_selection_heuristics, std::function&lt; LiteralIndex()&gt; var_selection_heuristic, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00209">integer_search.cc:209</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1BooleanOrIntegerVariable_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1BooleanOrIntegerVariable.html">operations_research::sat::BooleanOrIntegerVariable</a></div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00141">integer_search.h:141</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a73bb705d68ce7ab22c3c0d0d1256db99"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a73bb705d68ce7ab22c3c0d0d1256db99">operations_research::sat::SequentialSearch</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; SequentialSearch(std::vector&lt; std::function&lt; LiteralIndex()&gt;&gt; heuristics)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00198">integer_search.cc:198</a></div></div>
<div class="ttc" id="agurobi__interface_8cc_html_a0728f23c9a47655d38e0bf1a2f200bcf"><div class="ttname"><a href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a></div><div class="ttdeci">GRBmodel * model</div><div class="ttdef"><b>Definition:</b> <a href="gurobi__interface_8cc_source.html#l00195">gurobi_interface.cc:195</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a8ee53722dd03d97d576732ad2722de72"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a8ee53722dd03d97d576732ad2722de72">operations_research::sat::PseudoCost</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; PseudoCost(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00325">integer_search.cc:325</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1SearchHeuristics_html_ae2d8f00a94944421f2f4e195eb5994c9"><div class="ttname"><a href="structoperations__research_1_1sat_1_1SearchHeuristics.html#ae2d8f00a94944421f2f4e195eb5994c9">operations_research::sat::SearchHeuristics::decision_policies</a></div><div class="ttdeci">std::vector&lt; std::function&lt; LiteralIndex()&gt; &gt; decision_policies</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00044">integer_search.h:44</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_aeaaccdd218e3f0aa5c218d3a0cc5c3f1"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#aeaaccdd218e3f0aa5c218d3a0cc5c3f1">operations_research::sat::LinearizedPartIsLarge</a></div><div class="ttdeci">bool LinearizedPartIsLarge(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00501">integer_search.cc:501</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_af7c6dddbeb211b4060454e9ef775acd7"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#af7c6dddbeb211b4060454e9ef775acd7">operations_research::sat::SatSolverHeuristic</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; SatSolverHeuristic(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00312">integer_search.cc:312</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a1565b56602e84a6362d53b11163aedbc"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a1565b56602e84a6362d53b11163aedbc">operations_research::sat::SplitAroundGivenValue</a></div><div class="ttdeci">LiteralIndex SplitAroundGivenValue(IntegerVariable positive_var, IntegerValue value, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00078">integer_search.cc:78</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a7ac1d9dc3254d77ade7bdbf984884b7e"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a7ac1d9dc3254d77ade7bdbf984884b7e">operations_research::sat::ConfigureSearchHeuristics</a></div><div class="ttdeci">void ConfigureSearchHeuristics(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00533">integer_search.cc:533</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_aae2d3b2f98c316d8644c349b79d1561f"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#aae2d3b2f98c316d8644c349b79d1561f">operations_research::sat::UnassignedVarWithLowestMinAtItsMinHeuristic</a></div><div class="ttdeci">std::function&lt; LiteralIndex()&gt; UnassignedVarWithLowestMinAtItsMinHeuristic(const std::vector&lt; IntegerVariable &gt; &amp;vars, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00177">integer_search.cc:177</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1SearchHeuristics_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1SearchHeuristics.html">operations_research::sat::SearchHeuristics</a></div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8h_source.html#l00040">integer_search.h:40</a></div></div>
<div class="ttc" id="ainteger_8h_html"><div class="ttname"><a href="integer_8h.html">integer.h</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a48d1aae59a778d6f39609f9add7cd0a5"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a48d1aae59a778d6f39609f9add7cd0a5">operations_research::sat::SolveIntegerProblemWithLazyEncoding</a></div><div class="ttdeci">SatSolver::Status SolveIntegerProblemWithLazyEncoding(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="integer__search_8cc_source.html#l00859">integer_search.cc:859</a></div></div>
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_a7cc1eeded8f693d0da6c729bc88c45a.html">ortools</a></li><li class="navelem"><a class="el" href="dir_dddac007a45022d9da6ea1dee012c3b9.html">sat</a></li><li class="navelem"><a class="el" href="integer__search_8h.html">integer_search.h</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.18 </li>
</ul>
</div>
</body>
</html>