#include <Idiot.hpp>
Public Member Functions | |
Constructors and destructor | |
Just a pointer to model is kept | |
Idiot () | |
Default constructor. | |
Idiot (OsiSolverInterface &model) | |
Constructor with model. | |
Idiot (const Idiot &) | |
Copy constructor. | |
Idiot & | operator= (const Idiot &rhs) |
Assignment operator. This copies the data. | |
~Idiot () | |
Destructor. | |
Algorithmic calls | |
void | solve () |
Get an approximate solution with the idiot code. | |
void | crash (int numberPass, CoinMessageHandler *handler,const CoinMessages *messages) |
Lightweight "crash". | |
void | crossOver (int mode) |
Use simplex to get an optimal solution mode is how many steps the simplex crossover should take to arrive to an extreme point: 0 - chosen,all ever used, all 1 - chosen, all 2 - all 3 - do not do anything - maybe basis + 16 do presolves. | |
Gets and sets of most useful data | |
double | getStartingWeight () const |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
void | setStartingWeight (double value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
double | getWeightFactor () const |
Weight factor - weight multiplied by this when changes, default 0.333. | |
void | setWeightFactor (double value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
double | getFeasibilityTolerance () const |
Feasibility tolerance - problem essentially feasible if individual infeasibilities less than this. | |
void | setFeasibilityTolerance (double value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
double | getReasonablyFeasible () const |
Reasonably feasible. | |
void | setReasonablyFeasible (double value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
double | getExitInfeasibility () const |
Exit infeasibility - exit if sum of infeasibilities less than this. | |
void | setExitInfeasibility (double value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
int | getMajorIterations () const |
Major iterations. | |
void | setMajorIterations (int value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
int | getMinorIterations () const |
Minor iterations. | |
void | setMinorIterations (int value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
int | getReduceIterations () const |
Reduce weight after this many major iterations. | |
void | setReduceIterations (int value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
int | getLogLevel () const |
Amount of information - default of 1 should be okay. | |
void | setLogLevel (int value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
int | getLightweight () const |
How lightweight - 0 not, 1 yes, 2 very lightweight. | |
void | setLightweight (int value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
int | getStrategy () const |
strategy | |
void | setStrategy (int value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
double | getDropEnoughFeasibility () const |
Fine tuning - okay if feasibility drop this factor. | |
void | setDropEnoughFeasibility (double value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
double | getDropEnoughWeighted () const |
Fine tuning - okay if weighted obj drop this factor. | |
void | setDropEnoughWeighted (double value) |
Starting weight - small emphasizes feasibility, default 1.0e-4. | |
Private Member Functions | |
void | solve2 (CoinMessageHandler *handler, const CoinMessages *messages) |
Does actual work. | |
IdiotResult | IdiSolve (int nrows, int ncols, double *rowsol, double *colsol, double *pi, double *djs, const double *origcost, const double *rowlower, double *rowupper, const double *lower, const double *upper, const double *element, const int *row, const CoinBigIndex *colcc, const int *length, double *lambda, int maxIts, double mu, double drop, double maxmin, double offset, int strategy, double djTol, double djExit, double djFlag) |
int | dropping (IdiotResult result, double tolerance, double small, int *nbad) |
IdiotResult | objval (int nrows, int ncols, double *rowsol, double *colsol, double *pi, double *djs, const double *cost, const double *rowlower, const double *rowupper, const double *lower, const double *upper, const double *elemnt, const int *row, const CoinBigIndex *columnStart, const int *length, int extraBlock, int *rowExtra, double *solExtra, double *elemExtra, double *upperExtra, double *costExtra, double weight) |
Private Attributes | |
OsiSolverInterface * | model_ |
Underlying model. | |
double | djTolerance_ |
double | mu_ |
double | drop_ |
double | muFactor_ |
double | stopMu_ |
double | smallInfeas_ |
double | reasonableInfeas_ |
double | exitDrop_ |
double | muAtExit_ |
double | exitFeasibility_ |
double | dropEnoughFeasibility_ |
double | dropEnoughWeighted_ |
int * | whenUsed_ |
int | maxBigIts_ |
int | maxIts_ |
int | majorIterations_ |
int | logLevel_ |
int | logFreq_ |
int | checkFrequency_ |
int | lambdaIterations_ |
int | maxIts2_ |
int | strategy_ |
int | lightWeight_ |
It has no merit apart from the fact that it gets an approximate solution to some classes of problems. Better if vaguely homogeneous. It works on problems where volume algorithm works and often gets a better primal solution but it has no dual solution.
It can also be used as a "crash" to get a problem started. This is probably its most useful function.
It is based on the idea that algorithms with terrible convergence properties may be okay at first. Throw in some random dubious tricks and the resulting code may be worth keeping as long as you don't look at it.
Definition at line 45 of file Idiot.hpp.
|
Default constructor.
|
|
Constructor with model.
|
|
Copy constructor.
|
|
Destructor.
|
|
Assignment operator. This copies the data.
|
|
Get an approximate solution with the idiot code.
|
|
Lightweight "crash".
|
|
Use simplex to get an optimal solution mode is how many steps the simplex crossover should take to arrive to an extreme point: 0 - chosen,all ever used, all 1 - chosen, all 2 - all 3 - do not do anything - maybe basis + 16 do presolves.
|
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 92 of file Idiot.hpp. References mu_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 94 of file Idiot.hpp. References mu_. |
|
Weight factor - weight multiplied by this when changes, default 0.333.
Definition at line 98 of file Idiot.hpp. References muFactor_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 100 of file Idiot.hpp. References muFactor_. |
|
Feasibility tolerance - problem essentially feasible if individual infeasibilities less than this. default 0.1 Definition at line 105 of file Idiot.hpp. References smallInfeas_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 107 of file Idiot.hpp. References smallInfeas_. |
|
Reasonably feasible. Dubious method concentrates more on objective when sum of infeasibilities less than this. Very dubious default value of (Number of rows)/20 Definition at line 112 of file Idiot.hpp. References reasonableInfeas_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 114 of file Idiot.hpp. References reasonableInfeas_. |
|
Exit infeasibility - exit if sum of infeasibilities less than this. Default -1.0 (i.e. switched off) Definition at line 118 of file Idiot.hpp. References exitFeasibility_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 120 of file Idiot.hpp. References exitFeasibility_. |
|
Major iterations. stop after this number. Default 30. Use 2-5 for "crash" 50-100 for serious crunching Definition at line 124 of file Idiot.hpp. References majorIterations_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 126 of file Idiot.hpp. References majorIterations_. |
|
Minor iterations. Do this number of tiny steps before deciding whether to change weights etc. Default - dubious sqrt(Number of Rows). Good numbers 105 to 405 say (5 is dubious method of making sure idiot is not trying to be clever which it may do every 10 minor iterations) Definition at line 134 of file Idiot.hpp. References maxIts2_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 136 of file Idiot.hpp. References maxIts2_. |
|
Reduce weight after this many major iterations. It may get reduced before this but this is a maximum. Default 3. 3-10 plausible. Definition at line 141 of file Idiot.hpp. References maxBigIts_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 143 of file Idiot.hpp. References maxBigIts_. |
|
Amount of information - default of 1 should be okay.
Definition at line 146 of file Idiot.hpp. References logLevel_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 148 of file Idiot.hpp. References logLevel_. |
|
How lightweight - 0 not, 1 yes, 2 very lightweight.
Definition at line 151 of file Idiot.hpp. References lightWeight_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 153 of file Idiot.hpp. References lightWeight_. |
|
strategy
Definition at line 156 of file Idiot.hpp. References strategy_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 158 of file Idiot.hpp. References strategy_. |
|
Fine tuning - okay if feasibility drop this factor.
Definition at line 161 of file Idiot.hpp. References dropEnoughFeasibility_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 163 of file Idiot.hpp. References dropEnoughFeasibility_. |
|
Fine tuning - okay if weighted obj drop this factor.
Definition at line 166 of file Idiot.hpp. References dropEnoughWeighted_. |
|
Starting weight - small emphasizes feasibility, default 1.0e-4.
Definition at line 168 of file Idiot.hpp. References dropEnoughWeighted_. |
|
Does actual work.
|
|
|
|
|
|
|
|
Underlying model.
|
|
|
|
Definition at line 208 of file Idiot.hpp. Referenced by getStartingWeight(), and setStartingWeight(). |
|
|
|
Definition at line 210 of file Idiot.hpp. Referenced by getWeightFactor(), and setWeightFactor(). |
|
|
|
Definition at line 212 of file Idiot.hpp. Referenced by getFeasibilityTolerance(), and setFeasibilityTolerance(). |
|
Definition at line 213 of file Idiot.hpp. Referenced by getReasonablyFeasible(), and setReasonablyFeasible(). |
|
|
|
|
|
Definition at line 216 of file Idiot.hpp. Referenced by getExitInfeasibility(), and setExitInfeasibility(). |
|
Definition at line 217 of file Idiot.hpp. Referenced by getDropEnoughFeasibility(), and setDropEnoughFeasibility(). |
|
Definition at line 218 of file Idiot.hpp. Referenced by getDropEnoughWeighted(), and setDropEnoughWeighted(). |
|
|
|
Definition at line 220 of file Idiot.hpp. Referenced by getReduceIterations(), and setReduceIterations(). |
|
|
|
Definition at line 222 of file Idiot.hpp. Referenced by getMajorIterations(), and setMajorIterations(). |
|
Definition at line 223 of file Idiot.hpp. Referenced by getLogLevel(), and setLogLevel(). |
|
|
|
|
|
|
|
Definition at line 227 of file Idiot.hpp. Referenced by getMinorIterations(), and setMinorIterations(). |
|
Definition at line 228 of file Idiot.hpp. Referenced by getStrategy(), and setStrategy(). |
|
Definition at line 238 of file Idiot.hpp. Referenced by getLightweight(), and setLightweight(). |