-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSuperedge.h
54 lines (35 loc) · 1.14 KB
/
Superedge.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
54
#pragma once
// Models a superedge of a hypergraph, an edge consisting of edges.
//
//////////////////////////////////////////////////////////////////////
#if !defined(CLS_SUPEREDGE)
#define CLS_SUPEREDGE
#include <string>
#include <vector>
#include <unordered_set>
#include <algorithm>
#include "NamedEntity.h"
#include "Vertex.h"
#include "Globals.h"
#include "Hyperedge.h"
using namespace std;
class Superedge :
public Hyperedge
{
private:
HyperedgeSet Edges;
public:
//Real Constructors
Superedge(const string& name) : Hyperedge(name) {
}
void add(const HyperedgeVector &Edges, const VertexSet &VertComp);
// Removes Vertices from this edge that are not in vertices
void reduce(const VertexSet &vertices);
static std::shared_ptr<Superedge> getSuperedge(const HyperedgeVector &Edges, const VertexSet &VertComp);
virtual bool isHeavy() const { return true; }
virtual size_t getWeight() const { return Edges.size(); }
virtual void setAllLabels(int label = 0) const;
friend std::ostream& operator<< (std::ostream& stream, const std::shared_ptr<Superedge>& super);
};
using SuperedgeSharedPtr = std::shared_ptr<Superedge>;
#endif