Camargue
Public Member Functions | Private Attributes | List of all members
CMR::LP::ActiveTour Class Reference

Information about the active tour in a CoreLP. More...

#include <active_tour.hpp>

Collaboration diagram for CMR::LP::ActiveTour:
Collaboration graph
[legend]

Public Member Functions

 ActiveTour (const Graph::CoreGraph &graph, const Data::BestGroup &best_data)
 An ActiveTour for a new CoreLP using the Padberg-Hong approach. More...
 
 ActiveTour (std::vector< int > tour_nodes_, std::vector< double > lp_edges, Basis base, double lp_objval, const Graph::CoreGraph &graph)
 Construct from an augmenting pivot/dfs island.
 
 ActiveTour (std::vector< int > tour_nodes_, LP::Relaxation &relax, const Graph::CoreGraph &graph)
 Construct a new ActiveTour from scratch, instating it in relax. More...
 
 ActiveTour (ActiveTour &&T) noexcept
 
ActiveTouroperator= (ActiveTour &&T) noexcept
 
void set_basis (Basis new_base)
 
void instate (Relaxation &relax)
 Instate this tour in relax. More...
 
void reset_instate (Relaxation &relax)
 Get a new basis for this tour from relax, instating it. More...
 
void best_update (Data::BestGroup &best_data) const
 Update best_data with the this tour. More...
 
void enter_tourless (Data::BestGroup &best_data)
 Go into tourless mode of operation with best tour.
 
double length () const
 
bool tourless () const
 
const std::vector< int > & nodes () const
 
const std::vector< int > & tour_perm () const
 
const std::vector< double > & edges () const
 
const Basisbase () const
 

Private Attributes

double tour_len
 
std::vector< int > tour_nodes
 
std::vector< int > perm
 
std::vector< double > tour_edges
 
Basis tour_base
 
bool tourless_mode = false
 

Detailed Description

Information about the active tour in a CoreLP.

This class stores the tour which will be used to generate cuts and perform pivots. It should be used in a CoreLP in cooperation with a BestGroup, although they need not store the same tour.

Remarks
In this documentation and in function names, to "instate" an ActiveTour in an LP::Relaxation means that the tour is made to be the resident solution in the Relaxation: calls to Relaxation::lp_vec or Relaxation::get_objval shall coincide (within Epsilon::Zero) of the values stored in the tour.

Constructor & Destructor Documentation

CMR::LP::ActiveTour::ActiveTour ( const Graph::CoreGraph graph,
const Data::BestGroup best_data 
)

An ActiveTour for a new CoreLP using the Padberg-Hong approach.

Constructs an ActiveTour with basis using the Padberg-Hong algorithm for getting a basis from a tour for an LP relaxation with only the degree constraints.

Parameters
graphthe CoreGraph on which the tour was found.
best_datathe data which will be used to directly initialize all members except tour_base.
CMR::LP::ActiveTour::ActiveTour ( std::vector< int >  tour_nodes_,
LP::Relaxation relax,
const Graph::CoreGraph graph 
)

Construct a new ActiveTour from scratch, instating it in relax.

Construct an ActiveTour from scratch, using pure combinatorial data, and then instate it in an LP::Relxation.

Parameters
tour_nodes_the sequence of nodes defining the tour.
relaxthe LP::Relaxation in which to instate the tour.
graphthe CoreGraph describing the edge set of relax.
Remarks
tour_nodes_ is moved from.

Member Function Documentation

void CMR::LP::ActiveTour::best_update ( Data::BestGroup best_data) const

Update best_data with the this tour.

This method will update the BestGroup best_data with the stored information in this ActiveTour.

This method will verify that the tour is indeed an improvement on the one currently in best_data, throwing an exception if it is worse or if the edge vector is generated incorrectly.

void CMR::LP::ActiveTour::instate ( Relaxation relax)

Instate this tour in relax.

This function will try to instate this tour in relax, first by copying the tour edges and basic statuses, and then by generating a new basis if that fails.

Postcondition
the tour is instated.
void CMR::LP::ActiveTour::reset_instate ( Relaxation relax)

Get a new basis for this tour from relax, instating it.

Instate this ActiveTour in relax by constructing a new basis for it and setting said basis (along with this tour) as the starting solution.


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