8
8
9
9
from enum import Enum , unique
10
10
11
+
12
+ class Options (object ):
13
+ """Contains enums for options employed by ged::GEDEnv.
14
+ """
15
+
16
+
17
+ @unique
18
+ class GEDMethod (Enum ):
19
+ """Selects the method.
20
+ """
21
+ # @todo: what is this? #ifdef GUROBI
22
+ F1 = 1 # Selects ged::F1.
23
+ F2 = 2 # Selects ged::F2.
24
+ COMPACT_MIP = 3 # Selects ged::CompactMIP.
25
+ BLP_NO_EDGE_LABELS = 4 # Selects ged::BLPNoEdgeLabels.
26
+ #endif /* GUROBI */
27
+ BRANCH = 5 # Selects ged::Branch.
28
+ BRANCH_FAST = 6 # Selects ged::BranchFast.
29
+ BRANCH_TIGHT = 7 # Selects ged::BranchTight.
30
+ BRANCH_UNIFORM = 8 # Selects ged::BranchUniform.
31
+ BRANCH_COMPACT = 9 # Selects ged::BranchCompact.
32
+ PARTITION = 10 # Selects ged::Partition.
33
+ HYBRID = 11 # Selects ged::Hybrid.
34
+ RING = 12 # Selects ged::Ring.
35
+ ANCHOR_AWARE_GED = 13 # Selects ged::AnchorAwareGED.
36
+ WALKS = 14 # Selects ged::Walks.
37
+ IPFP = 15 # Selects ged::IPFP
38
+ BIPARTITE = 16 # Selects ged::Bipartite.
39
+ SUBGRAPH = 17 # Selects ged::Subgraph.
40
+ NODE = 18 # Selects ged::Node.
41
+ RING_ML = 19 # Selects ged::RingML.
42
+ BIPARTITE_ML = 20 # Selects ged::BipartiteML.
43
+ REFINE = 21 # Selects ged::Refine.
44
+ BP_BEAM = 22 # Selects ged::BPBeam.
45
+ SIMULATED_ANNEALING = 23 # Selects ged::SimulatedAnnealing.
46
+ HED = 24 # Selects ged::HED.
47
+ STAR = 25 # Selects ged::Star.
48
+
49
+
50
+ @unique
51
+ class EditCosts (Enum ):
52
+ """Selects the edit costs.
53
+ """
54
+ CHEM_1 = 1 # Selects ged::CHEM1.
55
+ CHEM_2 = 2 # Selects ged::CHEM2.
56
+ CMU = 3 # Selects ged::CMU.
57
+ GREC_1 = 4 # Selects ged::GREC1.
58
+ GREC_2 = 5 # Selects ged::GREC2.
59
+ PROTEIN = 6 # Selects ged::Protein.
60
+ FINGERPRINT = 7 # Selects ged::Fingerprint.
61
+ LETTER = 8 # Selects ged::Letter.
62
+ LETTER2 = 9 # Selects ged:Letter2.
63
+ NON_SYMBOLIC = 10 # Selects ged:NonSymbolic.
64
+ CONSTANT = 11 # Selects ged::Constant.
65
+
66
+
67
+ @unique
68
+ class InitType (Enum ):
69
+ """@brief Selects the initialization type of the environment.
70
+ * @details If eager initialization is selected, all edit costs are pre-computed when initializing the environment.
71
+ * Otherwise, they are computed at runtime. If initialization with shuffled copies is selected, shuffled copies of
72
+ * all graphs are created. These copies are used when calling ged::GEDEnv::run_method() with two identical graph IDs.
73
+ * In this case, one of the IDs is internally replaced by the ID of the shuffled copy and the graph is hence
74
+ * compared to an isomorphic but non-identical graph. If initialization without shuffled copies is selected, no shuffled copies
75
+ * are created and calling ged::GEDEnv::run_method() with two identical graph IDs amounts to comparing a graph to itself.
76
+ """
77
+ LAZY_WITHOUT_SHUFFLED_COPIES = 1 # Lazy initialization, no shuffled graph copies are constructed.
78
+ EAGER_WITHOUT_SHUFFLED_COPIES = 2 # Eager initialization, no shuffled graph copies are constructed.
79
+ LAZY_WITH_SHUFFLED_COPIES = 3 # Lazy initialization, shuffled graph copies are constructed.
80
+ EAGER_WITH_SHUFFLED_COPIES = 4 # Eager initialization, shuffled graph copies are constructed.
81
+
82
+
83
+ @unique
84
+ class AlgorithmState (Enum ):
85
+ """can be used to specify the state of an algorithm.
86
+ """
87
+ CALLED = 1 # The algorithm has been called.
88
+ INITIALIZED = 2 # The algorithm has been initialized.
89
+ CONVERGED = 3 # The algorithm has converged.
90
+ TERMINATED = 4 # The algorithm has terminated.
91
+
92
+
93
+ class OptionsStringMap (object ):
94
+
95
+
96
+ # Map of available computation methods between enum type and string.
97
+ GEDMethod = {
98
+ "BRANCH" : Options .GEDMethod .BRANCH ,
99
+ "BRANCH_FAST" : Options .GEDMethod .BRANCH_FAST ,
100
+ "BRANCH_TIGHT" : Options .GEDMethod .BRANCH_TIGHT ,
101
+ "BRANCH_UNIFORM" : Options .GEDMethod .BRANCH_UNIFORM ,
102
+ "BRANCH_COMPACT" : Options .GEDMethod .BRANCH_COMPACT ,
103
+ "PARTITION" : Options .GEDMethod .PARTITION ,
104
+ "HYBRID" : Options .GEDMethod .HYBRID ,
105
+ "RING" : Options .GEDMethod .RING ,
106
+ "ANCHOR_AWARE_GED" : Options .GEDMethod .ANCHOR_AWARE_GED ,
107
+ "WALKS" : Options .GEDMethod .WALKS ,
108
+ "IPFP" : Options .GEDMethod .IPFP ,
109
+ "BIPARTITE" : Options .GEDMethod .BIPARTITE ,
110
+ "SUBGRAPH" : Options .GEDMethod .SUBGRAPH ,
111
+ "NODE" : Options .GEDMethod .NODE ,
112
+ "RING_ML" : Options .GEDMethod .RING_ML ,
113
+ "BIPARTITE_ML" : Options .GEDMethod .BIPARTITE_ML ,
114
+ "REFINE" : Options .GEDMethod .REFINE ,
115
+ "BP_BEAM" : Options .GEDMethod .BP_BEAM ,
116
+ "SIMULATED_ANNEALING" : Options .GEDMethod .SIMULATED_ANNEALING ,
117
+ "HED" : Options .GEDMethod .HED ,
118
+ "STAR" : Options .GEDMethod .STAR ,
119
+ # ifdef GUROBI
120
+ "F1" : Options .GEDMethod .F1 ,
121
+ "F2" : Options .GEDMethod .F2 ,
122
+ "COMPACT_MIP" : Options .GEDMethod .COMPACT_MIP ,
123
+ "BLP_NO_EDGE_LABELS" : Options .GEDMethod .BLP_NO_EDGE_LABELS
124
+ }
125
+
126
+
127
+ # Map of available edit cost functions between enum type and string.
128
+ EditCosts = {
129
+ "CHEM_1" : Options .EditCosts .CHEM_1 ,
130
+ "CHEM_2" : Options .EditCosts .CHEM_2 ,
131
+ "CMU" : Options .EditCosts .CMU ,
132
+ "GREC_1" : Options .EditCosts .GREC_1 ,
133
+ "GREC_2" : Options .EditCosts .GREC_2 ,
134
+ "LETTER" : Options .EditCosts .LETTER ,
135
+ "LETTER2" : Options .EditCosts .LETTER2 ,
136
+ "NON_SYMBOLIC" : Options .EditCosts .NON_SYMBOLIC ,
137
+ "FINGERPRINT" : Options .EditCosts .FINGERPRINT ,
138
+ "PROTEIN" : Options .EditCosts .PROTEIN ,
139
+ "CONSTANT" : Options .EditCosts .CONSTANT
140
+ }
141
+
142
+ # Map of available initialization types of the environment between enum type and string.
143
+ InitType = {
144
+ "LAZY_WITHOUT_SHUFFLED_COPIES" : Options .InitType .LAZY_WITHOUT_SHUFFLED_COPIES ,
145
+ "EAGER_WITHOUT_SHUFFLED_COPIES" : Options .InitType .EAGER_WITHOUT_SHUFFLED_COPIES ,
146
+ "LAZY_WITH_SHUFFLED_COPIES" : Options .InitType .LAZY_WITH_SHUFFLED_COPIES ,
147
+ "LAZY_WITH_SHUFFLED_COPIES" : Options .InitType .LAZY_WITH_SHUFFLED_COPIES
148
+ }
149
+
150
+
11
151
@unique
12
152
class AlgorithmState (Enum ):
13
- """can be used to specify the state of an algorithm.
14
- """
15
- CALLED = 1 # The algorithm has been called.
16
- INITIALIZED = 2 # The algorithm has been initialized.
17
- CONVERGED = 3 # The algorithm has converged.
18
- TERMINATED = 4 # The algorithm has terminated.
153
+ """can be used to specify the state of an algorithm.
154
+ """
155
+ CALLED = 1 # The algorithm has been called.
156
+ INITIALIZED = 2 # The algorithm has been initialized.
157
+ CONVERGED = 3 # The algorithm has converged.
158
+ TERMINATED = 4 # The algorithm has terminated.
159
+
0 commit comments