pricer class
Definition at line 45 of file pricer_vrp.h.
#include <pricer_vrp.h>
Public Member Functions | |
ObjPricerVRP (SCIP *scip, const char *p_name, const int p_num_nodes, const int p_capacity, const vector< int > &p_demand, const vector< vector< int > > &p_distance, const vector< vector< SCIP_VAR * > > &p_arc_var, const vector< vector< SCIP_CONS * > > &p_arc_con, const vector< SCIP_CONS * > &p_part_con) | |
virtual | ~ObjPricerVRP () |
virtual | SCIP_DECL_PRICERINIT (scip_init) |
virtual | SCIP_DECL_PRICERREDCOST (scip_redcost) |
virtual | SCIP_DECL_PRICERFARKAS (scip_farkas) |
SCIP_RETCODE | pricing (SCIP *scip, bool isfarkas) const |
SCIP_RETCODE | add_tour_variable (SCIP *scip, const list< int > &tour) const |
double | find_shortest_tour (const vector< vector< double > > &length, list< int > &tour) const |
![]() | |
ObjPricer (SCIP *scip, const char *name, const char *desc, int priority, SCIP_Bool delay) | |
ObjPricer (const ObjPricer &o) | |
ObjPricer (ObjPricer &&o) | |
virtual | ~ObjPricer () |
ObjPricer & | operator= (const ObjPricer &o)=delete |
ObjPricer & | operator= (ObjPricer &&o)=delete |
virtual | SCIP_DECL_PRICERFREE (scip_free) |
virtual | SCIP_DECL_PRICEREXIT (scip_exit) |
virtual | SCIP_DECL_PRICERINITSOL (scip_initsol) |
virtual | SCIP_DECL_PRICEREXITSOL (scip_exitsol) |
![]() | |
virtual | ~ObjProbCloneable () |
ObjProbCloneable & | operator= (const ObjProbCloneable &o)=delete |
ObjProbCloneable & | operator= (ObjProbCloneable &&o)=delete |
virtual | SCIP_DECL_OBJPROBCLONE (ObjProbCloneable *clone) |
virtual | SCIP_DECL_OBJPROBISCLONEABLE (iscloneable) |
Protected Member Functions | |
int | num_nodes () const |
int | capacity () const |
int | demand (const int i) const |
double | distance (const int i, const int j) const |
SCIP_VAR * | arc_var (const int i, const int j) const |
SCIP_CONS * | arc_con (const int i, const int j) const |
SCIP_CONS * | part_con (const int i) const |
bool | have_edge (const int i, const int j) const |
Additional Inherited Members | |
![]() | |
SCIP * | scip_ |
char * | scip_name_ |
char * | scip_desc_ |
const int | scip_priority_ |
const SCIP_Bool | scip_delay_ |
ObjPricerVRP::ObjPricerVRP | ( | SCIP * | scip, |
const char * | p_name, | ||
const int | p_num_nodes, | ||
const int | p_capacity, | ||
const vector< int > & | p_demand, | ||
const vector< vector< int > > & | p_distance, | ||
const vector< vector< SCIP_VAR * > > & | p_arc_var, | ||
const vector< vector< SCIP_CONS * > > & | p_arc_con, | ||
const vector< SCIP_CONS * > & | p_part_con ) |
Constructs the pricer object with the data needed
Constructs the pricer object with the data needed
An alternative is to have a problem data class which allows to access the data.
scip | SCIP pointer |
p_name | name of pricer |
p_num_nodes | number of nodes |
p_capacity | vehicle capacity |
p_demand | demand array |
p_distance | matrix of distances |
p_arc_var | matrix of arc variables |
p_arc_con | matrix of arc constraints |
p_part_con | array of partitioning constraints |
Definition at line 50 of file pricer_vrp.cpp.
|
virtual |
Destructs the pricer object.
Definition at line 73 of file pricer_vrp.cpp.
|
virtual |
initialization method of variable pricer (called after problem was transformed)
Reimplemented from scip::ObjPricer.
|
virtual |
reduced cost pricing method of variable pricer for feasible LPs
Implements scip::ObjPricer.
|
virtual |
farkas pricing method of variable pricer for infeasible LPs
Reimplemented from scip::ObjPricer.
SCIP_RETCODE ObjPricerVRP::pricing | ( | SCIP * | scip, |
bool | isfarkas ) const |
perform pricing
perform pricing
scip | SCIP data structure |
isfarkas | whether we perform Farkas pricing |
Definition at line 106 of file pricer_vrp.cpp.
References add_tour_variable(), arc_con(), assert(), FALSE, find_shortest_tour(), i, NULL, num_nodes(), part_con(), r, SCIP_CALL, SCIP_OKAY, SCIPgetDualfarkasLinear(), SCIPgetDualsolLinear(), SCIPinfoMessage(), SCIPisNegative(), and SCIPwriteTransProblem().
SCIP_RETCODE ObjPricerVRP::add_tour_variable | ( | SCIP * | scip, |
const list< int > & | tour ) const |
add tour variable to problem
scip | SCIP data structure |
tour | list of nodes in tour |
Definition at line 258 of file pricer_vrp.cpp.
References arc_con(), assert(), NULL, num_nodes(), part_con(), SCIP_CALL, SCIP_OKAY, SCIP_VARTYPE_CONTINUOUS, SCIPaddCoefLinear(), SCIPaddPricedVar(), SCIPcreateVar(), SCIPdebugMsg, SCIPinfinity(), SCIPreleaseVar(), SCIPsnprintf(), and var.
Referenced by pricing().
SCIP_Real ObjPricerVRP::find_shortest_tour | ( | const vector< vector< double > > & | length, |
list< int > & | tour ) const |
return negative reduced cost tour (uses restricted shortest path dynamic programming algorithm)
return negative reduced cost tour (uses restricted shortest path dynamic programming algorithm)
The algorithm uses the priority queue implementation in pqueue.h. SCIP's implementation of priority queues cannot be used, since it currently does not support removal of elements that are not at the top.
length | matrix of lengths |
tour | list of nodes in tour |
Definition at line 373 of file pricer_vrp.cpp.
References capacity(), demand(), eps, have_edge(), num_nodes(), and SCIPdebugMessage.
Referenced by pricing().
|
inlineprotected |
return number of nodes
Definition at line 96 of file pricer_vrp.h.
Referenced by add_tour_variable(), find_shortest_tour(), and pricing().
|
inlineprotected |
return vehicle capacity
Definition at line 102 of file pricer_vrp.h.
Referenced by find_shortest_tour().
|
inlineprotected |
return demand of node i
i | node |
Definition at line 108 of file pricer_vrp.h.
References i.
Referenced by find_shortest_tour().
|
inlineprotected |
return distance between nodes i and j
i | first node |
j | second node |
Definition at line 116 of file pricer_vrp.h.
References i.
|
inlineprotected |
return variable corresponding to arc between i and j
i | first node |
j | second node |
Definition at line 125 of file pricer_vrp.h.
References i.
Referenced by have_edge().
|
inlineprotected |
return constraint corresponding to arc between i and j
i | first node |
j | second node |
Definition at line 134 of file pricer_vrp.h.
References i.
Referenced by add_tour_variable(), and pricing().
|
inlineprotected |
return partitioning constraint for node i
i | node |
Definition at line 143 of file pricer_vrp.h.
References i.
Referenced by add_tour_variable(), and pricing().
|
inlineprotected |
whether edge between node i and j exists
i | first node |
j | second node |
Definition at line 151 of file pricer_vrp.h.
References arc_var(), i, and SCIPvarGetUbLocal().
Referenced by find_shortest_tour().