Camargue
Public Types | Public Member Functions | Private Attributes | List of all members
CMR::Sep::Clique Class Reference

Class for storing segment lists representing edges of a hypergraph. More...

#include <cliq.hpp>

Public Types

using Ptr = std::shared_ptr< Clique >
 shared_ptr alias declaration.
 

Public Member Functions

 Clique ()=default
 Default construct an empty Clique.
 
 Clique (const CCtsp_lpclique &cc_cliq, const std::vector< int > &saved_tour, const std::vector< int > &saved_perm, const std::vector< int > &current_tour)
 Construct a Clique from a Concorde clique.
 
 Clique (int start, int end, const std::vector< int > &saved_tour, const std::vector< int > &saved_perm, const std::vector< int > &current_tour)
 Construct a Clique from start and end indices.
 
 Clique (const std::vector< int > &nodes, const std::vector< int > &perm, bool peserve_order)
 Construct a Clique from a list of literal nodes. More...
 
int seg_count () const
 How many segments are used to represent the Clique.
 
const std::vector< Segment > & seg_list () const
 A constant reference to the list of segments in the Clique.
 
std::vector< int > node_list (const std::vector< int > &saved_tour) const
 A list of literal nodes represented by the Clique. More...
 
bool operator== (const Clique &rhs) const
 Equality operator.
 
bool contains (const int index) const
 Returns true iff the Clique contains index.
 

Private Attributes

std::vector< Segmentseglist
 A vector of start and endpoints of tour intervals stored as Segment.
 

Detailed Description

Class for storing segment lists representing edges of a hypergraph.

A Clique stores a subset of vertices as a list of CMR::Segment objects, where the start and endpoints indicate a range of nodes from a tour. Thus, a Clique is meaningless without a tour from which to be derefrenced.

Constructor & Destructor Documentation

CMR::Sep::Clique::Clique ( const std::vector< int > &  nodes,
const std::vector< int > &  perm,
bool  preserve_order 
)

Construct a Clique from a list of literal nodes.

Parameters
[in]nodesa list of nodes in the graph as per some absolute order not dependent on the current tour.
[in]permthe clique will be built using indices from perm, hence implicitly reprsented in terms of the tour corresponding to perm.

Member Function Documentation

vector< int > CMR::Sep::Clique::node_list ( const std::vector< int > &  saved_tour) const

A list of literal nodes represented by the Clique.

Parameters
[in]saved_tourthe tour that was active when this Clique was constructed.
Returns
a vector of the literal nodes obtained by dereferencing saved_tour for the ranges specified in the segment list.

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