Files
ortools-clone/docs/cpp_algorithms/classoperations__research_1_1KnapsackSearchPath.html
2019-06-29 18:18:08 +02:00

246 lines
14 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OR-Tools</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="ortools.css" title="default" media="screen,print" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">OR-Tools 7.2</span>
</div>
</div>
<link rel="icon" href="https://developers.google.com/optimization/images/orLogo.png">
<div id="content">
<!-- Generated by Doxygen 1.8.15 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceoperations__research.html">operations_research</a></li><li class="navelem"><a class="el" href="classoperations__research_1_1KnapsackSearchPath.html">KnapsackSearchPath</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classoperations__research_1_1KnapsackSearchPath-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">operations_research::KnapsackSearchPath Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>--&mdash; <a class="el" href="classoperations__research_1_1KnapsackSearchPath.html" title="--— KnapsackSearchPath --— KnapsackSearchPath is a small class used to represent the path between a n...">KnapsackSearchPath</a> --&mdash; <a class="el" href="classoperations__research_1_1KnapsackSearchPath.html" title="--— KnapsackSearchPath --— KnapsackSearchPath is a small class used to represent the path between a n...">KnapsackSearchPath</a> is a small class used to represent the path between a node to another node in the search tree.
<a href="classoperations__research_1_1KnapsackSearchPath.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="knapsack__solver_8h_source.html">knapsack_solver.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a459653bd55ab09a55714f660419367b1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1KnapsackSearchPath.html#a459653bd55ab09a55714f660419367b1">KnapsackSearchPath</a> (const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;<a class="el" href="classoperations__research_1_1KnapsackSearchPath.html#abfbc25d180ab655ca72aa1dda80b5e1b">from</a>, const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;<a class="el" href="classoperations__research_1_1KnapsackSearchPath.html#a070dcd6139b7a475886f061cefb7fd78">to</a>)</td></tr>
<tr class="separator:a459653bd55ab09a55714f660419367b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91d3f4f27442d3ee1f748811d5d0d964"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1KnapsackSearchPath.html#a91d3f4f27442d3ee1f748811d5d0d964">Init</a> ()</td></tr>
<tr class="separator:a91d3f4f27442d3ee1f748811d5d0d964"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfbc25d180ab655ca72aa1dda80b5e1b"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1KnapsackSearchPath.html#abfbc25d180ab655ca72aa1dda80b5e1b">from</a> () const</td></tr>
<tr class="separator:abfbc25d180ab655ca72aa1dda80b5e1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afede2909f269364002ffe722f4bed1b2"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1KnapsackSearchPath.html#afede2909f269364002ffe722f4bed1b2">via</a> () const</td></tr>
<tr class="separator:afede2909f269364002ffe722f4bed1b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a070dcd6139b7a475886f061cefb7fd78"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1KnapsackSearchPath.html#a070dcd6139b7a475886f061cefb7fd78">to</a> () const</td></tr>
<tr class="separator:a070dcd6139b7a475886f061cefb7fd78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c129707bd16aea17d0eb3ad6c4e10e5"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1KnapsackSearchPath.html#a3c129707bd16aea17d0eb3ad6c4e10e5">MoveUpToDepth</a> (const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;node, int depth) const</td></tr>
<tr class="separator:a3c129707bd16aea17d0eb3ad6c4e10e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>--&mdash; <a class="el" href="classoperations__research_1_1KnapsackSearchPath.html" title="--— KnapsackSearchPath --— KnapsackSearchPath is a small class used to represent the path between a n...">KnapsackSearchPath</a> --&mdash; <a class="el" href="classoperations__research_1_1KnapsackSearchPath.html" title="--— KnapsackSearchPath --— KnapsackSearchPath is a small class used to represent the path between a n...">KnapsackSearchPath</a> is a small class used to represent the path between a node to another node in the search tree. </p>
<p>As the solution state is not stored for each search node, the state should be rebuilt at each node. One simple solution is to apply all decisions between the node 'to' and the root. This can be computed in O(number_of_items).</p>
<p>However, it is possible to achieve better average complexity. Two consecutively explored nodes are usually close enough (i.e., much less than number_of_items) to benefit from an incremental update from the node 'from' to the node 'to'.</p>
<p>The 'via' field is the common parent of 'from' field and 'to' field. So the state can be built by reverting all decisions from 'from' to 'via' and then applying all decisions from 'via' to 'to'. </p>
<p class="definition">Definition at line <a class="el" href="knapsack__solver_8h_source.html#l00313">313</a> of file <a class="el" href="knapsack__solver_8h_source.html">knapsack_solver.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a459653bd55ab09a55714f660419367b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a459653bd55ab09a55714f660419367b1">&#9670;&nbsp;</a></span>KnapsackSearchPath()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">operations_research::KnapsackSearchPath::KnapsackSearchPath </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;&#160;</td>
<td class="paramname"><em>from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;&#160;</td>
<td class="paramname"><em>to</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="abfbc25d180ab655ca72aa1dda80b5e1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abfbc25d180ab655ca72aa1dda80b5e1b">&#9670;&nbsp;</a></span>from()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a>&amp; operations_research::KnapsackSearchPath::from </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="knapsack__solver_8h_source.html#l00318">318</a> of file <a class="el" href="knapsack__solver_8h_source.html">knapsack_solver.h</a>.</p>
</div>
</div>
<a id="a91d3f4f27442d3ee1f748811d5d0d964"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a91d3f4f27442d3ee1f748811d5d0d964">&#9670;&nbsp;</a></span>Init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void operations_research::KnapsackSearchPath::Init </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a3c129707bd16aea17d0eb3ad6c4e10e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c129707bd16aea17d0eb3ad6c4e10e5">&#9670;&nbsp;</a></span>MoveUpToDepth()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a>* operations_research::KnapsackSearchPath::MoveUpToDepth </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a> &amp;&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>depth</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a070dcd6139b7a475886f061cefb7fd78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a070dcd6139b7a475886f061cefb7fd78">&#9670;&nbsp;</a></span>to()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a>&amp; operations_research::KnapsackSearchPath::to </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="knapsack__solver_8h_source.html#l00320">320</a> of file <a class="el" href="knapsack__solver_8h_source.html">knapsack_solver.h</a>.</p>
</div>
</div>
<a id="afede2909f269364002ffe722f4bed1b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afede2909f269364002ffe722f4bed1b2">&#9670;&nbsp;</a></span>via()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classoperations__research_1_1KnapsackSearchNode.html">KnapsackSearchNode</a>&amp; operations_research::KnapsackSearchPath::via </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="knapsack__solver_8h_source.html#l00319">319</a> of file <a class="el" href="knapsack__solver_8h_source.html">knapsack_solver.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="knapsack__solver_8h_source.html">knapsack_solver.h</a></li>
</ul>
</div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
</div>
</div>
</body>
</html>