CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
<Chapter><Heading> Finite metric spaces and their filtered complexes </Heading>
2
3
<Table Align="|l|" >
4
5
<Row>
6
<Item>
7
<Index> CayleyMetric</Index>
8
<C>CayleyMetric(g,h,N) </C>
9
<C>CayleyMetric(g,h) </C>
10
<P/>
11
12
Inputs two permutations <M>g,h</M> and optionally the degree <M>N</M> of a symmetric group containing them. It returns the minimum number of transpositions needed to
13
express <M>g*h^-1</M> as a product of transpositions.
14
15
</Item>
16
</Row>
17
18
<Row>
19
<Item>
20
<Index> HammingMetric</Index>
21
<C>HammingMetric(g,h,N) </C>
22
<C>HammingMetric(g,h) </C>
23
<P/>
24
25
Inputs two permutations <M>g,h</M> and optionally the degree <M>N</M> of a symmetric group containing them. It returns the number of integers moved by the permutation
26
<M>g*h^-1</M>.
27
28
</Item>
29
</Row>
30
31
32
<Row>
33
<Item>
34
<Index> KendallMetric</Index>
35
<C>KendallMetric(g,h,N) </C>
36
<C>KendallMetric(g,h) </C>
37
<P/>
38
39
Inputs two permutations <M>g,h</M> and optionally the degree <M>N</M> of a symmetric group containing them. It returns the minimum number of adjacent transpositions needed to express <M>g*h^-1</M> as a product of adjacent transpositions. An adjacent transposition has the for <M>(i,i+1)</M>.
40
41
</Item>
42
</Row>
43
44
45
<Row>
46
<Item>
47
<Index> EuclideanSquaredMetric</Index>
48
<C>EuclideanSquaredMetric(v,w) </C>
49
<P/>
50
51
Inputs two vectors <M>v,w</M> of equal length and returns
52
the sum of the squares of the components of <M>v-w</M>. In other words, it returns the square of the Euclidean distance between <M>v</M> and <M>w</M>.
53
54
</Item>
55
</Row>
56
57
<Row>
58
<Item>
59
<Index> EuclideanApproximatedMetric</Index>
60
<C>EuclideanApproximatedMetric(v,w) </C>
61
<P/>
62
63
Inputs two vectors <M>v,w</M> of equal length and returns
64
a rational approximation to the square root of the sum of the squares of the components of <M>v-w</M>. In other words, it returns an approximation to the Euclidean distance between <M>v</M> and <M>w</M>.
65
66
</Item>
67
</Row>
68
69
70
<Row>
71
<Item>
72
<Index> ManhattanMetric</Index>
73
<C>ManhattanMetric(v,w) </C>
74
<P/>
75
76
Inputs two vectors <M>v,w</M> of equal length and returns
77
the sum of the absolute values of the components of <M>v-w</M>.
78
This is often referred to as the taxi-cab distance between <M>v</M> and <M>w</M>.
79
80
</Item>
81
</Row>
82
83
84
<Row>
85
<Item>
86
<Index> VectorsToSymmetricMatrix</Index>
87
<C>VectorsToSymmetricMatrix(L) </C>
88
<C>VectorsToSymmetricMatrix(L,D) </C>
89
<P/>
90
91
Inputs a list <M>L</M> of vectors and optionally a metric <M>D</M>. The default is <M>D=ManhattanMetric</M>. It returns the symmetric matrix whose i-j-entry is <M>S[i][j]=D(L[i],L[j])</M>.
92
93
94
</Item>
95
</Row>
96
97
<Row>
98
<Item>
99
<Index> SymmetricMatDisplay</Index>
100
<C>SymmetricMatDisplay(S) </C>
101
<C>SymmetricMatDisplay(L,V) </C>
102
<P/>
103
104
Inputs an <M>n \times n</M>
105
symmetric matrix <M>S</M> of non-negative integers and an integer <M>t</M> in <M>[0 .. 100]</M>. Optionally it inputs a list <M>V=[V_1, ... , V_k]</M>
106
of disjoint subsets of <M>[1 .. n]</M>. It displays the graph with vertex set <M>[1 .. n]</M> and with an edge between <M>i</M> and <M>j</M> if <M>S[i][j] &lt; t</M>. If the optional list <M>V</M> is input then the vertices in <M>V_i</M> will be given a common colour distinct from other vertices.
107
108
109
</Item>
110
</Row>
111
112
<Row>
113
<Item>
114
<Index> SymmetricMatrixToFilteredGraph</Index>
115
<C>SymmetricMatrixToFilteredGraph(S,t,m) </C>
116
<P/>
117
118
Inputs an integer symmetric matrix <M>S</M>, a positive
119
integer <M>t</M> and a positive integer <M>m</M>. The function returns a
120
filtered graph of filtration length <M>t</M>. The <M>k</M>-th term of the
121
filtration is a graph with one vertex for each row of <M>S</M>. There is an edge in this graph between the <M>i</M>-th and <M>j</M>-th vertices if the entry
122
<M>S[i][j]</M> is less than or equal to <M>k*m/t</M>.
123
124
125
</Item>
126
</Row>
127
128
<Row>
129
<Item>
130
<Index> PermGroupToFilteredGraph</Index>
131
<C>PermGroupToFilteredGraph(S,D) </C>
132
<P/>
133
134
Inputs a permutation group <M>G</M> and a metric <M>D</M> defined
135
on permutations.
136
The function returns a
137
filtered graph. The <M>k</M>-th term of the
138
filtration is a graph with one vertex for each element of the group
139
<M>G</M>. There is an edge in this graph between vertices
140
<M>g</M> and <M>h</M> if
141
<M>D(g,h)</M> is less than some integer threshold <M>t_k</M>. The thresholds
142
<M>t_1 &lt; t_2 &lt; ... &lt; t_N</M> are chosen to form as long a sequence as possible subject to each term of the filtration being a distinct graph.
143
144
145
</Item>
146
</Row>
147
148
149
150
151
</Table>
152
</Chapter>
153
154
155
156
157