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
/*
A Directed Acyclic Graph (DAG) of `n` nodes is isomorphic to
the upper or lower strictly triangular binary square `n тип n` matrix.
The discrete space of pairs can be thought of as:
- (a, b) (a, c) (a, d)
- - (b, c) (b, d)
- - - (c, d)
- - - -
In a strictly triangular binary square matrix,
these pairs are filled with `0` or `1`.
Therefore, by taking the powerset of pair,
one can construct a discrete space that is isomorphic to DAGs.
n count
1 1
2 2
3 8
4 64
5 1024
6 32768
7 2097152
8 268435456
9 68719476736
10 35184372088832
11 36028797018963968
12 73786976294838206464
13 302231454903657293676544
14 2475880078570760549798248448
15 40564819207303340847894502572032
16 1329227995784915872903807060280344576
17 87112285931760246646623899502532662132736
18 11417981541647679048466287755595961091061972992
19 2993155353253689176481146537402947624255349848014848
20 1569275433846670190958947355801916604025588861116008628224
Notice that to count above 11, one needs `BigUint`.
When enumerating this space, the position is a list of pairs.
For example: `[(0, 2), (1, 2)]`.
This means that `2` depends on `0` and `1`.
The DAG can be constructed directly from this data.
*/
extern crate discrete;
use ;