Minotaur 0.4.1
Docs for developers
MaxFreqBrancher.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2009 - 2025 The Minotaur Team.
5//
6
14#ifndef MINOTAURMAXFREQBRANCHER_H
15#define MINOTAURMAXFREQBRANCHER_H
16
17#include "Brancher.h"
18
19namespace Minotaur {
20
21 class Timer;
22
24 UInt calls;
25 double time;
26 };
27
29 class MaxFreqBrancher : public Brancher {
30
31 public:
33 MaxFreqBrancher(EnvPtr env, HandlerVector & handlers);
34
37
38 // Find a branching candidate. Returns NULL if x does not have any
39 // thing to branch on or if no branching candidates are needed.
40 Branches findBranches(RelaxationPtr rel, NodePtr node,
42 BrancherStatus & br_status, ModVector &mods);
43
44 // Update pseudo-cost/other information after branching.
46
47 // write statistics.
48 void writeStats(std::ostream &out) const;
49
50 // Return name.
51 std::string getName() const;
52
58 void initialize(RelaxationPtr rel);
59
60 private:
62 const static std::string me_;
63
65 double zTol_;
66
68 BrancherStatus status_;
69
71 RelaxationPtr rel_;
72
73 DoubleVector x_;
74
79 HandlerVector handlers_;
80
82 Timer *timer_;
83
85 MaxFreqBrStats * stats_;
86
88 BrVarCandSet cands_;
89
91 bool init_;
92
97 UIntVector fracCount_;
98
103 UIntVector unfixedCount_;
104
109 void updateFracCount_();
110
115 void updateUnfixedCount_();
116
118 void findCandidates_();
119
121 BrCandPtr findBestCandidate_();
122
123 };
125}
126#endif
127
Declare the base class Brancher for finding and creating branches in Branch-and-Bound.
Base class for describing candidates for branching on a node in branch-and-bound.
Definition: BrCand.h:32
A brancher is used to find suitable branches for a given node. e.g. LexicoBrancher....
Definition: Brancher.h:33
Definition: Environment.h:28
A class to select a variable for branching using maximum-frequency branching.
Definition: MaxFreqBrancher.h:29
Branches findBranches(RelaxationPtr rel, NodePtr node, ConstSolutionPtr sol, SolutionPoolPtr s_pool, BrancherStatus &br_status, ModVector &mods)
Find a branching candidate.
Definition: MaxFreqBrancher.cpp:60
MaxFreqBrancher(EnvPtr env, HandlerVector &handlers)
Construct using an environment pointer and initialize .
Definition: MaxFreqBrancher.cpp:38
void writeStats(std::ostream &out) const
Write statistics to the given out stream.
Definition: MaxFreqBrancher.cpp:233
~MaxFreqBrancher()
Destroy.
Definition: MaxFreqBrancher.cpp:53
void initialize(RelaxationPtr rel)
Initialize data structures.
Definition: MaxFreqBrancher.cpp:128
std::string getName() const
Return the name of this brancher.
Definition: MaxFreqBrancher.cpp:242
virtual void updateAfterSolve(NodePtr, ConstSolutionPtr)
Update pseudo-costs after LP is solved.
Definition: MaxFreqBrancher.cpp:228
Definition: Node.h:54
Definition: Relaxation.h:53
Definition: SolutionPool.h:28
Definition: Solution.h:30
Definition: Timer.h:40
Definition: ActiveNodeStore.h:20
BrancherStatus
What can a brancher do to a node in branch-and-bound.
Definition: Types.h:193
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
Definition: MaxFreqBrancher.h:23
double time
Number of times called to find a branching candidate.
Definition: MaxFreqBrancher.h:25

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