Camargue
Public Types | Public Member Functions | Public Attributes | List of all members
CMR::ABC::BranchNode Struct Reference
Collaboration diagram for CMR::ABC::BranchNode:
Collaboration graph
[legend]

Public Types

enum  Dir : int { Down = 0, Up = 1 }
 
enum  Status {
  NeedsCut, NeedsBranch, NeedsPrice, NeedsRecover,
  Pruned, Done
}
 
using Split = std::array< BranchNode, 2 >
 Alias declaration for returning two split child problems.
 

Public Member Functions

 BranchNode ()
 Construct a root node.
 
 BranchNode (EndPts ends_, Dir direction_, const BranchNode &parent_, double tourlen_, double estimate_)
 Construct a child node.
 
 BranchNode (BranchNode &&B) noexcept
 
BranchNodeoperator= (BranchNode &&B) noexcept
 
bool is_root () const
 Is this the root problem.
 
bool visited () const
 Has the problem been processed.
 

Public Attributes

EndPts ends
 The endpoints of the branch edge.
 
Dir direction
 Down branch or up branch.
 
Status stat
 The type of processing required by the node.
 
const BranchNodeparent
 
int depth
 Search tree depth of this node.
 
double tourlen
 Estimated best tour length for this node.
 
LP::Basis::Ptr price_basis
 A starting basis for if Status is NeedsPrice or NeedsRecover.
 
double estimate
 The objective value estimate from edge selection.
 

Node selection comparators.

These functions can be used to rank BranchNode objects so as to implement a node selection rule.

See also
abc_nodesel.hpp for the rules currently implemented.
Warning
Other than depth-first search, node selection rules will be implemented using std::make_heap, std::push_heap, std::pop_heap, etc., from the C++ STL. Such heaps are max heaps by default, and node selection rules usually demand min heaps (e.g., shortest tour, lowest strong branch bound). Thus, these functions must implement a comparator where preferred nodes are greater. For example if $ F $ is a comparator and $ A, B $ are two unvisited nodes where $ A $ has a shorter tour than $ B $, then $ F(A, B) $ should return false.
Remarks
Implementations should use std::tie to implement lexicographic ordering to break ties first based on depth, and then based on an estimate not being used.
using Pref = decltype(&tour_worse)
 
static bool tour_worse (const std::list< BranchNode >::iterator &A, const std::list< BranchNode >::iterator &B)
 Returns true if A has a worse tour than B. More...
 
static bool bound_worse (const std::list< BranchNode >::iterator &A, const std::list< BranchNode >::iterator &B)
 Returns true if A has a worse (higher) SB estimate than B. More...
 

Member Function Documentation

bool CMR::ABC::BranchNode::bound_worse ( const std::list< BranchNode >::iterator &  A,
const std::list< BranchNode >::iterator &  B 
)
static

Returns true if A has a worse (higher) SB estimate than B.

Comparator where A is worse than B if A is estimated to have a higher objective value lower bound.

Ties are broken by depth and estimated tour length, in that order.

Remarks
the depth of A and B are reversed tied because we prefer greater values of depth but lesser values of tour and estimate.
bool CMR::ABC::BranchNode::tour_worse ( const std::list< BranchNode >::iterator &  A,
const std::list< BranchNode >::iterator &  B 
)
static

Returns true if A has a worse tour than B.

Comparator where A is worse than B if A is estimated to have a longer best tour.

Ties are broken by depth and then strong branch estimate, in that order.

Remarks
the depth of A and B are reversed tied because we prefer greater values of depth but lesser values of tour and estimate.

The documentation for this struct was generated from the following files: