Label

class labelling::Label

Single node label. With resource, cost and other attributes.

Main functionality includes:

  • Checking resource feasibility

  • Checking dominance

Public Functions

inline Label()

Dummy constructor.

Label(const double &weight_in, const bidirectional::Vertex &vertex_in, const std::vector<double> &resource_consumption_in, const std::vector<int> &partial_path_in, bidirectional::Params *params)

Constructor.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Label

Label(const double &weight_in, const bidirectional::Vertex &vertex_in, const std::vector<double> &resource_consumption_in, const std::vector<int> &partial_path_in, bidirectional::Params *params, const double &phi_in)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

inline ~Label()

default destructor

Label extend(const bidirectional::AdjVertex &adjacent_vertex, const bidirectional::Directions &direction, const std::vector<double> &max_res = {}, const std::vector<double> &min_res = {})

Generate new label extensions from the current label and return only if resource feasible. The input label is a pointer as it may be modified in the case that the edge / adjacent_vertex is found to be resource infeasible, in which case, the head/tail node becomes unreachable and the attribute is updated.

Parameters
  • label, labelling::Label, current[out] label to extend (and maybe update unreachable_nodes)

  • adjacent_vertex, AdjVertex, edge[in]

  • direction[in] Directions

  • elementary[in] bool

  • max_res, vector[in] of double with upper bound(s) for resource consumption

  • min_res, vector[in] of double with lower bound(s) for resource consumption

Returns

Label object with extended label. Note this may be empty if the extension is resource infeasible

bool checkDominance(const Label &other, const bidirectional::Directions &direction) const

Check if this dominates other. Assumes the labels are comparable i.e. same nodes

Parameters
  • other[in] Label

  • direction[in] Directions

  • elementary[in] bool, optional

Returns

bool

bool fullDominance(const Label &other, const bidirectional::Directions &direction) const

Checks whether this dominates other for the input direction. In the case when neither dominates , i.e. they are non-dominated, the direction is flipped labels are compared again.

Parameters
  • other[in] Label

  • direction[in] Directions

  • elementary[in] bool

Returns

bool

bool checkFeasibility(const std::vector<double> &max_res, const std::vector<double> &min_res) const

Check resource feasibility of current label i.e. min_res[i] <= resource_consumption[i] <= max_res[i] for i in 0..resource_consumption.size()

Parameters
  • max_res, vector[in] of double with upper bound(s) for resource consumption

  • min_res, vector[in] of double with lower bound(s) for resource consumption

bool checkThreshold(const double &threshold) const

Check if weight is under the input threshold.

bool checkStPath(const int &source_id, const int &sink_id) const

Check whether the current partial path is Source - Sink.

inline void setPhi(const double &phi_in)

set phi attribute for merged labels from Righini and Salani (2006)