forked from TUfischl/newdetkdecomp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FracImproveDecomp.h
executable file
·54 lines (37 loc) · 1.41 KB
/
FracImproveDecomp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Models the algorithm det-k-decomp.
//
//////////////////////////////////////////////////////////////////////
#if !defined(CLS_FracImproveDecomp)
#define CLS_FracImproveDecomp
#include <set>
#include <vector>
#include "FractionalEdgeCover.h"
#include "DetKDecomp.h"
#include "FecCalculator.h"
class Hypergraph;
class Hyperedge;
class Hypertree;
class Vertex;
class CompSet;
class FracImproveDecomp : DetKDecomp
{
private:
FecCalculator MyFecCalculator;
mutable double globalBestFW;
double threshold;
bool verifyFracHypertreeWidth(HypertreeSharedPtr &htree, double &outFW) const;
VertexSet computeChi(const HyperedgeVector &comp, const shared_ptr<Separator> &Sep, const VertexSet &Connector) const;
// Builds a hypertree decomposition according to k-decomp by covering connector nodes
virtual HypertreeSharedPtr decomp(const HyperedgeVector &HEdges, double &outFW, const VertexSet &Connector = VertexSet(), int RecLevel = 0) const;
virtual HypertreeSharedPtr decomp(const DecompComponent &comp, double &outFW, int recLevel) const {
return decomp(comp.component(), outFW, comp.connector(), recLevel);
}
public:
// Constructor
FracImproveDecomp(const HypergraphSharedPtr &HGraph, int k);
// Destructor
virtual ~FracImproveDecomp();
// Constructs a hypertree decomposition of width at most iK (if it exists)
HypertreeSharedPtr buildHypertree(double minImprovement, double &fw);
};
#endif // !defined(CLS_DetKDecomp)