Transcript Document
Matthew L. Wright
Institute for Mathematics and its Applications
University of Minnesota
Preliminaries
Let πΎ be a simplicial complex, and let π½2 be the two-element field.
πΆπ (πΎ) denotes the vector space generated by the π-dimensional simplices of πΎ.
πΆπ (πΎ) consists of all π-chains, which are formal sums π =
π½2 and ππ is a π-simplex in πΎ.
π ππ π_π,
where ππ β
The boundary π(ππ ) is the formal sum of the (π β 1)-dimensional faces of ππ .
A boundary has no boundary: π β π = π 2 = 0.
The boundary operator connects the vector spaces into a chain complex πΆβ :
β―
πΆπ+1
ππ+1
πΆπ
ππ
πΆπβ1
β―
Preliminaries
The π-chains that have no boundary are called π-cycles, and they form a
subspace ππ of πΆπ .
The π-chains that are the boundary of (π + 1)-chains are called π-boundaries,
and they form a subspace π΅π of πΆπ .
Since a boundary has no boundary, π΅π β ππ .
The quotient π»π = ππ /π΅π is the πth homology group of πΎ.
The dimension of π»π is the πth Betti number of πΎ and is denoted π½π .
Computing Betti Numbers
π·π π, π = 1 if the π th (π β 1)-simplex is
a face of the πth π-simplex
π·0 π, π = 0 otherwise
Observe:
rank π΅πβ1 = rank π·π
rank ππ = ππ β rank(π·π )
Thus, π½π = ππ β rank(π·π ) β rank π·π+1 .
rank(ππ )
π·π
rank(πΆπβ1 )
The boundary matrix π·π records the face
relationship for π-simplices and (π β 1)simplices.
rank(π·π )
rank(π΅πβ1 )
Number the π-simplices of K
consecutively from 1 to ππ = rank(πΆπ ).
rank(πΆπ )
Reduce π·π to Smith normal form
to obtain the desired ranks.
Computing Persistent Homology
We start with a filtered simplicial complex:
β
= πΎ0 β πΎ1 β β― β πΎπ = πΎ
Step 1: Sort the simplices to get a total ordering compatible with the
filtration.
Step 2: Obtain a boundary matrix π· with respect to the total order on
simplices.
Step 3: Reduce the matrix using column additions, always respecting the
total order on simplices.
Step 4: Read the persistence pairs to get the barcode.
Example:
β
= πΎ0
β
πΎ1
β
πΎ2
β
πΎ3
β
πΎ4 = πΎ
2
Example:
2
4
1
β
= πΎ0
β
πΎ1
β
6
4
1
1
3
πΎ2
β
2
4
1
3
5
πΎ3
β
7
6
3
5
πΎ4 = πΎ
Step 1: Sort the simplices to get a total ordering compatible with the filtration
Compatible means:
1. Simplices in each πΎπ precede simplices in πΎ β πΎπ
2. The faces of each simplex precede the simplex itself
2
Example:
2
4
1
β
= πΎ0
β
β
1
3
πΎ2
Step 2: Obtain a boundary matrix π·
with respect to the total order
π· π, π = 1 if simplex π is a
codimension-1 face of simplex π
π· πΌ, π = 0 otherwise
6
4
1
πΎ1
2
β
4
5
πΎ3
1
2
3
4
5
6
7
2
3
5
πΎ4 = πΎ
β
1
7
1
3
6
3
4
5
6
7
1 1
1
1
1 1
1
1
1
=π·
2
Example:
2
4
1
β
= πΎ0
β
β
6
4
1
πΎ1
2
1
3
πΎ2
β
Step 2: Obtain a boundary matrix π·
with respect to the total order
Define πππ€(π) to be the row number
of the lowest non-zero entry in
column π. If column π is empty, then
πππ€ π = 0.
Example: πππ€ 2 = 0 and πππ€ 5 = 3
4
5
πΎ3
1
2
3
4
5
6
7
2
3
5
πΎ4 = πΎ
β
1
7
1
3
6
3
4
5
6
7
1 1
1
1
1 1
1
1
1
=π·
2
Example:
2
4
1
β
= πΎ0
β
β
6
4
1
πΎ1
2
1
3
πΎ2
β
Step 3: Reduce the matrix
5
πΎ3
1
for j = 1 to n:
while β j' < j with low(j') = low(j) β 0:
add column j' to column j
3
4
5
6
7
2
3
5
πΎ4 = πΎ
β
1
6
7
1
3
2
ALGORITHM
4
3
4
5
6
7
1 1 1
0
1
0
1
1 0
1
1
1
1
2
Example:
2
4
1
β
= πΎ0
β
β
6
4
1
πΎ1
2
1
3
πΎ2
β
Step 4: Read the persistence pairs
If πππ€ π = π > 0, then simplex π is negative,
paired with simplex π.
4
5
πΎ3
1
2
3
If πππ€ π = 0, then simplex π is positive; look
to row π for pairing.
4
If there is no π with πππ€ π = π, then simplex
π generates homology in πΎ.
6
5
7
2
3
5
πΎ4 = πΎ
β
1
7
1
3
6
3
4
5
6
7
1 1
1
1
1
1
1
2
Example:
2
4
1
β
= πΎ0
β
β
6
4
1
πΎ1
2
1
3
πΎ2
simplex 1: positive, unpaired
simplex 2: positive, paired with simplex 4
simplex 3: positive, paired with simplex 5
simplex 4: negative, paired with simplex 2
simplex 5: negative, paired with simplex 3
simplex 6: positive, paired with simplex 7
simplex 7: negative, paired with simplex 6
β
4
5
πΎ3
1
2
3
4
5
6
7
2
3
5
πΎ4 = πΎ
β
1
7
1
3
6
3
4
5
6
7
1 1
1
1
1
1
1
2
Example:
2
4
1
β
= πΎ0
β
πΎ1
β
6
4
1
1
3
πΎ2
simplex 1: positive, unpaired
simplex 2: positive, paired with simplex 4
simplex 3: positive, paired with simplex 5
simplex 4: negative, paired with simplex 2
simplex 5: negative, paired with simplex 3
simplex 6: positive, paired with simplex 7
simplex 7: negative, paired with simplex 6
β
2
4
1
3
5
πΎ3
7
β
6
3
5
πΎ4 = πΎ
bar 1, β in π»0 homology
simplices 2 and 4 enter at the same time,
so the pair does not produce a bar
bar 2,3 in π»0 homology
bar 3,4 in π»1 homology
2
Example:
2
4
1
β
= πΎ0
β
πΎ1
β
1
3
πΎ2
β
4
1
3
5
πΎ3
7
β
3
5
πΎ4 = πΎ
simplices 2 and 4 enter at the same time,
so the pair does not produce a bar
π»1
π»0
bar 2,3 in π»0 homology
2
6
bar 1, β in π»0 homology
Now we can draw the barcode:
1
6
4
1
2
3
4
bar 3,4 in π»1 homology
Data Structures
1
2
3
4
5
6
7
We store the matrix in a columnsparse format.
Store the matrix as an array of
columns, and each column as a linked
list.
The linked list for column π stores the
row indexes of the nonzero entries in
column π, in reverse order so that the
βlowestβ index is accessible at the
beginning of the list.
2
3
3
6
1
1
2
5
4
Data Structures
Suppose we have reduced columns
1 through π β 1. If πππ€ π = π > 0,
we want to find πβ < π such that
πππ€ π β² = πππ€(π).
To avoid looking through all
columns 1 through π β 1, we use a
low array to store the index of
each nonempty reduced column
by low number.
low
array
1
2
3
4
5
6
7
1
2 4
2
3
3
6
1
1
2
5
3 5
4
5
6
7
4
Data Structures
Suppose we have reduced columns
1 through π β 1. If πππ€ π = π > 0,
we want to find πβ < π such that
πππ€ π β² = πππ€(π).
To avoid looking through all
columns 1 through π β 1, we use a
low array to store the index of
each nonempty reduced column
by low number.
low
array
1
2
3
4
5
6
7
1
2 4
2
3
2
6
1
1
1
5
3 5
4
5
6
7
4
Data Structures
Suppose we have reduced columns
1 through π β 1. If πππ€ π = π > 0,
we want to find πβ < π such that
πππ€ π β² = πππ€(π).
To avoid looking through all
columns 1 through π β 1, we use a
low array to store the index of
each nonempty reduced column
by low number.
low
array
1
2
3
4
5
6
7
1
2 4
2
3
6
1
1
5
3 5
4
5
6 7
7
4
βTwistβ Optimization
Observations:
reduced matrix
If column π is reduced and πππ€ π = π > 0, then
simplex π is negative, paired with positive simplex π.
1
Then reducing column π will result in a column of zeros.
2
If π is the dimension of simplex π, then the dimension
of simplex π is π β 1.
Optimization:
Reduce columns corresponding to higher-dimensional
simplices first.
If column π is reduced and πππ€ π = π > 0, then set
column π to zero.
1
3
4
5
6
7
2
3
4
5
6
7
1 1
1
1
1
1
1
βTwistβ Optimization
Example: same boundary matrix as before
unreduced matrix
1
First reduce columns corresponding to 2-simplices.
Column 7 is reduced, and πππ€ 7 = 6.
Thus, negative simplex 7 is paired with positive
simplex 6, so column 6 must be zero.
After reducing all columns corresponding to 2simplices, then reduce columns corresponding to
1-simplices.
Now we are done.
1
2
3
4
5
6
7
2
3
4
5
6
7
1 1
1
1
1 1
1
1
1
Runtime Complexity
Let π be the total number of simplices, so π· is an π ×
π matrix.
We must reduce π columns.
Reducing any particular column requires at most π
column additions.
number of column
additions is π π2
Each column addition requires at most π operations.
Therefore, the runtime is π π3 .
However, in practice, the runtime is often better than cubic.
Note that this complexity is just for the matrix reduction, and doesnβt include
building the filtration or boundary matrix.
Generating Cycles
To find the cycles that represent homology classes, we must keep track of
the column additions.
Consider the operation of adding column πβ to column π:
β’ This is the same as adding the chain represented by column πβ to that
represented by column π.
β’ This corresponds to multiplying π· on
the right by the elementary matrix
that has 1s on the diagonal and in
entry π β² , π .
π
1
π·
1
1
1
1
πβ²
1
1
Generating Cycles
Reducing π· via column operations is the same as multiplying π· on the
right by matrix π.
Matrix π is a product of elementary matrices and is upper triangular with
1s on the diagonal.
π
=
π·
π
Generating Cycles
The columns of π indicate the cycles and chains that kill cycles.
If column π in π
is empty, then column π in π gives the corresponding cycle.
Otherwise, column π in π gives the chain that kills the cycle corresponding
to πππ€(π).
=
π
π·
π
Bit Tree
Replacing the linked lists (for columns) by a more clever data structure can
make the algorithm faster, though the complexity is still π π3 .
Bauer et. al. propose a bit tree: a 64-ary tree, stored as an array.
1
β¦
β¦
2
3
β¦
64
β¦
β¦
β¦
β¦
β¦
β¦
β¦
Each block has 64 bits. Bit π indicates whether the π th subtree is non-empty.
The leaves of the tree encode the nonzero entries of a column.
Bit Tree
1
β¦
β¦
2
3
β¦
64
β¦
β¦
β¦
β¦
β¦
β¦
β¦
The bit tree supports nearly constant time insertion, deletion, and lookup.
The βactiveβ column is converted to a bit tree, then columns are added to
it, and then it is converted back to a sparse structure.
Bauer et. al. recorded significant speed improvements when using the bit
tree for column additions.
Available Software
JavaPlex: http://git.appliedtopology.org/javaplex/
Dionysus: http://www.mrzv.org/software/dionysus/
Perseus: http://www.sas.upenn.edu/~vnanda/perseus/
Persistent Homology Algorithms Toolbox (PHAT):
https://code.google.com/p/phat/
References
Ulrich Bauer, et. al. βPHAT β Persistent Homology Algorithms Toolbox.β
http://phat.googlecode.com
Herbert Edelsbrunner and John Harer. βPersistent homology: a survey.β in
Surveys on discrete and computational geometry: twenty years later. AMS
(2008).
Afra Zomorodian and Gunnar Carlsson. βComputing persistent homology.β
Discrete and Computational Geometry. Vol. 33, no. 2 (2005), p. 249 β 274.