-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.py
443 lines (432 loc) · 38.5 KB
/
util.py
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
from fractions import Fraction
import numpy as np
import math
import matplotlib.pyplot as plt
max_size2possible_t = dict()
# for ms in range(2, 26):
# thresholds = set()
# for t in np.linspace(0, 1, 10000):
# threshold = tuple([max(math.ceil(t * s), 2) for s in range(2, ms + 1)])
# thresholds.add(threshold)
# thresholds = sorted(thresholds)
# t_list = [min(Fraction(th, i + 2) for i, th in enumerate(threshold)) for threshold in thresholds]
# max_size2possible_t[ms] = t_list[:]
max_size2possible_t[2] = [Fraction(1, 1)]
max_size2possible_t[3] = [Fraction(2, 3), Fraction(1, 1)]
max_size2possible_t[4] = [Fraction(1, 2), Fraction(2, 3), Fraction(3, 4), Fraction(1, 1)]
max_size2possible_t[5] = [Fraction(2, 5), Fraction(1, 2), Fraction(3, 5), Fraction(2, 3), Fraction(3, 4),
Fraction(4, 5), Fraction(1, 1)]
max_size2possible_t[6] = [Fraction(1, 3), Fraction(2, 5), Fraction(1, 2), Fraction(3, 5), Fraction(2, 3),
Fraction(3, 4), Fraction(4, 5), Fraction(5, 6), Fraction(1, 1)]
max_size2possible_t[7] = [Fraction(2, 7), Fraction(1, 3), Fraction(2, 5), Fraction(3, 7), Fraction(1, 2),
Fraction(4, 7), Fraction(3, 5), Fraction(2, 3), Fraction(5, 7), Fraction(3, 4),
Fraction(4, 5), Fraction(5, 6), Fraction(6, 7), Fraction(1, 1)]
max_size2possible_t[8] = [Fraction(1, 4), Fraction(2, 7), Fraction(1, 3), Fraction(3, 8), Fraction(2, 5),
Fraction(3, 7), Fraction(1, 2), Fraction(4, 7), Fraction(3, 5), Fraction(5, 8),
Fraction(2, 3), Fraction(5, 7), Fraction(3, 4), Fraction(4, 5), Fraction(5, 6),
Fraction(6, 7), Fraction(7, 8), Fraction(1, 1)]
max_size2possible_t[9] = [Fraction(2, 9), Fraction(1, 4), Fraction(2, 7), Fraction(1, 3), Fraction(1, 3),
Fraction(3, 8), Fraction(2, 5), Fraction(3, 7), Fraction(4, 9), Fraction(1, 2),
Fraction(5, 9), Fraction(4, 7), Fraction(3, 5), Fraction(5, 8), Fraction(2, 3),
Fraction(2, 3), Fraction(5, 7), Fraction(3, 4), Fraction(7, 9), Fraction(4, 5),
Fraction(5, 6), Fraction(6, 7), Fraction(7, 8), Fraction(8, 9), Fraction(1, 1)]
max_size2possible_t[10] = [Fraction(1, 5), Fraction(2, 9), Fraction(1, 4), Fraction(2, 7), Fraction(3, 10),
Fraction(1, 3), Fraction(1, 3), Fraction(3, 8), Fraction(2, 5), Fraction(3, 7),
Fraction(4, 9), Fraction(1, 2), Fraction(5, 9), Fraction(4, 7), Fraction(3, 5),
Fraction(5, 8), Fraction(2, 3), Fraction(2, 3), Fraction(7, 10), Fraction(5, 7),
Fraction(3, 4), Fraction(7, 9), Fraction(4, 5), Fraction(5, 6), Fraction(6, 7),
Fraction(7, 8), Fraction(8, 9), Fraction(9, 10), Fraction(1, 1)]
max_size2possible_t[11] = [Fraction(2, 11), Fraction(1, 5), Fraction(2, 9), Fraction(1, 4), Fraction(3, 11),
Fraction(2, 7), Fraction(3, 10), Fraction(1, 3), Fraction(1, 3), Fraction(4, 11),
Fraction(3, 8), Fraction(2, 5), Fraction(3, 7), Fraction(4, 9), Fraction(5, 11),
Fraction(1, 2), Fraction(6, 11), Fraction(5, 9), Fraction(4, 7), Fraction(3, 5),
Fraction(5, 8), Fraction(7, 11), Fraction(2, 3), Fraction(2, 3), Fraction(7, 10),
Fraction(5, 7), Fraction(8, 11), Fraction(3, 4), Fraction(7, 9), Fraction(4, 5),
Fraction(9, 11), Fraction(5, 6), Fraction(6, 7), Fraction(7, 8), Fraction(8, 9),
Fraction(9, 10), Fraction(10, 11), Fraction(1, 1)]
max_size2possible_t[12] = [Fraction(1, 6), Fraction(2, 11), Fraction(1, 5), Fraction(2, 9), Fraction(1, 4),
Fraction(3, 11), Fraction(2, 7), Fraction(3, 10), Fraction(1, 3), Fraction(1, 3),
Fraction(4, 11), Fraction(3, 8), Fraction(2, 5), Fraction(5, 12), Fraction(3, 7),
Fraction(4, 9), Fraction(5, 11), Fraction(1, 2), Fraction(6, 11), Fraction(5, 9),
Fraction(4, 7), Fraction(7, 12), Fraction(3, 5), Fraction(5, 8), Fraction(7, 11),
Fraction(2, 3), Fraction(2, 3), Fraction(7, 10), Fraction(5, 7), Fraction(8, 11),
Fraction(3, 4), Fraction(7, 9), Fraction(4, 5), Fraction(9, 11), Fraction(5, 6),
Fraction(6, 7), Fraction(7, 8), Fraction(8, 9), Fraction(9, 10), Fraction(10, 11),
Fraction(11, 12), Fraction(1, 1)]
max_size2possible_t[13] = [Fraction(2, 13), Fraction(1, 6), Fraction(2, 11), Fraction(1, 5), Fraction(2, 9),
Fraction(3, 13), Fraction(1, 4), Fraction(3, 11), Fraction(2, 7), Fraction(3, 10),
Fraction(4, 13), Fraction(1, 3), Fraction(1, 3), Fraction(4, 11), Fraction(3, 8),
Fraction(5, 13), Fraction(2, 5), Fraction(5, 12), Fraction(3, 7), Fraction(4, 9),
Fraction(5, 11), Fraction(6, 13), Fraction(1, 2), Fraction(7, 13), Fraction(6, 11),
Fraction(5, 9), Fraction(4, 7), Fraction(7, 12), Fraction(3, 5), Fraction(8, 13),
Fraction(5, 8), Fraction(7, 11), Fraction(2, 3), Fraction(2, 3), Fraction(9, 13),
Fraction(7, 10), Fraction(5, 7), Fraction(8, 11), Fraction(3, 4), Fraction(10, 13),
Fraction(7, 9), Fraction(4, 5), Fraction(9, 11), Fraction(5, 6), Fraction(11, 13),
Fraction(6, 7), Fraction(7, 8), Fraction(8, 9), Fraction(9, 10), Fraction(10, 11),
Fraction(11, 12), Fraction(12, 13), Fraction(1, 1)]
max_size2possible_t[14] = [Fraction(1, 7), Fraction(2, 13), Fraction(1, 6), Fraction(2, 11), Fraction(1, 5),
Fraction(3, 14), Fraction(2, 9), Fraction(3, 13), Fraction(1, 4), Fraction(3, 11),
Fraction(2, 7), Fraction(3, 10), Fraction(4, 13), Fraction(1, 3), Fraction(1, 3),
Fraction(5, 14), Fraction(4, 11), Fraction(3, 8), Fraction(5, 13), Fraction(2, 5),
Fraction(5, 12), Fraction(3, 7), Fraction(4, 9), Fraction(5, 11), Fraction(6, 13),
Fraction(1, 2), Fraction(7, 13), Fraction(6, 11), Fraction(5, 9), Fraction(4, 7),
Fraction(7, 12), Fraction(3, 5), Fraction(8, 13), Fraction(5, 8), Fraction(7, 11),
Fraction(9, 14), Fraction(2, 3), Fraction(2, 3), Fraction(9, 13), Fraction(7, 10),
Fraction(5, 7), Fraction(8, 11), Fraction(3, 4), Fraction(10, 13), Fraction(7, 9),
Fraction(11, 14), Fraction(4, 5), Fraction(9, 11), Fraction(5, 6), Fraction(11, 13),
Fraction(6, 7), Fraction(7, 8), Fraction(8, 9), Fraction(9, 10), Fraction(10, 11),
Fraction(11, 12), Fraction(12, 13), Fraction(13, 14), Fraction(1, 1)]
max_size2possible_t[15] = [Fraction(2, 15), Fraction(1, 7), Fraction(2, 13), Fraction(1, 6), Fraction(2, 11),
Fraction(1, 5), Fraction(3, 14), Fraction(2, 9), Fraction(3, 13), Fraction(1, 4),
Fraction(4, 15), Fraction(3, 11), Fraction(2, 7), Fraction(3, 10), Fraction(4, 13),
Fraction(1, 3), Fraction(1, 3), Fraction(5, 14), Fraction(4, 11), Fraction(3, 8),
Fraction(5, 13), Fraction(2, 5), Fraction(5, 12), Fraction(3, 7), Fraction(4, 9),
Fraction(5, 11), Fraction(6, 13), Fraction(7, 15), Fraction(1, 2), Fraction(8, 15),
Fraction(7, 13), Fraction(6, 11), Fraction(5, 9), Fraction(4, 7), Fraction(7, 12),
Fraction(3, 5), Fraction(8, 13), Fraction(5, 8), Fraction(7, 11), Fraction(9, 14),
Fraction(2, 3), Fraction(2, 3), Fraction(9, 13), Fraction(7, 10), Fraction(5, 7),
Fraction(8, 11), Fraction(11, 15), Fraction(3, 4), Fraction(10, 13), Fraction(7, 9),
Fraction(11, 14), Fraction(4, 5), Fraction(9, 11), Fraction(5, 6), Fraction(11, 13),
Fraction(6, 7), Fraction(13, 15), Fraction(7, 8), Fraction(8, 9), Fraction(9, 10),
Fraction(10, 11), Fraction(11, 12), Fraction(12, 13), Fraction(13, 14), Fraction(14, 15),
Fraction(1, 1)]
max_size2possible_t[16] = [Fraction(1, 8), Fraction(2, 15), Fraction(1, 7), Fraction(2, 13), Fraction(1, 6),
Fraction(2, 11), Fraction(3, 16), Fraction(1, 5), Fraction(3, 14), Fraction(2, 9),
Fraction(3, 13), Fraction(1, 4), Fraction(4, 15), Fraction(3, 11), Fraction(2, 7),
Fraction(3, 10), Fraction(4, 13), Fraction(5, 16), Fraction(1, 3), Fraction(1, 3),
Fraction(5, 14), Fraction(4, 11), Fraction(3, 8), Fraction(5, 13), Fraction(2, 5),
Fraction(5, 12), Fraction(3, 7), Fraction(7, 16), Fraction(4, 9), Fraction(5, 11),
Fraction(6, 13), Fraction(7, 15), Fraction(1, 2), Fraction(8, 15), Fraction(7, 13),
Fraction(6, 11), Fraction(5, 9), Fraction(9, 16), Fraction(4, 7), Fraction(7, 12),
Fraction(3, 5), Fraction(8, 13), Fraction(5, 8), Fraction(7, 11), Fraction(9, 14),
Fraction(2, 3), Fraction(2, 3), Fraction(11, 16), Fraction(9, 13), Fraction(7, 10),
Fraction(5, 7), Fraction(8, 11), Fraction(11, 15), Fraction(3, 4), Fraction(10, 13),
Fraction(7, 9), Fraction(11, 14), Fraction(4, 5), Fraction(13, 16), Fraction(9, 11),
Fraction(5, 6), Fraction(11, 13), Fraction(6, 7), Fraction(13, 15), Fraction(7, 8),
Fraction(8, 9), Fraction(9, 10), Fraction(10, 11), Fraction(11, 12), Fraction(12, 13),
Fraction(13, 14), Fraction(14, 15), Fraction(15, 16), Fraction(1, 1)]
max_size2possible_t[17] = [Fraction(2, 17), Fraction(1, 8), Fraction(2, 15), Fraction(1, 7), Fraction(2, 13),
Fraction(1, 6), Fraction(3, 17), Fraction(2, 11), Fraction(3, 16), Fraction(1, 5),
Fraction(3, 14), Fraction(2, 9), Fraction(3, 13), Fraction(4, 17), Fraction(1, 4),
Fraction(4, 15), Fraction(3, 11), Fraction(2, 7), Fraction(5, 17), Fraction(3, 10),
Fraction(4, 13), Fraction(5, 16), Fraction(1, 3), Fraction(1, 3), Fraction(6, 17),
Fraction(5, 14), Fraction(4, 11), Fraction(3, 8), Fraction(5, 13), Fraction(2, 5),
Fraction(7, 17), Fraction(5, 12), Fraction(3, 7), Fraction(7, 16), Fraction(4, 9),
Fraction(5, 11), Fraction(6, 13), Fraction(7, 15), Fraction(8, 17), Fraction(1, 2),
Fraction(9, 17), Fraction(8, 15), Fraction(7, 13), Fraction(6, 11), Fraction(5, 9),
Fraction(9, 16), Fraction(4, 7), Fraction(7, 12), Fraction(10, 17), Fraction(3, 5),
Fraction(8, 13), Fraction(5, 8), Fraction(7, 11), Fraction(9, 14), Fraction(11, 17),
Fraction(2, 3), Fraction(2, 3), Fraction(11, 16), Fraction(9, 13), Fraction(7, 10),
Fraction(12, 17), Fraction(5, 7), Fraction(8, 11), Fraction(11, 15), Fraction(3, 4),
Fraction(13, 17), Fraction(10, 13), Fraction(7, 9), Fraction(11, 14), Fraction(4, 5),
Fraction(13, 16), Fraction(9, 11), Fraction(14, 17), Fraction(5, 6), Fraction(11, 13),
Fraction(6, 7), Fraction(13, 15), Fraction(7, 8), Fraction(15, 17), Fraction(8, 9),
Fraction(9, 10), Fraction(10, 11), Fraction(11, 12), Fraction(12, 13), Fraction(13, 14),
Fraction(14, 15), Fraction(15, 16), Fraction(16, 17), Fraction(1, 1)]
max_size2possible_t[18] = [Fraction(1, 9), Fraction(2, 17), Fraction(1, 8), Fraction(2, 15), Fraction(1, 7),
Fraction(2, 13), Fraction(1, 6), Fraction(3, 17), Fraction(2, 11), Fraction(3, 16),
Fraction(1, 5), Fraction(3, 14), Fraction(2, 9), Fraction(3, 13), Fraction(4, 17),
Fraction(1, 4), Fraction(4, 15), Fraction(3, 11), Fraction(5, 18), Fraction(2, 7),
Fraction(5, 17), Fraction(3, 10), Fraction(4, 13), Fraction(5, 16), Fraction(1, 3),
Fraction(1, 3), Fraction(6, 17), Fraction(5, 14), Fraction(4, 11), Fraction(3, 8),
Fraction(5, 13), Fraction(7, 18), Fraction(2, 5), Fraction(7, 17), Fraction(5, 12),
Fraction(3, 7), Fraction(7, 16), Fraction(4, 9), Fraction(5, 11), Fraction(6, 13),
Fraction(7, 15), Fraction(8, 17), Fraction(1, 2), Fraction(9, 17), Fraction(8, 15),
Fraction(7, 13), Fraction(6, 11), Fraction(5, 9), Fraction(9, 16), Fraction(4, 7),
Fraction(7, 12), Fraction(10, 17), Fraction(3, 5), Fraction(11, 18), Fraction(8, 13),
Fraction(5, 8), Fraction(7, 11), Fraction(9, 14), Fraction(11, 17), Fraction(2, 3),
Fraction(2, 3), Fraction(11, 16), Fraction(9, 13), Fraction(7, 10), Fraction(12, 17),
Fraction(5, 7), Fraction(13, 18), Fraction(8, 11), Fraction(11, 15), Fraction(3, 4),
Fraction(13, 17), Fraction(10, 13), Fraction(7, 9), Fraction(11, 14), Fraction(4, 5),
Fraction(13, 16), Fraction(9, 11), Fraction(14, 17), Fraction(5, 6), Fraction(11, 13),
Fraction(6, 7), Fraction(13, 15), Fraction(7, 8), Fraction(15, 17), Fraction(8, 9),
Fraction(9, 10), Fraction(10, 11), Fraction(11, 12), Fraction(12, 13), Fraction(13, 14),
Fraction(14, 15), Fraction(15, 16), Fraction(16, 17), Fraction(17, 18), Fraction(1, 1)]
max_size2possible_t[19] = [Fraction(2, 19), Fraction(1, 9), Fraction(2, 17), Fraction(1, 8), Fraction(2, 15),
Fraction(1, 7), Fraction(2, 13), Fraction(3, 19), Fraction(1, 6), Fraction(3, 17),
Fraction(2, 11), Fraction(3, 16), Fraction(1, 5), Fraction(4, 19), Fraction(3, 14),
Fraction(2, 9), Fraction(3, 13), Fraction(4, 17), Fraction(1, 4), Fraction(5, 19),
Fraction(4, 15), Fraction(3, 11), Fraction(5, 18), Fraction(2, 7), Fraction(5, 17),
Fraction(3, 10), Fraction(4, 13), Fraction(5, 16), Fraction(6, 19), Fraction(1, 3),
Fraction(1, 3), Fraction(6, 17), Fraction(5, 14), Fraction(4, 11), Fraction(7, 19),
Fraction(3, 8), Fraction(5, 13), Fraction(7, 18), Fraction(2, 5), Fraction(7, 17),
Fraction(5, 12), Fraction(8, 19), Fraction(3, 7), Fraction(7, 16), Fraction(4, 9),
Fraction(5, 11), Fraction(6, 13), Fraction(7, 15), Fraction(8, 17), Fraction(9, 19),
Fraction(1, 2), Fraction(10, 19), Fraction(9, 17), Fraction(8, 15), Fraction(7, 13),
Fraction(6, 11), Fraction(5, 9), Fraction(9, 16), Fraction(4, 7), Fraction(11, 19),
Fraction(7, 12), Fraction(10, 17), Fraction(3, 5), Fraction(11, 18), Fraction(8, 13),
Fraction(5, 8), Fraction(12, 19), Fraction(7, 11), Fraction(9, 14), Fraction(11, 17),
Fraction(2, 3), Fraction(2, 3), Fraction(13, 19), Fraction(11, 16), Fraction(9, 13),
Fraction(7, 10), Fraction(12, 17), Fraction(5, 7), Fraction(13, 18), Fraction(8, 11),
Fraction(11, 15), Fraction(14, 19), Fraction(3, 4), Fraction(13, 17), Fraction(10, 13),
Fraction(7, 9), Fraction(11, 14), Fraction(15, 19), Fraction(4, 5), Fraction(13, 16),
Fraction(9, 11), Fraction(14, 17), Fraction(5, 6), Fraction(16, 19), Fraction(11, 13),
Fraction(6, 7), Fraction(13, 15), Fraction(7, 8), Fraction(15, 17), Fraction(8, 9),
Fraction(17, 19), Fraction(9, 10), Fraction(10, 11), Fraction(11, 12), Fraction(12, 13),
Fraction(13, 14), Fraction(14, 15), Fraction(15, 16), Fraction(16, 17), Fraction(17, 18),
Fraction(18, 19), Fraction(1, 1)]
max_size2possible_t[20] = [Fraction(1, 10), Fraction(2, 19), Fraction(1, 9), Fraction(2, 17), Fraction(1, 8),
Fraction(2, 15), Fraction(1, 7), Fraction(3, 20), Fraction(2, 13), Fraction(3, 19),
Fraction(1, 6), Fraction(3, 17), Fraction(2, 11), Fraction(3, 16), Fraction(1, 5),
Fraction(4, 19), Fraction(3, 14), Fraction(2, 9), Fraction(3, 13), Fraction(4, 17),
Fraction(1, 4), Fraction(5, 19), Fraction(4, 15), Fraction(3, 11), Fraction(5, 18),
Fraction(2, 7), Fraction(5, 17), Fraction(3, 10), Fraction(4, 13), Fraction(5, 16),
Fraction(6, 19), Fraction(1, 3), Fraction(1, 3), Fraction(7, 20), Fraction(6, 17),
Fraction(5, 14), Fraction(4, 11), Fraction(7, 19), Fraction(3, 8), Fraction(5, 13),
Fraction(7, 18), Fraction(2, 5), Fraction(7, 17), Fraction(5, 12), Fraction(8, 19),
Fraction(3, 7), Fraction(7, 16), Fraction(4, 9), Fraction(9, 20), Fraction(5, 11),
Fraction(6, 13), Fraction(7, 15), Fraction(8, 17), Fraction(9, 19), Fraction(1, 2),
Fraction(10, 19), Fraction(9, 17), Fraction(8, 15), Fraction(7, 13), Fraction(6, 11),
Fraction(11, 20), Fraction(5, 9), Fraction(9, 16), Fraction(4, 7), Fraction(11, 19),
Fraction(7, 12), Fraction(10, 17), Fraction(3, 5), Fraction(11, 18), Fraction(8, 13),
Fraction(5, 8), Fraction(12, 19), Fraction(7, 11), Fraction(9, 14), Fraction(11, 17),
Fraction(13, 20), Fraction(2, 3), Fraction(2, 3), Fraction(13, 19), Fraction(11, 16),
Fraction(9, 13), Fraction(7, 10), Fraction(12, 17), Fraction(5, 7), Fraction(13, 18),
Fraction(8, 11), Fraction(11, 15), Fraction(14, 19), Fraction(3, 4), Fraction(13, 17),
Fraction(10, 13), Fraction(7, 9), Fraction(11, 14), Fraction(15, 19), Fraction(4, 5),
Fraction(13, 16), Fraction(9, 11), Fraction(14, 17), Fraction(5, 6), Fraction(16, 19),
Fraction(11, 13), Fraction(17, 20), Fraction(6, 7), Fraction(13, 15), Fraction(7, 8),
Fraction(15, 17), Fraction(8, 9), Fraction(17, 19), Fraction(9, 10), Fraction(10, 11),
Fraction(11, 12), Fraction(12, 13), Fraction(13, 14), Fraction(14, 15), Fraction(15, 16),
Fraction(16, 17), Fraction(17, 18), Fraction(18, 19), Fraction(19, 20), Fraction(1, 1)]
max_size2possible_t[21] = [Fraction(2, 21), Fraction(1, 10), Fraction(2, 19), Fraction(1, 9), Fraction(2, 17),
Fraction(1, 8), Fraction(2, 15), Fraction(1, 7), Fraction(3, 20), Fraction(2, 13),
Fraction(3, 19), Fraction(1, 6), Fraction(3, 17), Fraction(2, 11), Fraction(3, 16),
Fraction(4, 21), Fraction(1, 5), Fraction(4, 19), Fraction(3, 14), Fraction(2, 9),
Fraction(3, 13), Fraction(4, 17), Fraction(5, 21), Fraction(1, 4), Fraction(5, 19),
Fraction(4, 15), Fraction(3, 11), Fraction(5, 18), Fraction(2, 7), Fraction(5, 17),
Fraction(3, 10), Fraction(4, 13), Fraction(5, 16), Fraction(6, 19), Fraction(1, 3),
Fraction(1, 3), Fraction(7, 20), Fraction(6, 17), Fraction(5, 14), Fraction(4, 11),
Fraction(7, 19), Fraction(3, 8), Fraction(8, 21), Fraction(5, 13), Fraction(7, 18),
Fraction(2, 5), Fraction(7, 17), Fraction(5, 12), Fraction(8, 19), Fraction(3, 7),
Fraction(7, 16), Fraction(4, 9), Fraction(9, 20), Fraction(5, 11), Fraction(6, 13),
Fraction(7, 15), Fraction(8, 17), Fraction(9, 19), Fraction(10, 21), Fraction(1, 2),
Fraction(11, 21), Fraction(10, 19), Fraction(9, 17), Fraction(8, 15), Fraction(7, 13),
Fraction(6, 11), Fraction(11, 20), Fraction(5, 9), Fraction(9, 16), Fraction(4, 7),
Fraction(11, 19), Fraction(7, 12), Fraction(10, 17), Fraction(3, 5), Fraction(11, 18),
Fraction(8, 13), Fraction(13, 21), Fraction(5, 8), Fraction(12, 19), Fraction(7, 11),
Fraction(9, 14), Fraction(11, 17), Fraction(13, 20), Fraction(2, 3), Fraction(2, 3),
Fraction(13, 19), Fraction(11, 16), Fraction(9, 13), Fraction(7, 10), Fraction(12, 17),
Fraction(5, 7), Fraction(13, 18), Fraction(8, 11), Fraction(11, 15), Fraction(14, 19),
Fraction(3, 4), Fraction(16, 21), Fraction(13, 17), Fraction(10, 13), Fraction(7, 9),
Fraction(11, 14), Fraction(15, 19), Fraction(4, 5), Fraction(17, 21), Fraction(13, 16),
Fraction(9, 11), Fraction(14, 17), Fraction(5, 6), Fraction(16, 19), Fraction(11, 13),
Fraction(17, 20), Fraction(6, 7), Fraction(13, 15), Fraction(7, 8), Fraction(15, 17),
Fraction(8, 9), Fraction(17, 19), Fraction(9, 10), Fraction(19, 21), Fraction(10, 11),
Fraction(11, 12), Fraction(12, 13), Fraction(13, 14), Fraction(14, 15), Fraction(15, 16),
Fraction(16, 17), Fraction(17, 18), Fraction(18, 19), Fraction(19, 20), Fraction(20, 21),
Fraction(1, 1)]
max_size2possible_t[22] = [Fraction(1, 11), Fraction(2, 21), Fraction(1, 10), Fraction(2, 19), Fraction(1, 9),
Fraction(2, 17), Fraction(1, 8), Fraction(2, 15), Fraction(3, 22), Fraction(1, 7),
Fraction(3, 20), Fraction(2, 13), Fraction(3, 19), Fraction(1, 6), Fraction(3, 17),
Fraction(2, 11), Fraction(3, 16), Fraction(4, 21), Fraction(1, 5), Fraction(4, 19),
Fraction(3, 14), Fraction(2, 9), Fraction(5, 22), Fraction(3, 13), Fraction(4, 17),
Fraction(5, 21), Fraction(1, 4), Fraction(5, 19), Fraction(4, 15), Fraction(3, 11),
Fraction(5, 18), Fraction(2, 7), Fraction(5, 17), Fraction(3, 10), Fraction(4, 13),
Fraction(5, 16), Fraction(6, 19), Fraction(7, 22), Fraction(1, 3), Fraction(1, 3),
Fraction(7, 20), Fraction(6, 17), Fraction(5, 14), Fraction(4, 11), Fraction(7, 19),
Fraction(3, 8), Fraction(8, 21), Fraction(5, 13), Fraction(7, 18), Fraction(2, 5),
Fraction(9, 22), Fraction(7, 17), Fraction(5, 12), Fraction(8, 19), Fraction(3, 7),
Fraction(7, 16), Fraction(4, 9), Fraction(9, 20), Fraction(5, 11), Fraction(6, 13),
Fraction(7, 15), Fraction(8, 17), Fraction(9, 19), Fraction(10, 21), Fraction(1, 2),
Fraction(11, 21), Fraction(10, 19), Fraction(9, 17), Fraction(8, 15), Fraction(7, 13),
Fraction(6, 11), Fraction(11, 20), Fraction(5, 9), Fraction(9, 16), Fraction(4, 7),
Fraction(11, 19), Fraction(7, 12), Fraction(10, 17), Fraction(13, 22), Fraction(3, 5),
Fraction(11, 18), Fraction(8, 13), Fraction(13, 21), Fraction(5, 8), Fraction(12, 19),
Fraction(7, 11), Fraction(9, 14), Fraction(11, 17), Fraction(13, 20), Fraction(2, 3),
Fraction(2, 3), Fraction(15, 22), Fraction(13, 19), Fraction(11, 16), Fraction(9, 13),
Fraction(7, 10), Fraction(12, 17), Fraction(5, 7), Fraction(13, 18), Fraction(8, 11),
Fraction(11, 15), Fraction(14, 19), Fraction(3, 4), Fraction(16, 21), Fraction(13, 17),
Fraction(10, 13), Fraction(17, 22), Fraction(7, 9), Fraction(11, 14), Fraction(15, 19),
Fraction(4, 5), Fraction(17, 21), Fraction(13, 16), Fraction(9, 11), Fraction(14, 17),
Fraction(5, 6), Fraction(16, 19), Fraction(11, 13), Fraction(17, 20), Fraction(6, 7),
Fraction(19, 22), Fraction(13, 15), Fraction(7, 8), Fraction(15, 17), Fraction(8, 9),
Fraction(17, 19), Fraction(9, 10), Fraction(19, 21), Fraction(10, 11), Fraction(11, 12),
Fraction(12, 13), Fraction(13, 14), Fraction(14, 15), Fraction(15, 16), Fraction(16, 17),
Fraction(17, 18), Fraction(18, 19), Fraction(19, 20), Fraction(20, 21), Fraction(21, 22),
Fraction(1, 1)]
max_size2possible_t[23] = [Fraction(2, 23), Fraction(1, 11), Fraction(2, 21), Fraction(1, 10), Fraction(2, 19),
Fraction(1, 9), Fraction(2, 17), Fraction(1, 8), Fraction(3, 23), Fraction(2, 15),
Fraction(3, 22), Fraction(1, 7), Fraction(3, 20), Fraction(2, 13), Fraction(3, 19),
Fraction(1, 6), Fraction(4, 23), Fraction(3, 17), Fraction(2, 11), Fraction(3, 16),
Fraction(4, 21), Fraction(1, 5), Fraction(4, 19), Fraction(3, 14), Fraction(5, 23),
Fraction(2, 9), Fraction(5, 22), Fraction(3, 13), Fraction(4, 17), Fraction(5, 21),
Fraction(1, 4), Fraction(6, 23), Fraction(5, 19), Fraction(4, 15), Fraction(3, 11),
Fraction(5, 18), Fraction(2, 7), Fraction(5, 17), Fraction(3, 10), Fraction(7, 23),
Fraction(4, 13), Fraction(5, 16), Fraction(6, 19), Fraction(7, 22), Fraction(1, 3),
Fraction(1, 3), Fraction(8, 23), Fraction(7, 20), Fraction(6, 17), Fraction(5, 14),
Fraction(4, 11), Fraction(7, 19), Fraction(3, 8), Fraction(8, 21), Fraction(5, 13),
Fraction(7, 18), Fraction(9, 23), Fraction(2, 5), Fraction(9, 22), Fraction(7, 17),
Fraction(5, 12), Fraction(8, 19), Fraction(3, 7), Fraction(10, 23), Fraction(7, 16),
Fraction(4, 9), Fraction(9, 20), Fraction(5, 11), Fraction(6, 13), Fraction(7, 15),
Fraction(8, 17), Fraction(9, 19), Fraction(10, 21), Fraction(11, 23), Fraction(1, 2),
Fraction(12, 23), Fraction(11, 21), Fraction(10, 19), Fraction(9, 17), Fraction(8, 15),
Fraction(7, 13), Fraction(6, 11), Fraction(11, 20), Fraction(5, 9), Fraction(9, 16),
Fraction(13, 23), Fraction(4, 7), Fraction(11, 19), Fraction(7, 12), Fraction(10, 17),
Fraction(13, 22), Fraction(3, 5), Fraction(14, 23), Fraction(11, 18), Fraction(8, 13),
Fraction(13, 21), Fraction(5, 8), Fraction(12, 19), Fraction(7, 11), Fraction(9, 14),
Fraction(11, 17), Fraction(13, 20), Fraction(15, 23), Fraction(2, 3), Fraction(2, 3),
Fraction(15, 22), Fraction(13, 19), Fraction(11, 16), Fraction(9, 13), Fraction(16, 23),
Fraction(7, 10), Fraction(12, 17), Fraction(5, 7), Fraction(13, 18), Fraction(8, 11),
Fraction(11, 15), Fraction(14, 19), Fraction(17, 23), Fraction(3, 4), Fraction(16, 21),
Fraction(13, 17), Fraction(10, 13), Fraction(17, 22), Fraction(7, 9), Fraction(18, 23),
Fraction(11, 14), Fraction(15, 19), Fraction(4, 5), Fraction(17, 21), Fraction(13, 16),
Fraction(9, 11), Fraction(14, 17), Fraction(19, 23), Fraction(5, 6), Fraction(16, 19),
Fraction(11, 13), Fraction(17, 20), Fraction(6, 7), Fraction(19, 22), Fraction(13, 15),
Fraction(20, 23), Fraction(7, 8), Fraction(15, 17), Fraction(8, 9), Fraction(17, 19),
Fraction(9, 10), Fraction(19, 21), Fraction(10, 11), Fraction(21, 23), Fraction(11, 12),
Fraction(12, 13), Fraction(13, 14), Fraction(14, 15), Fraction(15, 16), Fraction(16, 17),
Fraction(17, 18), Fraction(18, 19), Fraction(19, 20), Fraction(20, 21), Fraction(21, 22),
Fraction(22, 23), Fraction(1, 1)]
max_size2possible_t[24] = [Fraction(1, 12), Fraction(2, 23), Fraction(1, 11), Fraction(2, 21), Fraction(1, 10),
Fraction(2, 19), Fraction(1, 9), Fraction(2, 17), Fraction(1, 8), Fraction(3, 23),
Fraction(2, 15), Fraction(3, 22), Fraction(1, 7), Fraction(3, 20), Fraction(2, 13),
Fraction(3, 19), Fraction(1, 6), Fraction(4, 23), Fraction(3, 17), Fraction(2, 11),
Fraction(3, 16), Fraction(4, 21), Fraction(1, 5), Fraction(5, 24), Fraction(4, 19),
Fraction(3, 14), Fraction(5, 23), Fraction(2, 9), Fraction(5, 22), Fraction(3, 13),
Fraction(4, 17), Fraction(5, 21), Fraction(1, 4), Fraction(6, 23), Fraction(5, 19),
Fraction(4, 15), Fraction(3, 11), Fraction(5, 18), Fraction(2, 7), Fraction(7, 24),
Fraction(5, 17), Fraction(3, 10), Fraction(7, 23), Fraction(4, 13), Fraction(5, 16),
Fraction(6, 19), Fraction(7, 22), Fraction(1, 3), Fraction(1, 3), Fraction(8, 23),
Fraction(7, 20), Fraction(6, 17), Fraction(5, 14), Fraction(4, 11), Fraction(7, 19),
Fraction(3, 8), Fraction(8, 21), Fraction(5, 13), Fraction(7, 18), Fraction(9, 23),
Fraction(2, 5), Fraction(9, 22), Fraction(7, 17), Fraction(5, 12), Fraction(8, 19),
Fraction(3, 7), Fraction(10, 23), Fraction(7, 16), Fraction(4, 9), Fraction(9, 20),
Fraction(5, 11), Fraction(11, 24), Fraction(6, 13), Fraction(7, 15), Fraction(8, 17),
Fraction(9, 19), Fraction(10, 21), Fraction(11, 23), Fraction(1, 2), Fraction(12, 23),
Fraction(11, 21), Fraction(10, 19), Fraction(9, 17), Fraction(8, 15), Fraction(7, 13),
Fraction(13, 24), Fraction(6, 11), Fraction(11, 20), Fraction(5, 9), Fraction(9, 16),
Fraction(13, 23), Fraction(4, 7), Fraction(11, 19), Fraction(7, 12), Fraction(10, 17),
Fraction(13, 22), Fraction(3, 5), Fraction(14, 23), Fraction(11, 18), Fraction(8, 13),
Fraction(13, 21), Fraction(5, 8), Fraction(12, 19), Fraction(7, 11), Fraction(9, 14),
Fraction(11, 17), Fraction(13, 20), Fraction(15, 23), Fraction(2, 3), Fraction(2, 3),
Fraction(15, 22), Fraction(13, 19), Fraction(11, 16), Fraction(9, 13), Fraction(16, 23),
Fraction(7, 10), Fraction(12, 17), Fraction(17, 24), Fraction(5, 7), Fraction(13, 18),
Fraction(8, 11), Fraction(11, 15), Fraction(14, 19), Fraction(17, 23), Fraction(3, 4),
Fraction(16, 21), Fraction(13, 17), Fraction(10, 13), Fraction(17, 22), Fraction(7, 9),
Fraction(18, 23), Fraction(11, 14), Fraction(15, 19), Fraction(19, 24), Fraction(4, 5),
Fraction(17, 21), Fraction(13, 16), Fraction(9, 11), Fraction(14, 17), Fraction(19, 23),
Fraction(5, 6), Fraction(16, 19), Fraction(11, 13), Fraction(17, 20), Fraction(6, 7),
Fraction(19, 22), Fraction(13, 15), Fraction(20, 23), Fraction(7, 8), Fraction(15, 17),
Fraction(8, 9), Fraction(17, 19), Fraction(9, 10), Fraction(19, 21), Fraction(10, 11),
Fraction(21, 23), Fraction(11, 12), Fraction(12, 13), Fraction(13, 14), Fraction(14, 15),
Fraction(15, 16), Fraction(16, 17), Fraction(17, 18), Fraction(18, 19), Fraction(19, 20),
Fraction(20, 21), Fraction(21, 22), Fraction(22, 23), Fraction(23, 24), Fraction(1, 1)]
max_size2possible_t[25] = [Fraction(2, 25), Fraction(1, 12), Fraction(2, 23), Fraction(1, 11), Fraction(2, 21),
Fraction(1, 10), Fraction(2, 19), Fraction(1, 9), Fraction(2, 17), Fraction(3, 25),
Fraction(1, 8), Fraction(3, 23), Fraction(2, 15), Fraction(3, 22), Fraction(1, 7),
Fraction(3, 20), Fraction(2, 13), Fraction(3, 19), Fraction(4, 25), Fraction(1, 6),
Fraction(4, 23), Fraction(3, 17), Fraction(2, 11), Fraction(3, 16), Fraction(4, 21),
Fraction(1, 5), Fraction(5, 24), Fraction(4, 19), Fraction(3, 14), Fraction(5, 23),
Fraction(2, 9), Fraction(5, 22), Fraction(3, 13), Fraction(4, 17), Fraction(5, 21),
Fraction(6, 25), Fraction(1, 4), Fraction(6, 23), Fraction(5, 19), Fraction(4, 15),
Fraction(3, 11), Fraction(5, 18), Fraction(7, 25), Fraction(2, 7), Fraction(7, 24),
Fraction(5, 17), Fraction(3, 10), Fraction(7, 23), Fraction(4, 13), Fraction(5, 16),
Fraction(6, 19), Fraction(7, 22), Fraction(8, 25), Fraction(1, 3), Fraction(1, 3),
Fraction(8, 23), Fraction(7, 20), Fraction(6, 17), Fraction(5, 14), Fraction(9, 25),
Fraction(4, 11), Fraction(7, 19), Fraction(3, 8), Fraction(8, 21), Fraction(5, 13),
Fraction(7, 18), Fraction(9, 23), Fraction(2, 5), Fraction(9, 22), Fraction(7, 17),
Fraction(5, 12), Fraction(8, 19), Fraction(3, 7), Fraction(10, 23), Fraction(7, 16),
Fraction(11, 25), Fraction(4, 9), Fraction(9, 20), Fraction(5, 11), Fraction(11, 24),
Fraction(6, 13), Fraction(7, 15), Fraction(8, 17), Fraction(9, 19), Fraction(10, 21),
Fraction(11, 23), Fraction(12, 25), Fraction(1, 2), Fraction(13, 25), Fraction(12, 23),
Fraction(11, 21), Fraction(10, 19), Fraction(9, 17), Fraction(8, 15), Fraction(7, 13),
Fraction(13, 24), Fraction(6, 11), Fraction(11, 20), Fraction(5, 9), Fraction(14, 25),
Fraction(9, 16), Fraction(13, 23), Fraction(4, 7), Fraction(11, 19), Fraction(7, 12),
Fraction(10, 17), Fraction(13, 22), Fraction(3, 5), Fraction(14, 23), Fraction(11, 18),
Fraction(8, 13), Fraction(13, 21), Fraction(5, 8), Fraction(12, 19), Fraction(7, 11),
Fraction(16, 25), Fraction(9, 14), Fraction(11, 17), Fraction(13, 20), Fraction(15, 23),
Fraction(2, 3), Fraction(2, 3), Fraction(17, 25), Fraction(15, 22), Fraction(13, 19),
Fraction(11, 16), Fraction(9, 13), Fraction(16, 23), Fraction(7, 10), Fraction(12, 17),
Fraction(17, 24), Fraction(5, 7), Fraction(18, 25), Fraction(13, 18), Fraction(8, 11),
Fraction(11, 15), Fraction(14, 19), Fraction(17, 23), Fraction(3, 4), Fraction(19, 25),
Fraction(16, 21), Fraction(13, 17), Fraction(10, 13), Fraction(17, 22), Fraction(7, 9),
Fraction(18, 23), Fraction(11, 14), Fraction(15, 19), Fraction(19, 24), Fraction(4, 5),
Fraction(17, 21), Fraction(13, 16), Fraction(9, 11), Fraction(14, 17), Fraction(19, 23),
Fraction(5, 6), Fraction(21, 25), Fraction(16, 19), Fraction(11, 13), Fraction(17, 20),
Fraction(6, 7), Fraction(19, 22), Fraction(13, 15), Fraction(20, 23), Fraction(7, 8),
Fraction(22, 25), Fraction(15, 17), Fraction(8, 9), Fraction(17, 19), Fraction(9, 10),
Fraction(19, 21), Fraction(10, 11), Fraction(21, 23), Fraction(11, 12), Fraction(23, 25),
Fraction(12, 13), Fraction(13, 14), Fraction(14, 15), Fraction(15, 16), Fraction(16, 17),
Fraction(17, 18), Fraction(18, 19), Fraction(19, 20), Fraction(20, 21), Fraction(21, 22),
Fraction(22, 23), Fraction(23, 24), Fraction(24, 25), Fraction(1, 1)]
for k, v in max_size2possible_t.items():
max_size2possible_t[k] = sorted(set(v))
ds_names = ['coauth-DBLP',
'coauth-MAG-Geology',
'NDC-classes',
'NDC-substances',
'contact-high-school',
'contact-primary-school',
'email-Enron',
'email-Eu',
'tags-ask-ubuntu',
'tags-math-sx',
'tags-stack-overflow',
'threads-ask-ubuntu',
'threads-math-sx',
'threads-stack-overflow']
ds_names_short = ['coauth-DBLP',
'coauth-Geology',
'NDC-classes',
'NDC-substances',
'contact-high',
'contact-primary',
'email-Enron',
'email-Eu',
'tags-ubuntu',
'tags-math',
'tags-SO',
'threads-ubuntu',
'threads-math',
'threads-SO']
colors_full = [
'#a93226',
'#E74C3C',
'#AF7AC5',
'#5B2C6F',
'#154360',
'#5DADE2',
'#808B96',
'#2E4053',
'#17A589',
'#1E8449',
'#2ECC71',
'#F4D03F',
'#D68910',
'#E67E22']
colors_group = [
'#a93226',
'#a93226',
'#AF7AC5',
'#AF7AC5',
'#154360',
'#154360',
'#808B96',
'#808B96',
'#17A589',
'#17A589',
'#17A589',
'#F4D03F',
'#F4D03F',
'#F4D03F']
linestyles = [
'solid',
'dotted',
'solid',
'dotted',
'solid',
'dotted',
'solid',
'dotted',
'solid',
'dotted',
'dashed',
'solid',
'dotted',
'dashed'
]
def step_plot(t2sth, **kwargs):
t_sorted = sorted(t2sth)
sth_sorted = [t2sth[t] for t in t_sorted]
plt.step([0] + t_sorted, [sth_sorted[0]] + sth_sorted, **kwargs)