coin-Bcp
BB_lp.hpp
Go to the documentation of this file.
1 // Last edit: 1/21/09
2 //
3 // Name: BB_lp.hpp
4 // Author: Francois Margot
5 // Tepper School of Business
6 // Carnegie Mellon University, Pittsburgh, PA 15213
7 // email: fmargot@andrew.cmu.edu
8 // Date: 12/28/03
9 //-----------------------------------------------------------------------------
10 // Copyright (C) 2003, Francois Margot, International Business Machines
11 // Corporation and others. All Rights Reserved.
12 
13 #ifndef _BB_LP_H
14 #define _BB_LP_H
15 
16 #include "BB.hpp"
17 #include "BCP_lp_user.hpp"
18 
19 #include "BB_user_data.hpp"
20 
23 class BB_lp : public BCP_lp_user {
24 
27 
30 
32  int in_strong;
33 
35  double EPS;
36 
39 
41  std::vector<int> violated_cuts;
42 
43 public:
44 
47  BB_lp(){}
49 
51  virtual ~BB_lp() {}
53 
55  virtual void unpack_module_data(BCP_buffer & buf);
56 
57  // Tell Bcp which solver to use and set parameters of solver.
60 
63  const BCP_vec<BCP_var*>& vars,
64  const BCP_vec<BCP_cut*>& cuts,
65  const BCP_vec<BCP_obj_status>& var_status,
66  const BCP_vec<BCP_obj_status>& cut_status,
67  BCP_vec<int>& var_changed_pos,
68  BCP_vec<double>& var_new_bd,
69  BCP_vec<int>& cut_changed_pos,
70  BCP_vec<double>& cut_new_bd);
71 
76  const int changeType,
77  bool in_strong_branching);
78 
83  virtual BCP_solution* test_feasibility(const BCP_lp_result& lp_result,
84  const BCP_vec<BCP_var*>& vars,
85  const BCP_vec<BCP_cut*>& cuts);
86 
90  virtual void logical_fixing(const BCP_lp_result& lpres,
91  const BCP_vec<BCP_var*>& vars,
92  const BCP_vec<BCP_cut*>& cuts,
93  const BCP_vec<BCP_obj_status>& var_status,
94  const BCP_vec<BCP_obj_status>& cut_status,
95  const int var_bound_changes_since_logical_fixing,
96  BCP_vec<int>& changed_pos,
97  BCP_vec<double>& new_bd);
98 
103  virtual void generate_cuts_in_lp(const BCP_lp_result& lpres,
104  const BCP_vec<BCP_var*>& vars,
105  const BCP_vec<BCP_cut*>& cuts,
106  BCP_vec<BCP_cut*>& new_cuts,
107  BCP_vec<BCP_row*>& new_rows);
108 
111  const BCP_lp_result& lpres,
112  const BCP_vec<BCP_var*>& vars,
113  const BCP_vec<BCP_cut*>& cuts);
114 
118  virtual void
119  cuts_to_rows(const BCP_vec<BCP_var*>& vars, // on what to expand
120  BCP_vec<BCP_cut*>& cuts, // what to expand
121  BCP_vec<BCP_row*>& rows, // the expanded rows
122  const BCP_lp_result& lpres,
123  BCP_object_origin origin, bool allow_multiple);
124 
131 
132  virtual BCP_branching_decision
134  const BCP_vec<BCP_var*>& vars,
135  const BCP_vec<BCP_cut*>& cuts,
136  const BCP_lp_var_pool& local_var_pool,
137  const BCP_lp_cut_pool& local_cut_pool,
139  bool force_branch = false);
140 
144  const int selected);
145 };
146 
147 #endif
BCP_object_origin
This enumerative constant describes the origin (originating process) of an object (variable or cut)...
Definition: BCP_enum.hpp:249
MY_user_data * p_ud
Pointer on the description of the user data.
Definition: BB_lp.hpp:29
virtual void cuts_to_rows(const BCP_vec< BCP_var * > &vars, BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_row * > &rows, const BCP_lp_result &lpres, BCP_object_origin origin, bool allow_multiple)
Describes how to get a row of the matrix from the representation of the cut.
virtual void unpack_module_data(BCP_buffer &buf)
Unpack data sent from the tree manager.
virtual void set_user_data_for_children(BCP_presolved_lp_brobj *best, const int selected)
Set up the user data for the children according to the chosen branching object.
BCP_vec< BCP_cut * > algo_cuts
Hold pointers on generated algorithmic cuts.
Definition: BB_lp.hpp:38
virtual ~BB_lp()
Destructor.
Definition: BB_lp.hpp:51
virtual void initialize_new_search_tree_node(const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_vec< BCP_obj_status > &var_status, const BCP_vec< BCP_obj_status > &cut_status, BCP_vec< int > &var_changed_pos, BCP_vec< double > &var_new_bd, BCP_vec< int > &cut_changed_pos, BCP_vec< double > &cut_new_bd)
Initialize data members at the start of processing a new subproblem.
Class holding data for describing the problem.
Definition: BB.hpp:21
virtual void modify_lp_parameters(OsiSolverInterface *lp, const int changeType, bool in_strong_branching)
Modify the parameters of the LP solver.
The BCP_lp_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_lp_user.hpp:75
virtual void logical_fixing(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_vec< BCP_obj_status > &var_status, const BCP_vec< BCP_obj_status > &cut_status, const int var_bound_changes_since_logical_fixing, BCP_vec< int > &changed_pos, BCP_vec< double > &new_bd)
Perform fixing of variables.
virtual BCP_branching_decision select_branching_candidates(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_lp_var_pool &local_var_pool, const BCP_lp_cut_pool &local_cut_pool, BCP_vec< BCP_lp_branching_object * > &cands, bool force_branch=false)
Called at the end of each iteration.
int in_strong
in_strong = 1 if and only if in strong branching phase
Definition: BB_lp.hpp:32
BCP_branching_decision
This enumerative constant is the return value of the select_branching_candidates() method in [BCP_lp_...
virtual BCP_solution * test_feasibility(const BCP_lp_result &lp_result, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
Test feasibility of the LP solution.
Class taking care of interaction between user data and Bcp.
Abstract Base Class for describing an interface to a solver.
std::vector< int > violated_cuts
Hold indices of violated indexed cuts.
Definition: BB_lp.hpp:41
double EPS
Hold the value of EPSILON of class BB_prob.
Definition: BB_lp.hpp:35
A presolved branching object candidate.
virtual OsiSolverInterface * initialize_solver_interface()
Called only once at the beginning, from the root node.
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
Class for operations at the node level.
Definition: BB_lp.hpp:23
This class holds the results after solving an LP relaxation.
virtual void generate_cuts_in_lp(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_cut * > &new_cuts, BCP_vec< BCP_row * > &new_rows)
Cut generation.
BB_prob * p_desc
Pointer on the description of the problem.
Definition: BB_lp.hpp:26
This is the abstract base class for a solution to a Mixed Integer Programming problem.
BB_lp()
Default constructor.
Definition: BB_lp.hpp:48
virtual BCP_solution * generate_heuristic_solution(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
Simple rounding heuristic.