<ahref="linear__programming__constraint_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Copyright 2010-2018 Google LLC</span></div>
<divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
<divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">// you may not use this file except in compliance with the License.</span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">// You may obtain a copy of the License at</span></div>
<divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
<divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment">// See the License for the specific language governing permissions and</span></div>
<divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment">// limitations under the License.</span></div>
<divclass="line"><aname="l00043"></a><spanclass="lineno"> 43</span> <spanclass="comment">// Stores for each IntegerVariable its temporary LP solution.</span></div>
<divclass="line"><aname="l00045"></a><spanclass="lineno"> 45</span> <spanclass="comment">// This is shared between all LinearProgrammingConstraint because in the corner</span></div>
<divclass="line"><aname="l00046"></a><spanclass="lineno"> 46</span> <spanclass="comment">// case where we have many different LinearProgrammingConstraint and a lot of</span></div>
<divclass="line"><aname="l00047"></a><spanclass="lineno"> 47</span> <spanclass="comment">// variable, we could theoretically use up a quadratic amount of memory</span></div>
<divclass="line"><aname="l00056"></a><spanclass="lineno"> 56</span> <spanclass="comment">// Helper struct to combine info generated from solving LP.</span></div>
<divclass="line"><aname="l00063"></a><spanclass="lineno"> 63</span> <spanclass="comment">// Simple class to combine linear expression efficiently. First in a sparse</span></div>
<divclass="line"><aname="l00064"></a><spanclass="lineno"> 64</span> <spanclass="comment">// way that switch to dense when the number of non-zeros grows.</span></div>
<divclass="line"><aname="l00067"></a><spanclass="lineno"> 67</span> <spanclass="comment">// This must be called with the correct size before any other functions are</span></div>
<divclass="line"><aname="l00071"></a><spanclass="lineno"> 71</span> <spanclass="comment">// Does vector[col] += value and return false in case of overflow.</span></div>
<divclass="line"><aname="l00074"></a><spanclass="lineno"> 74</span> <spanclass="comment">// Similar to Add() but for multiplier * terms.</span></div>
<divclass="line"><aname="l00075"></a><spanclass="lineno"> 75</span> <spanclass="comment">// Returns false in case of overflow.</span></div>
<divclass="line"><aname="l00080"></a><spanclass="lineno"> 80</span> <spanclass="comment">// This is not const only because non_zeros is sorted. Note that sorting the</span></div>
<divclass="line"><aname="l00081"></a><spanclass="lineno"> 81</span> <spanclass="comment">// non-zeros make the result deterministic whether or not we were in sparse</span></div>
<divclass="line"><aname="l00084"></a><spanclass="lineno"> 84</span> <spanclass="comment">// TODO(user): Ideally we should convert to IntegerVariable as late as</span></div>
<divclass="line"><aname="l00085"></a><spanclass="lineno"> 85</span> <spanclass="comment">// possible. Prefer to use GetTerms().</span></div>
<divclass="line"><aname="l00099"></a><spanclass="lineno"> 99</span> <spanclass="comment">// If is_sparse is true we maintain the non_zeros positions and bool vector</span></div>
<divclass="line"><aname="l00100"></a><spanclass="lineno"> 100</span> <spanclass="comment">// of dense_vector_. Otherwise we don't. Note that we automatically switch</span></div>
<divclass="line"><aname="l00101"></a><spanclass="lineno"> 101</span> <spanclass="comment">// from sparse to dense as needed.</span></div>
<divclass="line"><aname="l00110"></a><spanclass="lineno"> 110</span> <spanclass="comment">// A SAT constraint that enforces a set of linear inequality constraints on</span></div>
<divclass="line"><aname="l00111"></a><spanclass="lineno"> 111</span> <spanclass="comment">// integer variables using an LP solver.</span></div>
<divclass="line"><aname="l00113"></a><spanclass="lineno"> 113</span> <spanclass="comment">// The propagator uses glop's revised simplex for feasibility and propagation.</span></div>
<divclass="line"><aname="l00114"></a><spanclass="lineno"> 114</span> <spanclass="comment">// It uses the Reduced Cost Strengthening technique, a classic in mixed integer</span></div>
<divclass="line"><aname="l00115"></a><spanclass="lineno"> 115</span> <spanclass="comment">// programming, for instance see the thesis of Tobias Achterberg,</span></div>
<divclass="line"><aname="l00119"></a><spanclass="lineno"> 119</span> <spanclass="comment">// Per-constraint bounds propagation is NOT done by this constraint,</span></div>
<divclass="line"><aname="l00120"></a><spanclass="lineno"> 120</span> <spanclass="comment">// it should be done by redundant constraints, as reduced cost propagation</span></div>
<divclass="line"><aname="l00121"></a><spanclass="lineno"> 121</span> <spanclass="comment">// may miss some filtering.</span></div>
<divclass="line"><aname="l00123"></a><spanclass="lineno"> 123</span> <spanclass="comment">// Note that this constraint works with double floating-point numbers, so one</span></div>
<divclass="line"><aname="l00124"></a><spanclass="lineno"> 124</span> <spanclass="comment">// could be worried that it may filter too much in case of precision issues.</span></div>
<divclass="line"><aname="l00125"></a><spanclass="lineno"> 125</span> <spanclass="comment">// However, by default, we interpret the LP result by recomputing everything</span></div>
<divclass="line"><aname="l00126"></a><spanclass="lineno"> 126</span> <spanclass="comment">// in integer arithmetic, so we are exact.</span></div>
<divclass="line"><aname="l00139"></a><spanclass="lineno"> 139</span> <spanclass="comment">// Set the coefficient of the variable in the objective. Calling it twice will</span></div>
<divclass="line"><aname="l00140"></a><spanclass="lineno"> 140</span> <spanclass="comment">// overwrite the previous value.</span></div>
<divclass="line"><aname="l00143"></a><spanclass="lineno"> 143</span> <spanclass="comment">// The main objective variable should be equal to the linear sum of</span></div>
<divclass="line"><aname="l00144"></a><spanclass="lineno"> 144</span> <spanclass="comment">// the arguments passed to SetObjectiveCoefficient().</span></div>
<divclass="line"><aname="l00147"></a><spanclass="lineno"> 147</span> <spanclass="comment">// Register a new cut generator with this constraint.</span></div>
<divclass="line"><aname="l00150"></a><spanclass="lineno"> 150</span> <spanclass="comment">// Returns the LP value and reduced cost of a variable in the current</span></div>
<divclass="line"><aname="l00151"></a><spanclass="lineno"> 151</span> <spanclass="comment">// solution. These functions should only be called when HasSolution() is true.</span></div>
<divclass="line"><aname="l00153"></a><spanclass="lineno"> 153</span> <spanclass="comment">// Note that this solution is always an OPTIMAL solution of an LP above or</span></div>
<divclass="line"><aname="l00154"></a><spanclass="lineno"> 154</span> <spanclass="comment">// at the current decision level. We "erase" it when we backtrack over it.</span></div>
<divclass="line"><aname="l00175"></a><spanclass="lineno"> 175</span> <spanclass="comment">// Returns a IntegerLiteral guided by the underlying LP constraints.</span></div>
<divclass="line"><aname="l00177"></a><spanclass="lineno"> 177</span> <spanclass="comment">// This looks at all unassigned 0-1 variables, takes the one with</span></div>
<divclass="line"><aname="l00178"></a><spanclass="lineno"> 178</span> <spanclass="comment">// a support value closest to 0.5, and tries to assign it to 1.</span></div>
<divclass="line"><aname="l00179"></a><spanclass="lineno"> 179</span> <spanclass="comment">// If all 0-1 variables have an integer support, returns kNoLiteralIndex.</span></div>
<divclass="line"><aname="l00180"></a><spanclass="lineno"> 180</span> <spanclass="comment">// Tie-breaking is done using the variable natural order.</span></div>
<divclass="line"><aname="l00182"></a><spanclass="lineno"> 182</span> <spanclass="comment">// TODO(user): This fixes to 1, but for some problems fixing to 0</span></div>
<divclass="line"><aname="l00183"></a><spanclass="lineno"> 183</span> <spanclass="comment">// or to the std::round(support value) might work better. When this is the</span></div>
<divclass="line"><aname="l00187"></a><spanclass="lineno"> 187</span> <spanclass="comment">// Returns a IntegerLiteral guided by the underlying LP constraints.</span></div>
<divclass="line"><aname="l00189"></a><spanclass="lineno"> 189</span> <spanclass="comment">// This computes the mean of reduced costs over successive calls,</span></div>
<divclass="line"><aname="l00190"></a><spanclass="lineno"> 190</span> <spanclass="comment">// and tries to fix the variable which has the highest reduced cost.</span></div>
<divclass="line"><aname="l00191"></a><spanclass="lineno"> 191</span> <spanclass="comment">// Tie-breaking is done using the variable natural order.</span></div>
<divclass="line"><aname="l00192"></a><spanclass="lineno"> 192</span> <spanclass="comment">// Only works for 0/1 variables.</span></div>
<divclass="line"><aname="l00194"></a><spanclass="lineno"> 194</span> <spanclass="comment">// TODO(user): Try to get better pseudocosts than averaging every time</span></div>
<divclass="line"><aname="l00195"></a><spanclass="lineno"> 195</span> <spanclass="comment">// the heuristic is called. MIP solvers initialize this with strong branching,</span></div>
<divclass="line"><aname="l00196"></a><spanclass="lineno"> 196</span> <spanclass="comment">// then keep track of the pseudocosts when doing tree search. Also, this</span></div>
<divclass="line"><aname="l00197"></a><spanclass="lineno"> 197</span> <spanclass="comment">// version only branches on var >= 1 and keeps track of reduced costs from var</span></div>
<divclass="line"><aname="l00198"></a><spanclass="lineno"> 198</span> <spanclass="comment">// = 1 to var = 0. This works better than the conventional MIP where the</span></div>
<divclass="line"><aname="l00199"></a><spanclass="lineno"> 199</span> <spanclass="comment">// chosen variable will be argmax_var min(pseudocost_var(0->1),</span></div>
<divclass="line"><aname="l00200"></a><spanclass="lineno"> 200</span> <spanclass="comment">// pseudocost_var(1->0)), probably because we are doing DFS search where MIP</span></div>
<divclass="line"><aname="l00201"></a><spanclass="lineno"> 201</span> <spanclass="comment">// does BFS. This might depend on the model, more trials are necessary. We</span></div>
<divclass="line"><aname="l00202"></a><spanclass="lineno"> 202</span> <spanclass="comment">// could also do exponential smoothing instead of decaying every N calls, i.e.</span></div>
<divclass="line"><aname="l00203"></a><spanclass="lineno"> 203</span> <spanclass="comment">// pseudo = a * pseudo + (1-a) reduced.</span></div>
<divclass="line"><aname="l00206"></a><spanclass="lineno"> 206</span> <spanclass="comment">// Returns a IntegerLiteral guided by the underlying LP constraints.</span></div>
<divclass="line"><aname="l00208"></a><spanclass="lineno"> 208</span> <spanclass="comment">// This computes the mean of reduced costs over successive calls,</span></div>
<divclass="line"><aname="l00209"></a><spanclass="lineno"> 209</span> <spanclass="comment">// and tries to fix the variable which has the highest reduced cost.</span></div>
<divclass="line"><aname="l00210"></a><spanclass="lineno"> 210</span> <spanclass="comment">// Tie-breaking is done using the variable natural order.</span></div>
<divclass="line"><aname="l00213"></a><spanclass="lineno"> 213</span> <spanclass="comment">// Average number of nonbasic variables with zero reduced costs.</span></div>
<divclass="line"><aname="l00223"></a><spanclass="lineno"> 223</span> <spanclass="comment">// Helper methods for branching. Returns true if branching on the given</span></div>
<divclass="line"><aname="l00224"></a><spanclass="lineno"> 224</span> <spanclass="comment">// variable helps with more propagation or finds a conflict.</span></div>
<divclass="line"><aname="l00228"></a><spanclass="lineno"> 228</span> <spanclass="comment">// Helper method to fill reduced cost / dual ray reason in 'integer_reason'.</span></div>
<divclass="line"><aname="l00229"></a><spanclass="lineno"> 229</span> <spanclass="comment">// Generates a set of IntegerLiterals explaining why the best solution can not</span></div>
<divclass="line"><aname="l00230"></a><spanclass="lineno"> 230</span> <spanclass="comment">// be improved using reduced costs. This is used to generate explanations for</span></div>
<divclass="line"><aname="l00231"></a><spanclass="lineno"> 231</span> <spanclass="comment">// both infeasibility and bounds deductions.</span></div>
<divclass="line"><aname="l00235"></a><spanclass="lineno"> 235</span> <spanclass="comment">// Reinitialize the LP from a potentially new set of constraints.</span></div>
<divclass="line"><aname="l00236"></a><spanclass="lineno"> 236</span> <spanclass="comment">// This fills all data structure and properly rescale the underlying LP.</span></div>
<divclass="line"><aname="l00238"></a><spanclass="lineno"> 238</span> <spanclass="comment">// Returns false if the problem is UNSAT (it can happen when presolve is off</span></div>
<divclass="line"><aname="l00239"></a><spanclass="lineno"> 239</span> <spanclass="comment">// and some LP constraint are trivially false).</span></div>
<divclass="line"><aname="l00242"></a><spanclass="lineno"> 242</span> <spanclass="comment">// Solve the LP, returns false if something went wrong in the LP solver.</span></div>
<divclass="line"><aname="l00245"></a><spanclass="lineno"> 245</span> <spanclass="comment">// Add a "MIR" cut obtained by first taking the linear combination of the</span></div>
<divclass="line"><aname="l00246"></a><spanclass="lineno"> 246</span> <spanclass="comment">// row of the matrix according to "integer_multipliers" and then trying</span></div>
<divclass="line"><aname="l00247"></a><spanclass="lineno"> 247</span> <spanclass="comment">// some integer rounding heuristic.</span></div>
<divclass="line"><aname="l00249"></a><spanclass="lineno"> 249</span> <spanclass="comment">// Return true if a new cut was added to the cut manager.</span></div>
<divclass="line"><aname="l00262"></a><spanclass="lineno"> 262</span> <spanclass="comment">// Computes and adds the corresponding type of cuts.</span></div>
<divclass="line"><aname="l00263"></a><spanclass="lineno"> 263</span> <spanclass="comment">// This can currently only be called at the root node.</span></div>
<divclass="line"><aname="l00268"></a><spanclass="lineno"> 268</span> <spanclass="comment">// Updates the bounds of the LP variables from the CP bounds.</span></div>
<divclass="line"><aname="l00271"></a><spanclass="lineno"> 271</span> <spanclass="comment">// Use the dual optimal lp values to compute an EXACT lower bound on the</span></div>
<divclass="line"><aname="l00272"></a><spanclass="lineno"> 272</span> <spanclass="comment">// objective. Fills its reason and perform reduced cost strenghtening.</span></div>
<divclass="line"><aname="l00273"></a><spanclass="lineno"> 273</span> <spanclass="comment">// Returns false in case of conflict.</span></div>
<divclass="line"><aname="l00276"></a><spanclass="lineno"> 276</span> <spanclass="comment">// Same as FillDualRayReason() but perform the computation EXACTLY. Returns</span></div>
<divclass="line"><aname="l00277"></a><spanclass="lineno"> 277</span> <spanclass="comment">// false in the case that the problem is not provably infeasible with exact</span></div>
<divclass="line"><aname="l00281"></a><spanclass="lineno"> 281</span> <spanclass="comment">// Returns number of non basic variables with zero reduced costs.</span></div>
<divclass="line"><aname="l00284"></a><spanclass="lineno"> 284</span> <spanclass="comment">// From a set of row multipliers (at LP scale), scale them back to the CP</span></div>
<divclass="line"><aname="l00285"></a><spanclass="lineno"> 285</span> <spanclass="comment">// world and then make them integer (eventually multiplying them by a new</span></div>
<divclass="line"><aname="l00286"></a><spanclass="lineno"> 286</span> <spanclass="comment">// scaling factor returned in *scaling).</span></div>
<divclass="line"><aname="l00288"></a><spanclass="lineno"> 288</span> <spanclass="comment">// Note that this will loose some precision, but our subsequent computation</span></div>
<divclass="line"><aname="l00289"></a><spanclass="lineno"> 289</span> <spanclass="comment">// will still be exact as it will work for any set of multiplier.</span></div>
<divclass="line"><aname="l00295"></a><spanclass="lineno"> 295</span> <spanclass="comment">// Computes from an integer linear combination of the integer rows of the LP a</span></div>
<divclass="line"><aname="l00296"></a><spanclass="lineno"> 296</span> <spanclass="comment">// new constraint of the form "sum terms <= upper_bound". All computation are</span></div>
<divclass="line"><aname="l00299"></a><spanclass="lineno"> 299</span> <spanclass="comment">// Returns false if we encountered any integer overflow.</span></div>
<divclass="line"><aname="l00306"></a><spanclass="lineno"> 306</span> <spanclass="comment">// Simple heuristic to try to minimize |upper_bound - ImpliedLB(terms)|. This</span></div>
<divclass="line"><aname="l00307"></a><spanclass="lineno"> 307</span> <spanclass="comment">// should make the new constraint tighter and correct a bit the imprecision</span></div>
<divclass="line"><aname="l00308"></a><spanclass="lineno"> 308</span> <spanclass="comment">// introduced by rounding the floating points values.</span></div>
<divclass="line"><aname="l00314"></a><spanclass="lineno"> 314</span> <spanclass="comment">// Shortcut for an integer linear expression type.</span></div>
<divclass="line"><aname="l00317"></a><spanclass="lineno"> 317</span> <spanclass="comment">// Converts a dense represenation of a linear constraint to a sparse one</span></div>
<divclass="line"><aname="l00318"></a><spanclass="lineno"> 318</span> <spanclass="comment">// expressed in terms of IntegerVariable.</span></div>
<divclass="line"><aname="l00323"></a><spanclass="lineno"> 323</span> <spanclass="comment">// Compute the implied lower bound of the given linear expression using the</span></div>
<divclass="line"><aname="l00324"></a><spanclass="lineno"> 324</span> <spanclass="comment">// current variable bound. Return kMinIntegerValue in case of overflow.</span></div>
<divclass="line"><aname="l00327"></a><spanclass="lineno"> 327</span> <spanclass="comment">// Tests for possible overflow in the propagation of the given linear</span></div>
<divclass="line"><aname="l00331"></a><spanclass="lineno"> 331</span> <spanclass="comment">// Reduce the coefficient of the constraint so that we cannot have overflow</span></div>
<divclass="line"><aname="l00332"></a><spanclass="lineno"> 332</span> <spanclass="comment">// in the propagation of the given linear constraint. Note that we may loose</span></div>
<divclass="line"><aname="l00333"></a><spanclass="lineno"> 333</span> <spanclass="comment">// some strength by doing so.</span></div>
<divclass="line"><aname="l00335"></a><spanclass="lineno"> 335</span> <spanclass="comment">// We make sure that any partial sum involving any variable value in their</span></div>
<divclass="line"><aname="l00336"></a><spanclass="lineno"> 336</span> <spanclass="comment">// domain do not exceed 2 ^ max_pow.</span></div>
<divclass="line"><aname="l00339"></a><spanclass="lineno"> 339</span> <spanclass="comment">// Fills integer_reason_ with the reason for the implied lower bound of the</span></div>
<divclass="line"><aname="l00340"></a><spanclass="lineno"> 340</span> <spanclass="comment">// given linear expression. We relax the reason if we have some slack.</span></div>
<divclass="line"><aname="l00344"></a><spanclass="lineno"> 344</span> <spanclass="comment">// Fills the deductions vector with reduced cost deductions that can be made</span></div>
<divclass="line"><aname="l00345"></a><spanclass="lineno"> 345</span> <spanclass="comment">// from the current state of the LP solver. The given delta should be the</span></div>
<divclass="line"><aname="l00346"></a><spanclass="lineno"> 346</span> <spanclass="comment">// difference between the cp objective upper bound and lower bound given by</span></div>
<divclass="line"><aname="l00347"></a><spanclass="lineno"> 347</span> <spanclass="comment">// the lp.</span></div>
<divclass="line"><aname="l00350"></a><spanclass="lineno"> 350</span> <spanclass="comment">// Returns the variable value on the same scale as the CP variable value.</span></div>
<divclass="line"><aname="l00353"></a><spanclass="lineno"> 353</span> <spanclass="comment">// Gets or creates an LP variable that mirrors a CP variable.</span></div>
<divclass="line"><aname="l00354"></a><spanclass="lineno"> 354</span> <spanclass="comment">// The variable should be a positive reference.</span></div>
<divclass="line"><aname="l00357"></a><spanclass="lineno"> 357</span> <spanclass="comment">// This must be called on an OPTIMAL LP and will update the data for</span></div>
<divclass="line"><aname="l00364"></a><spanclass="lineno"> 364</span> <spanclass="comment">// Updates the simplex iteration limit for the next visit.</span></div>
<divclass="line"><aname="l00365"></a><spanclass="lineno"> 365</span> <spanclass="comment">// As per current algorithm, we use a limit which is dependent on size of the</span></div>
<divclass="line"><aname="l00366"></a><spanclass="lineno"> 366</span> <spanclass="comment">// problem and drop it significantly if degeneracy is detected. We use</span></div>
<divclass="line"><aname="l00367"></a><spanclass="lineno"> 367</span> <spanclass="comment">// DUAL_FEASIBLE status as a signal to correct the prediction. The next limit</span></div>
<divclass="line"><aname="l00368"></a><spanclass="lineno"> 368</span> <spanclass="comment">// is capped by 'min_iter' and 'max_iter'. Note that this is enabled only for</span></div>
<divclass="line"><aname="l00369"></a><spanclass="lineno"> 369</span> <spanclass="comment">// linearization level 2 and above.</span></div>
<divclass="line"><aname="l00372"></a><spanclass="lineno"> 372</span> <spanclass="comment">// This epsilon is related to the precision of the value/reduced_cost returned</span></div>
<divclass="line"><aname="l00373"></a><spanclass="lineno"> 373</span> <spanclass="comment">// by the LP once they have been scaled back into the CP domain. So for large</span></div>
<divclass="line"><aname="l00374"></a><spanclass="lineno"> 374</span> <spanclass="comment">// domain or cost coefficient, we may have some issues.</span></div>
<divclass="line"><aname="l00380"></a><spanclass="lineno"> 380</span> <spanclass="comment">// Anything coming from the LP with a magnitude below that will be assumed to</span></div>
<divclass="line"><aname="l00381"></a><spanclass="lineno"> 381</span> <spanclass="comment">// be zero.</span></div>
<divclass="line"><aname="l00384"></a><spanclass="lineno"> 384</span> <spanclass="comment">// Class responsible for managing all possible constraints that may be part</span></div>
<divclass="line"><aname="l00385"></a><spanclass="lineno"> 385</span> <spanclass="comment">// of the LP.</span></div>
<divclass="line"><aname="l00388"></a><spanclass="lineno"> 388</span> <spanclass="comment">// Initial problem in integer form.</span></div>
<divclass="line"><aname="l00389"></a><spanclass="lineno"> 389</span> <spanclass="comment">// We always sort the inner vectors by increasing glop::ColIndex.</span></div>
<divclass="line"><aname="l00426"></a><spanclass="lineno"> 426</span> <spanclass="comment">// Structures used for mirroring IntegerVariables inside the underlying LP</span></div>
<divclass="line"><aname="l00427"></a><spanclass="lineno"> 427</span> <spanclass="comment">// solver: an integer variable var is mirrored by mirror_lp_variable_[var].</span></div>
<divclass="line"><aname="l00428"></a><spanclass="lineno"> 428</span> <spanclass="comment">// Note that these indices are dense in [0, mirror_lp_variable_.size()] so</span></div>
<divclass="line"><aname="l00429"></a><spanclass="lineno"> 429</span> <spanclass="comment">// they can be used as vector indices.</span></div>
<divclass="line"><aname="l00431"></a><spanclass="lineno"> 431</span> <spanclass="comment">// TODO(user): This should be absl::StrongVector<glop::ColIndex,</span></div>
<divclass="line"><aname="l00436"></a><spanclass="lineno"> 436</span> <spanclass="comment">// We need to remember what to optimize if an objective is given, because</span></div>
<divclass="line"><aname="l00437"></a><spanclass="lineno"> 437</span> <spanclass="comment">// then we will switch the objective between feasibility and optimization.</span></div>
<divclass="line"><aname="l00453"></a><spanclass="lineno"> 453</span> <spanclass="comment">// The dispatcher for all LP propagators of the model, allows to find which</span></div>
<divclass="line"><aname="l00454"></a><spanclass="lineno"> 454</span> <spanclass="comment">// LinearProgrammingConstraint has a given IntegerVariable.</span></div>
<divclass="line"><aname="l00461"></a><spanclass="lineno"> 461</span> <spanclass="comment">// Repository of IntegerSumLE that needs to be kept around for the lazy</span></div>
<divclass="line"><aname="l00462"></a><spanclass="lineno"> 462</span> <spanclass="comment">// reasons. Those are new integer constraint that are created each time we</span></div>
<divclass="line"><aname="l00463"></a><spanclass="lineno"> 463</span> <spanclass="comment">// solve the LP to a dual-feasible solution. Propagating these constraints</span></div>
<divclass="line"><aname="l00464"></a><spanclass="lineno"> 464</span> <spanclass="comment">// both improve the objective lower bound but also perform reduced cost</span></div>
<divclass="line"><aname="l00469"></a><spanclass="lineno"> 469</span> <spanclass="comment">// Last OPTIMAL solution found by a call to the underlying LP solver.</span></div>
<divclass="line"><aname="l00470"></a><spanclass="lineno"> 470</span> <spanclass="comment">// On IncrementalPropagate(), if the bound updates do not invalidate this</span></div>
<divclass="line"><aname="l00471"></a><spanclass="lineno"> 471</span> <spanclass="comment">// solution, Propagate() will not find domain reductions, no need to call it.</span></div>
<divclass="line"><aname="l00479"></a><spanclass="lineno"> 479</span> <spanclass="comment">// If non-empty, this is the last known optimal lp solution at root-node. If</span></div>
<divclass="line"><aname="l00480"></a><spanclass="lineno"> 480</span> <spanclass="comment">// the variable bounds changed, or cuts where added, it is possible that this</span></div>
<divclass="line"><aname="l00481"></a><spanclass="lineno"> 481</span> <spanclass="comment">// solution is no longer optimal though.</span></div>
<divclass="line"><aname="l00484"></a><spanclass="lineno"> 484</span> <spanclass="comment">// True if the last time we solved the exact same LP at level zero, no cuts</span></div>
<divclass="line"><aname="l00485"></a><spanclass="lineno"> 485</span> <spanclass="comment">// and no lazy constraints where added.</span></div>
<divclass="line"><aname="l00488"></a><spanclass="lineno"> 488</span> <spanclass="comment">// Same as lp_solution_ but this vector is indexed differently.</span></div>
<divclass="line"><aname="l00491"></a><spanclass="lineno"> 491</span> <spanclass="comment">// Linear constraints cannot be created or modified after this is registered.</span></div>
<divclass="line"><aname="l00496"></a><spanclass="lineno"> 496</span> <spanclass="comment">// Store some statistics for HeuristicLPReducedCostAverage().</span></div>
<divclass="line"><aname="l00505"></a><spanclass="lineno"> 505</span> <spanclass="comment">// All the entries before rev_rc_start_ in the sorted positions correspond</span></div>
<divclass="line"><aname="l00506"></a><spanclass="lineno"> 506</span> <spanclass="comment">// to fixed variables and can be ignored.</span></div>
<divclass="line"><aname="l00511"></a><spanclass="lineno"> 511</span> <spanclass="comment">// Defined as average number of nonbasic variables with zero reduced costs.</span></div>
<divclass="line"><aname="l00519"></a><spanclass="lineno"> 519</span> <spanclass="comment">// Sum of all simplex iterations performed by this class. This is useful to</span></div>
<divclass="line"><aname="l00520"></a><spanclass="lineno"> 520</span> <spanclass="comment">// test the incrementality and compare to other solvers.</span></div>
<divclass="line"><aname="l00523"></a><spanclass="lineno"> 523</span> <spanclass="comment">// Some stats on the LP statuses encountered.</span></div>
<divclass="line"><aname="l00527"></a><spanclass="lineno"> 527</span> <spanclass="comment">// A class that stores which LP propagator is associated to each variable.</span></div>
<divclass="line"><aname="l00528"></a><spanclass="lineno"> 528</span> <spanclass="comment">// We need to give the hash_map a name so it can be used as a singleton in our</span></div>
<divclass="line"><aname="l00531"></a><spanclass="lineno"> 531</span> <spanclass="comment">// Important: only positive variable do appear here.</span></div>
<divclass="line"><aname="l00539"></a><spanclass="lineno"> 539</span> <spanclass="comment">// A class that stores the collection of all LP constraints in a model.</span></div>
<divclass="line"><aname="l00546"></a><spanclass="lineno"> 546</span> <spanclass="comment">// Cut generator for the circuit constraint, where in any feasible solution, the</span></div>
<divclass="line"><aname="l00547"></a><spanclass="lineno"> 547</span> <spanclass="comment">// arcs that are present (variable at 1) must form a circuit through all the</span></div>
<divclass="line"><aname="l00548"></a><spanclass="lineno"> 548</span> <spanclass="comment">// nodes of the graph. Self arc are forbidden in this case.</span></div>
<divclass="line"><aname="l00550"></a><spanclass="lineno"> 550</span> <spanclass="comment">// In more generality, this currently enforce the resulting graph to be strongly</span></div>
<divclass="line"><aname="l00551"></a><spanclass="lineno"> 551</span> <spanclass="comment">// connected. Note that we already assume basic constraint to be in the lp, so</span></div>
<divclass="line"><aname="l00552"></a><spanclass="lineno"> 552</span> <spanclass="comment">// we do not add any cuts for components of size 1.</span></div>
<divclass="line"><aname="l00557"></a><spanclass="lineno"> 557</span> <spanclass="comment">// Almost the same as CreateStronglyConnectedGraphCutGenerator() but for each</span></div>
<divclass="line"><aname="l00558"></a><spanclass="lineno"> 558</span> <spanclass="comment">// components, computes the demand needed to serves it, and depending on whether</span></div>
<divclass="line"><aname="l00559"></a><spanclass="lineno"> 559</span> <spanclass="comment">// it contains the depot (node zero) or not, compute the minimum number of</span></div>
<divclass="line"><aname="l00560"></a><spanclass="lineno"> 560</span> <spanclass="comment">// vehicle that needs to cross the component border.</span></div>
<divclass="ttc"id="aclassoperations__research_1_1_rev_repository_html"><divclass="ttname"><ahref="classoperations__research_1_1_rev_repository.html">operations_research::RevRepository< int ></a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1_time_limit_html"><divclass="ttname"><ahref="classoperations__research_1_1_time_limit.html">operations_research::TimeLimit</a></div><divclass="ttdoc">A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...</div><divclass="ttdef"><b>Definition:</b><ahref="time__limit_8h_source.html#l00105">time_limit.h:105</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1sat_1_1_model_html"><divclass="ttname"><ahref="classoperations__research_1_1sat_1_1_model.html">operations_research::sat::Model</a></div><divclass="ttdoc">Class that owns everything related to a particular optimization model.</div><divclass="ttdef"><b>Definition:</b><ahref="sat_2model_8h_source.html#l00038">sat/model.h:38</a></div></div>
<divclass="ttc"id="anamespaceoperations__research_1_1sat_html_a83551f805175c3a30ea146efaad2ec63"><divclass="ttname"><ahref="namespaceoperations__research_1_1sat.html#a83551f805175c3a30ea146efaad2ec63">operations_research::sat::CreateCVRPCutGenerator</a></div><divclass="ttdeci">CutGenerator CreateCVRPCutGenerator(int num_nodes, const std::vector< int >&tails, const std::vector< int >&heads, const std::vector< Literal >&literals, const std::vector< int64 >&demands, int64 capacity, Model *model)</div><divclass="ttdef"><b>Definition:</b><ahref="linear__programming__constraint_8cc_source.html#l02557">linear_programming_constraint.cc:2557</a></div></div>
<divclass="ttc"id="anamespaceoperations__research_1_1sat_html_ae9e5d88686fd52d3bd1a89d7754ca18c"><divclass="ttname"><ahref="namespaceoperations__research_1_1sat.html#ae9e5d88686fd52d3bd1a89d7754ca18c">operations_research::sat::CreateStronglyConnectedGraphCutGenerator</a></div><divclass="ttdeci">CutGenerator CreateStronglyConnectedGraphCutGenerator(int num_nodes, const std::vector< int >&tails, const std::vector< int >&heads, const std::vector< Literal >&literals, Model *model)</div><divclass="ttdef"><b>Definition:</b><ahref="linear__programming__constraint_8cc_source.html#l02541">linear_programming_constraint.cc:2541</a></div></div>
<divclass="ttc"id="anamespaceoperations__research_html"><divclass="ttname"><ahref="namespaceoperations__research.html">operations_research</a></div><divclass="ttdoc">The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...</div><divclass="ttdef"><b>Definition:</b><ahref="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>