BiDirectional

class BiDirectional

BiDirectional algorithm. see docs

  1. ctor (memory allocation for the graph)

  2. add edges to graph using addEdge.

  3. [optional] set solving parameters if desired (e.g. time_limit, …) 3.1. [optional] set callback using setREFCallback 3.2. [optional] set seed using setSeed

  4. call run

Public Functions

BiDirectional(const int &number_vertices, const int &number_edges, const int &source_id, const int &sink_id, const std::vector<double> &max_res_in, const std::vector<double> &min_res_in)
Parameters
  • number_vertices, int[in] number of vertices in the graph (to be added using addEdge)

  • number_edges, int[in] number of edges in the graph

  • source_id, int[in] vertex id for the source

  • sink_id, int[in] vertex id for the sink

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

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

inline ~BiDirectional()

Default destructor.

inline void addNodes(const std::vector<int> &nodes)

Wrapper to add nodes to the graph.

inline void addEdge(const int &tail, const int &head, const double &weight, const std::vector<double> &resource_consumption)

Add an edge to the graph.

void run()

run the algorithm (assumes all the appropriate options are set)

std::vector<int> getPath() const

Return the final path.

std::vector<double> getConsumedResources() const

Return the consumed resources.

double getTotalCost() const

Return the total cost.

void checkCriticalRes() const

After running the algorithm, one can check if critical resource is tight (difference between final resource and maximum) and prints a message if it doesn’t match to the one chosen in Params.

inline void setDirection(const std::string &direction_in)

See also

bidirectional::Params

inline void setMethod(const std::string &method_in)

See also

bidirectional::Params

inline void setTimeLimit(const double &time_limit_in)

See also

bidirectional::Params

inline void setThreshold(const double &threshold_in)

See also

bidirectional::Params

inline void setElementary(const bool &elementary_in)

See also

bidirectional::Params

inline void setTwoCycleElimination(const bool &two_cycle_elimination_in)

See also

bidirectional::Params

inline void setBoundsPruning(const bool &bounds_pruning_in)

See also

bidirectional::Params

inline void setFindCriticalRes(const bool &find_critical_res_in)

See also

bidirectional::Params and getCriticalRes

inline void setCriticalRes(const int &critical_res_in)

See also

bidirectional::Params

inline void setREFCallback(bidirectional::REFCallback *cb)

Pass python callback for label extensions. Note: swig needs namespace specifier

Public Members

std::vector<double> max_res

vector with upper and lower bounds for resources