C++ Reference: class KnapsackSearchPathForCuts

This documentation is automatically generated.


   ----- KnapsackSearchPathForCuts -----
KnapsackSearchPathForCuts is a small class used to represent the path between a node to another node in the search tree. 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).

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'.

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'.
Method
from

Return type: const KnapsackSearchNodeForCuts&

Init

Return type: void

KnapsackSearchPathForCuts

Arguments: const KnapsackSearchNodeForCuts* from, const KnapsackSearchNodeForCuts* to

KnapsackSearchPathForCuts

Arguments: const KnapsackSearchPathForCuts&) = delete; KnapsackSearchPathForCuts& operator=(const KnapsackSearchPathForCuts&) = delete; void Init(

to

Return type: const KnapsackSearchNodeForCuts&

via

Return type: const KnapsackSearchNodeForCuts&