Minotaur 0.4.1
Docs for developers
SppHeur.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2008 - 2025 The Minotaur Team.
5//
6
14#ifndef MINOTAURSPPHEUR_H
15#define MINOTAURSPPHEUR_H
16
17#include "Heuristic.h"
18#include "Types.h"
19
20namespace Minotaur
21{
22
24 UInt calls; // Number of times heuristic called
25 UInt runs; // Number of times heuristic runs
26 UInt sols; // Number of solutions found
27 double time; // Time taken in this heuristic
28};
29
31 VarSetConstIter vit;
32 std::deque<Variable *> vq0;
33 ConstraintConstIterator cit;
34 std::deque<Constraint *> cq;
35};
36
37
38
39class SppHeur : public Heuristic
40{
41public:
44
47
50
52 SolutionPoolPtr s_pool);
53
55 void writeStats(std::ostream& out) const;
56
57private:
58 // Environment
59 EnvPtr env_;
60
61 // logging
62 Logger* logger_;
63
64 // Maximum random solutions to check
65 // For printing messages
66 static const std::string me_;
67
68 // Problem
69 ProblemPtr p_;
70
71 // Statistics
72 SppHeurStats stats_;
73
74 // Vector of cons
75 ConstraintVector cv2_;
76
77 std::deque<SppHeurMods *> mstack_;
78 std::deque<Variable *> vq_;
79
80 double addSol_(SolutionPool *spool) ;
81
83 void enum_(NodePtr, RelaxationPtr, SolutionPoolPtr spool);
84 void conWise_(NodePtr, RelaxationPtr, SolutionPoolPtr s_pool);
85 void conWise2_(NodePtr, RelaxationPtr, SolutionPoolPtr spool);
86 void varWise_(NodePtr, RelaxationPtr, SolutionPoolPtr spool);
87 void sortVars_(VarVector &vvec);
88
90 void conWiseNb_(const double *x, NodePtr, RelaxationPtr, SolutionPoolPtr s_pool);
91
93 bool isSpp_();
94
95 // Check whether x is feasible
96 bool isFeasible_(const double* x);
97
98 bool propVal_(VariablePtr v, int &num0, int &consfixed);
99 bool propEnum_(Variable* v, ConstraintConstIterator cit2, VarSetConstIter vit2);
100
101 void solveLP_(SolutionPool *spool);
102};
103
104} // namespace Minotaur
105#endif
106
Define abstract base class for heuristics of various kinds.
Declare important 'types' used in Minotaur.
Definition: Environment.h:28
Definition: Heuristic.h:30
Definition: Logger.h:37
Definition: Node.h:54
Definition: Problem.h:74
Definition: Relaxation.h:53
Definition: SolutionPool.h:28
Definition: Solution.h:30
Definition: SppHeur.h:40
SppHeur(EnvPtr env, ProblemPtr p)
default constructor
Definition: SppHeur.cpp:35
void solveNode(ConstSolutionPtr sol, NodePtr node, RelaxationPtr rel, SolutionPoolPtr s_pool)
Use this heuristic.
Definition: SppHeur.cpp:109
void solve(NodePtr, RelaxationPtr, SolutionPoolPtr s_pool)
call to heuristic
Definition: SppHeur.cpp:79
void writeStats(std::ostream &out) const
writing the statistics to the logger
Definition: SppHeur.cpp:1031
~SppHeur()
default destructor
Definition: SppHeur.h:46
Definition: Variable.h:31
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
Definition: SppHeur.h:30
Definition: SppHeur.h:23

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025