SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Persistent homology tracks the evolution of Betti numbers in a sequence of chain complexes. For this, we need a filtration, which is an increasing sequence of simplicial complexes  $(\mathcal{F}_i)_{i=1}^r$  such that  $\mathcal{F}_1 = \emptyset \subseteq \mathcal{F}_2 \subseteq \ldots \subseteq \mathcal{F}_r = K$ . By constructing all homology groups for each of these simplicial complexes, we can capture changes. New holes (or, homology classes) may emerge, or they may be annihilated such that only the older remains. As such, we can associate a pair of timestamps, or persistence points,  $(i,j)$  for every hole to indicate the filtration steps it appeared and disappeared. The persistence of a point  $(i,j)$  is the duration for which the corresponding feature was in existence, i.e., the difference  $|i - j|$ . We set  $j = \infty$  if the hole does not disappear, i.e. is present at the last filtration step. The extension to persistent homology groups and persistent Betti numbers is natural:
$$
H _ {p} ^ {i, j} = \ker \partial_ {p} / (\operatorname {I m} \partial_ {(p + 1)} \cap \ker \partial_ {p}),
$$
and the  $p$ th persistent Betti number  $\beta_p^{i,j}$  are given by the rank of  $H_p^{i,j}$  as earlier. Lastly, a persistent diagram that consists of the persistent points  $(i,j)$  with multiplicities
$$
\mu_ {p} ^ {i, j} = (\beta_ {p} ^ {i, j - 1} - \beta_ {p} ^ {i, j}) - (\beta_ {p} ^ {i - 1, j - 1} - \beta_ {p} ^ {i - 1, j})
$$
where  $i < j$ , encodes the persistent homology groups entirely by the Fundamental Lemma of Persistent Homology.
For graphs, the filtration may be viewed as creating an increasing sequence of subgraphs. This entails selecting a subset of vertices and edges of the graph at each step of the filtration. One can learn a parameterized function  $f$  (e.g., a neural network) to assign some value to each  $\sigma \in K$ , and thereby select the subsets  $K_{i}$  based on a threshold  $\alpha_{i} \in \mathbb{R}$ . That is,  $f$  induces a filtration  $(\mathcal{F}_i)_{i=1}^r$  using a sequence  $(\alpha_i)_{i=1}^r$  such that  $\alpha_1 \geq \alpha_2 \geq \ldots \geq \alpha_r$ :
$$
\mathcal {F} _ {i} \triangleq \mathcal {F} (f; \alpha_ {i}) = \{\sigma \in K: f (\sigma) \geq \alpha_ {i} \}.
$$
We provide a detailed pseudocode in Algorithm 1 to compute the persistence diagram for an input graph. The algorithm uses the Union-Find data structure, also known as a disjoint-set forest. The code assumes we are given vertex-color filter values, stored in the variable vValues. The algorithm returns a multiset containing 0- and 1-dimensional persistence tuples (i.e., persistence diagrams).
Algorithm 1 Computing persistence diagrams
Require:  $V,E,\mathrm{vValues}$  Vertices, edges, and vertex-color filter values  
uf  $\leftarrow$  UNIONFIND(|V|)  
pers0  $\leftarrow$  zeros(|V|,2) Initialize the persistence tuples  
pers1  $\leftarrow$  zeros(|E|,2)  
for  $e\in E$  do  
(v,w) $\leftarrow$  e  
eValues[e] $\leftarrow$  max(vValues[v], vValues[w])  
end for  
pers0[:,1]  $\leftarrow$  vValues Pre-set the 'birth' times  
SINDICES, SVALUES  $\leftarrow$  SORT(eValues)  
for  $e$ , weight  $\in$  Pair(SINDICES, SVALUES) do  $\triangleright$  Pair is equivalent to the zip function in Python  
(v,w) $\leftarrow$  e  
younger  $\leftarrow$  uf.find(v) younger denotes the component that will die  
older  $\leftarrow$  uf.find(w) if younger = older then A cycle was detected  
pers1[e,1]  $\leftarrow$  weight  
pers1[e,2]  $\leftarrow$ $\infty$  continue  
else  
if vValues[younger] < vValues[older] then  
younger, older, v, w  $\leftarrow$  older, younger, w, v  
end if  
end if  
pers0[younger, 2]  $\leftarrow$  weight  
uf.merge(v,w) Merge two connected components  
end for  
for  $r\in$  uf Roots() do  
pers0[r,2]  $\leftarrow$ $\infty$   
end for  
 $\mathcal{D}_v\gets$  JOIN(pers0, pers1)  
return  $\mathcal{D}_v$
B.1 Proof of Lemma 1: Vertex-based filtrations can generate inconsistent diagrams
Figure S1: Filtrations induced by injective vertex filter functions for two isomorphic graphs. Node ids are used as filter function. The top-row filtration induces the persistence diagram  $\mathcal{D}_1^0 = \{\{(1,\infty),(2,2),(3,3),(4,4),(5,5),(6,6)\}\}$ , while the second-row filtration produces  $\mathcal{D}_2^0 = \{\{(1,\infty),(2,4),(3,5),(4,4),(5,5),(6,6)\}\}$ .
Proof. Consider a simple cyclic graph with 6 vertices that share the same color. Since the vertices are structurally identical and have the same color, one would expect to get a single persistence diagram irrespective of the labeling of the vertices. However, this is not the case. Consider two different labelings for the vertices on the graph:  $\ell_1 = (v_1,v_2,v_3,v_4,v_5,v_6)$  and  $\ell_{2} = (v_{1},v_{4},v_{2},v_{6},v_{3},v_{5})$  (see Figure S1). Now, consider an injective vertex-based filtration where  $f(v_{i}) > f(v_{j})$  if  $i > j$ . Then, we obtain two different persistence diagrams,  $\mathcal{D}_1 = \{(1,\infty),(2,2),(3,3),(4,4),(5,5),(6,6)\}$  and  $\mathcal{D}_2 = \{(1,\infty),(2,4),(3,5),(4,4),(5,5),(6,6)\}$ . We note that for any choice of vertex-based injective filter function on this cycle graph, we can follow a similar procedure to build two different labelings such that the persistence diagrams are different.
B.2 Proof of Lemma 2: Equivalence between component-wise colors and real holes
Proof. We consider two arbitrary graphs  $G = (V, E, c, X)$  and  $G' = (V', E', c', X')$  and an injective filter function  $f: X \cup X' \to \mathbb{R}$ . We note that if  $G$  and  $G'$  do not have the same number of connected components (i.e.,  $\beta_{G}^{0} \neq \beta_{G'}^{0}$ ), then  $G$  and  $G'$  differ on the number of real holes, i.e., their multisets of real holes are different trivially. Thus, we now assume  $\beta_{G}^{0} = \beta_{G'}^{0} = k$ . We also assume both graphs have same colors — if there is a color in  $G$  that is not in  $G'$ , the claim is trivial.
$[\Rightarrow]$  Recall that  $X_{i} = \{c(v)\mid v\in V_{C_{i}}\}$  denotes the set of colors in the component  $C_i\subseteq G$  . Similarly,  $X_{i}^{\prime}$  is the set of colors in  $C_i^\prime \subseteq G^\prime$  . We want to show that if  $\{\{X_i\} _i^k\neq \{\{X_i'\} _i^k\}$  , then there exists a filtration such that the multisets of real holes are different. We proceed with a proof by induction on the number of colors.
If there is only 1 color, component-wise colors cannot differ for graphs with  $\beta_{G}^{0} = \beta_{G^{\prime}}^{0}$ . Let us thus consider 2 colors (say,  $b$  and  $w$ ). For 2 colors, there are only three possibilities for what  $X_{h} \in \{\{X_{i}\}_{i=1}^{k}\}$  may be:  $\{b\}, \{w\}$  or  $\{b, w\}$ . Now, let us denote the multiplicities of  $\{b\}, \{w\}$  and  $\{b, w\}$  in  $\{\{X_{i}\}_{i=1}^{k}\}$  by  $n_{1}, n_{2}$  and  $n_{3}$ , respectively. Note that for  $G$  and  $G^{\prime}$  with  $\beta_{G}^{0} = \beta_{G^{\prime}}^{0}$ , we have  $n_{1} + n_{2} + n_{3} = n_{1}^{\prime} + n_{2}^{\prime} + n_{3}^{\prime}$ . Thus, when  $\{\{X_{i}\}_{i=1}^{k} \neq \{\{X_{i}^{\prime}\}_{i=1}^{k}\}$ , there are four cases to consider:
1.  $n_1 \neq n_1'$ ,  $n_2 \neq n_2'$ ,  $n_3 = n_3'$ : Here,  $n_2 + n_3 \neq n_2' + n_3'$  correspond to multiplicities of real holes  $(w, \infty)$  for  $G$  and  $G'$  respectively, in a filtration that introduces the color  $w$  first.
2.  $n_1 \neq n_1', n_2 = n_2', n_3 \neq n_3'$ : Again,  $n_2 + n_3 \neq n_2' + n_3'$  correspond to multiplicities of real holes  $(w, \infty)$  for  $G$  and  $G'$  respectively in a filtration that introduces the color  $w$  first.
3.  $n_1 = n_1', n_2 \neq n_2', n_3 \neq n_3'$ : Now,  $n_1 + n_3 \neq n_1' + n_3'$  correspond to multiplicities of real holes  $(b, \infty)$  for  $G$  and  $G'$  respectively in a filtration that introduces the color  $b$  first.
4.  $n_1 \neq n_1', n_2 \neq n_2', n_3 \neq n_3'$ : Similarly,  $n_1 + n_3 \neq n_1' + n_3'$  correspond to multiplicities of real holes  $(b, \infty)$  for  $G$  and  $G'$  respectively in a filtration that introduces the color  $b$  first.
Note that cases as  $n_1 \neq n_1'$ ,  $n_2 = n_2'$ ,  $n_3 = n_3'$  are not possible as  $n_1 + n_2 + n_3 = n_1' + n_2' + n_3'$ .
Let us then assume that there are  $l$  colors, and there exists a permutation of the colors  $\{c_1, c_2, \ldots, c_l\}$  that induces a filtration giving different colored representatives.
Let us consider graphs  $G$  and  $G'$  with  $l + 1$  colors. Now, if  $\{X_i\}_{i=1}^k \neq \{X_i'\}_{i=1}^k$  for subgraphs of  $G$  and  $G'$  with only  $l$  colors, the permutation  $\{c_{l+1}, c_1, c_2, \ldots, c_l\}$  induces a filtration where the representatives of first  $l$  colors differ (and there may or may not be a difference also in the representatives of the  $l + 1$ -th color). However, if there are no such subgraphs, this means that each of the pairs of unmatched component-colors contain the  $l + 1$  th color. Now  $\{c_1, c_2, \ldots, c_l, c_{l+1}\}$  must induce the wanted kind filtration, since now the representatives of each component are as in  $l$  colors. The claim follows by the induction principle.
$[\Leftarrow]$  Now, we want to prove that if there is a filtration such that the multiset of real holes differ, then  $\{\{X_i\}\} \neq \{\{X_i'\}\}$ . We proceed with a proof by contrapositive.
Assume that  $\{\{X_i\} = \{\{X_i'\}\}$ . Recall that, for a filter  $f$ , the color of the representatives of a real hole associated with  $C_i$  is given by  $\arg \min_{x \in X_i} f(x)$ . If  $\{\{X_i\} = \{\{X_i'\}\}$ , it implies that the multiset of colors of the representatives are identical. Finally, note that the birth times of real holes are functions of these colors and, therefore, are identical as well.
B.3 Proof of Lemma 3: Almost holes and separating sets
Statement 1: We want to show that if  $(f(x^{(b)}), f(x^{(d)}))$  is an almost hole, then  $S = \{v \in V | f(c(v)) \geq f(x^{(d)})\}$  is a separating set of  $G = (V, E, c, X)$ .
Proof. Let  $d = (f(x^{(b)}), f(x^{(d)}))$  be an almost hole. Then, we know there is at least one vertex  $w$  of color  $c(w) = x^{(b)}$  that gives birth to a new connected component at the filtration step  $G_{f(x^{(b)})}$ . Also, there is a distinct vertex  $w'$  such that  $w$  and  $w'$  are not in
the same component at  $G_{f(x^{(b)})}$  but are connected at  $G_{f(x^{(d)})}$ . The existence of  $w'$  is guaranteed since if there was no such  $w'$  that gets connected to  $w$  at  $G_{f(x^{(d)})}$ ,  $d$  would be a real hole, or if  $w$  was connected to all other nodes at  $G_{f(x^{(b)})}$ ,  $d$  would be a trivial hole. Figure S2 illustrates a filtration on a 5-vertex graph with 5 colors. The filtration produces the persistence diagram  $\{(1, \infty), (2, 2), (3, 4), (4, 4), (5, 5)\}$ , with a single almost hole  $(3, 4)$ . According to our description,  $w$  corresponds to  $v_3$  (with  $x^{(b)} =$  'grey' and  $f(x^{(b)}) = 3$ ), and  $v_1$  could be a candidate to  $w'$ , for instance.
The discovery of the vertices in  $T = \{v \in V \mid f(c(v)) = f(x^{(d)})\}$  connects  $w$  to  $w'$  since this set is added at the step when the component associated with  $w$  dies at  $f(x^{(d)})$ . Equivalently,  $T$  is a separating set of  $G_{f(x^{(d)})}$ . However, we want a separating set of  $G$  (not of  $G_{f(x^{(d)})}$ ). Finally, we note that expanding  $T$  to  $S = \{v \in V \mid f(v) \geq f(x^{(d)})\}$  suffices to obtain a separating set of  $G$ .
Figure S2: Graph to help illustrate the connectivity of almost holes.
Statement 2: Let  $S$  be a separating set of  $G$  that splits a connected component  $C \subseteq G$  into  $k$  components  $C_1, C_2, \ldots, C_k$ . Then, there exists a filtration that produces  $k - 1$  almost holes if the set of colors of vertices in  $\cup_{i=1}^k V_{C_i}$  is disjoint from those of the remaining vertices, i.e.,  $\{c(v) \mid v \in V \setminus \cup_{i=1}^k V_{C_i}\} \cap \{c(v) \mid v \in \cup_{i=1}^k V_{C_i}\} = \emptyset$ .
Proof. Let us denote by  $C_1, C_2, \ldots, C_k$  the connected components that  $S$  separates  $C$  into. We can first set a restriction  $f|_{\cup_{i=1}^k V_{C_i}}$  to be any function mapping vertex colors to  $\{1, 2, \ldots, |\cup_{i=1}^k V_{C_i}|\}$  — i.e., vertices in  $\cup_{i=1}^k V_{C_i}$  must take filtration values in  $\{1, 2, \ldots, |\cup_{i=1}^k V_{C_i}|\}$ . Similarly, we can set  $f|_{V \setminus \cup_{i=1}^k V_{C_i}}$  to be any function to  $\{| \cup_{i=1}^k V_{C_i} | + 1, \ldots, |V|\}$ .
The function  $f$  obtained by combining the domains of  $f|_{\cup_{i=1}^{k} V_{C_i}}$  and  $f|_{V \setminus \cup_{i=1}^{k} V_{C_i}}$  is well defined due to the assumption  $\{c(v) \mid v \in V \setminus \cup_{i=1}^{k} V_{C_i}\} \cap \{c(v) \mid v \in \cup_{i=1}^{k} V_{C_i}\} = \emptyset$ . Since  $C_1, C_2, \ldots, C_k$  are not path-connected, the persistence diagram induced by  $f$  must have  $k$  holes that are born at filtration steps in  $\{1, 2, \ldots, |\cup_{i=1}^{k} V_{C_i}|\}$ . Also, since the vertices of  $S$  are added at filtration steps in  $\{|\cup_{i=1}^{k} V_{C_i}| + 1, \ldots, |V|\}$ , all holes die, forcing the birth and death times to be different. Thus, there must be one real hole corresponding to the connected component  $C$  and  $k - 1$  almost holes.
B.4 Proof of Lemma 4: Distinct almost holes imply distinct color-separating sets
Proof. We will consider two cases. The first one assumes that the multisets of real holes of  $\mathcal{D}_G$  and  $\mathcal{D}_{G'}$  are different. In the second case, we consider identical multisets of real holes and different multisets of almost holes.
Case 1: multisets of real holes differ. By Lemma 2, we have that the graphs have distinct component-wise colors - that is, an empty set is a color-separating set.
Case 2:  $\mathcal{D}_G^0$  and  $\mathcal{D}_{G'}^0$  have identical real holes, but different multisets of almost holes. We want to show that there is a color-separating set for  $G$  and  $G'$ . We note that we can split the condition of distinct multisets of almost holes into two sub-cases: (i) There is some color  $x_0$  such that there are more almost holes with birth time  $f(x_0)$  in  $\mathcal{D}_G^0$  than in  $\mathcal{D}_{G'}^0$ ; (ii) There is some color  $x_0$  such that there are more almost holes with death  $f(x_0)$  in  $\mathcal{D}_G^0$  than in  $\mathcal{D}_{G'}^0$ .
Let us first consider case (i). By the definition of birth time, we have that  $G_{f(x_0)}$  has more connected components of color set  $\{x_0\}$  than  $G_{f(x_0)}'$ . As such,  $\{x \in X \cup X' | f(x) > f(x_0)\}$  is a color-separating set for  $G$  and  $G'$ .
For case (ii), we assume that there are equally many births of almost holes associated to the color  $x_0$  — otherwise we return to case (i), for which we showed how to build a color-separating set. We note that if there is a different number of connected components at any earlier filtration step than when  $x_0$  is introduced (i.e.  $f(y) < f(x_0)$ ), then  $\{x \in X \cup X' | f(x) > f(y)\}$  is a color separating set — since  $G_{f(y)}$  and  $G_{f(y)}'$  do not have as many connected components, they cannot have identical component-wise colors. However, if there is no such filtration step  $f(y)$ , it follows that  $G_{f(x_0)}$  and  $G_{f(x_0)}'$  cannot have the same number of components. This follows since vertices of color  $x_0$  kill more connected components in  $G_{f(x_0)}$  than in  $G_{f(x_0)}'$ , while prior to this, the numbers of components were equal. Therefore,  $\{x \in X \cup X' | f(x) > f(x_0)\}$  is a color-separating set.
B.5 Proof of Lemma 5: Equivalence between birth times and vertex colors
Proof. We consider a graph  $G = (V, E, c, X)$  and any injective vertex-color filter  $f: X \to \mathbb{R}$  from which we obtain a persistence diagram  $\mathcal{D}^0$ . We want to show that there exists a bijection between the multiset of birth times  $\mathcal{B} = \{(b \mid (b, d) \in \mathcal{D}^0)\}$  and the multiset of vertex colors  $\mathcal{X} = \{(c(v) \mid v \in V\}$ . Note that we can also represent a multiset as a pair  $\mathcal{B} = (S_{\mathcal{B}}, m_{\mathcal{B}})$  where  $S_{\mathcal{B}}$  is a set comprising the distinct elements of  $\mathcal{B}$ , and  $m_{\mathcal{B}}: S_{\mathcal{B}} \to \mathbb{N}$  is a multiplicity function that gives the number of occurrences of each element of  $S_{\mathcal{B}}$  in the multiset. If there is a bijection  $g: S_{\mathcal{B}} \to S_{\mathcal{X}}$  such that  $m_{\mathcal{B}} = m_{\mathcal{X}} \circ g$ , then we say that  $g$  is also a bijection between the multisets  $\mathcal{B}$  and  $\mathcal{X}$ .
We note that  $S_{\mathcal{X}} = \operatorname{Im}[c]$  denotes the set of distinct colors in  $G$ . Without loss of generality, since we are interested in filtrations induced by  $f$  on  $G$ , we can constrain ourselves to filter values on  $S_{\mathcal{X}}$ . Thus, filtrations induced by  $f: S_{\mathcal{X}} \to \mathbb{R}$  are increasing (i.e., for any consecutive filtration steps  $j > i$ , we have that  $V_j \setminus V_i \neq \emptyset$ ) and produce filtration steps  $\mathcal{T} = \{f(x) \mid x \in S_{\mathcal{X}}\}$ . Because such filtrations are increasing, we have at least one vertex discovered at each step, resulting in the set of distinct birth times  $S_{\mathcal{B}} = \mathcal{T}$ . The mapping  $g: S_{\mathcal{X}} \to S_{\mathcal{B}}$  where  $g(x) = f(x)$  for all  $x \in S_{\mathcal{X}}$  is a bijection. By definition, the number of vertices discovered at step  $f(x)$  equals the number of persistence pairs with birth time  $f(x)$ , which is also equal to the number of vertices of color  $x$ . This implies that the multiplicity of an element  $x$  in  $\mathcal{X}$  is the same as its corresponding element  $g(x)$  in  $\mathcal{B}$ .
B.6 Proof of Theorem 1: The expressive power of vertex-color filtrations
Proof. We consider graphs  $G = (V, E, c, X)$  and  $G' = (V', E', c', X')$ . and adopt the following notation. We use  $\mathcal{X} = \{\{c(v) \mid v \in V\}\}$  and  $\mathcal{X}' = \{\{c'(v) \mid v \in V'\}\}$  to denote the multisets of vertex colors of  $G$  and  $G'$ . Also, we denote by  $C_1, \ldots, C_k$  the components of  $G$ , and by  $C_1', \ldots, C_{k'}'$  the components of  $G'$ . The set  $X_i = \{c(w) \mid w \in V_{C_i}\}$  denotes the distinct colors appearing in  $C_i$ . Similarly,  $X_i' = \{c'(w) \mid w \in V_{C_i'}'\}$  refers to the distinct colors in  $C_i'$ .
[Forward direction  $\Rightarrow$  ]  $\mathcal{D}_G^0\neq \mathcal{D}_{G'}^0\to$  there is a color-separating set
The persistence diagrams  $\mathcal{D}_G^0$  and  $\mathcal{D}_{G'}^0$  for graphs with  $\mathcal{X} = \mathcal{X}'$  have the same birth times. It implies that if both the real holes and almost holes are identical, then the diagrams are also identical. As such,
the assumption that  $\mathcal{D}_G^0\neq \mathcal{D}_{G'}^0$  gives that either (1) their multisets of real holes or (2) their multiset of almost holes are different. In the following, we consider these two cases.
Regarding case (1), Lemma 2 gives that if  $\mathcal{D}_G^0\neq \mathcal{D}_{G'}^0$  with different multisets of real holes, then we have that  $\{\{X_i\} _i^k\neq \{\{X_i'\} _i^k\}$  whenever this happens, the forward direction holds as even an empty set would work as a color-separating set here. Thus, it suffices to consider the case when  $\mathcal{D}_G^0$  and  $\mathcal{D}_{G^{\prime}}^{0}$  only differ in their multisets of almost holes. In this case, we can directly leverage Lemma 4 to obtain that there is a color-separating set for  $G$  and  $G^{\prime}$ .
[Backward direction  $\Leftarrow$ ] Now we want to show that if there is a color-separating set  $Q \neq \emptyset$  for  $G$  and  $G'$ , there exists a filtration such that  $\mathcal{D}_G^0 \neq \mathcal{D}_{G'}^0$ .
If  $Q = \emptyset$ , i.e.  $G$  and  $G'$  have distinct component-wise colors, the claim follows by Lemma 2, with  $\mathcal{D}_G^0$  and  $\mathcal{D}_{G'}^0$ , having different multisets of real holes. If  $Q \neq \emptyset$ , we can however use Lemma 2 to subgraphs  $G_{\bar{V}}$  and  $G_{\bar{V}'}'$  induced by  $\bar{V} = V \setminus \{w \in V \mid c(w) \in Q\}$  and  $\bar{V}' = V' \setminus \{w \in V' \mid c'(w) \in Q\}$  to gain a filter function  $g$  such that the diagrams for these subgraphs differ. Now, let's choose any a filter function such that  $f(x) = g(x) \forall x \in X \setminus Q$  AND the filtration values for vertices with colors in  $X \setminus Q$  are smaller than those with colors in  $Q$ . It follows there is a filtration step  $j$  such that  $G_j = G_{\bar{V}}$  and  $G_{j}' = G_{\bar{V}'}'$ , and that the birth times for real holes (if the vertices of colors in  $Q$  do not merge the real holes of the subgraphs) or almost holes (if the vertices of colors in  $Q$  do merge components that would have been real holes in the subgraphs) differ. Thus,  $\mathcal{D}_G^0 \neq \mathcal{D}_{G'}^0$ .
B.7 Proof of Lemma 6: Edge-based almost holes as disconnecting sets
Proof. Initially, when none of the edges are added, there must be  $|V|$  connected components. By definition, each pair  $(0,d)\in \mathcal{D}^0$  corresponds to the death of one component. It follows that  $G_{f(x^{(d)})}$  has  $c = |V| - |\{(0,d)\in \mathcal{D}^0\mid d\leq f(x^{(d)})\} |$  connected components. If  $G$  has  $\beta^0$  connected components, the subgraph with vertices  $V$  and edges  $E\setminus \{e\in E\mid f(l(e))\geq f(x^{(d)})\}$  has more than  $\beta^0$  connected components. Thus,  $\{e\in E\mid f(l(e))\geq f(x^{(d)})\}$  is a disconnecting set of  $G$ .
B.8 Lemma 7: The reconstruction of a disconnecting set
Proof. Let  $\pi$  be the permutation of colors associated with a vertex-color filter function  $f$ , i.e., for a set of colors  $X = (x_{1},\ldots ,x_{m})$ , we have that  $f(x_{\pi (i)}) < f(x_{\pi (i + 1)})\forall i = 1,\ldots ,m - 1$ . Also, assume the colors associated with a disconnecting set  $S$  of a graph  $G = (V,E,l,X)$  is  $X_{S} = \{x_{\pi (k)},x_{\pi (k + 1)},\ldots ,x_{\pi (m)}\}$ .
If  $S$  is a minimal disconnecting set,  $(0, f(x_{\pi(k)}))$  must be an almost hole in  $\mathcal{D}$  since if we could add edges  $W \subseteq S$  with color  $x_{\pi(k)}$  without killing some connected component of  $G_{f(\pi(k-1))}$ , the set of edges  $S' = S \setminus W$  would form a proper disconnecting subset of a minimal disconnecting set. If  $S$  is not a minimal disconnecting, then there must be a proper subset  $S' \subset S$  that is a minimal disconnecting set of  $G$ . Now, we choose  $S'$  to be included first in the filtration, followed by elements of  $S \setminus S'$ . Thus, in both cases, there is a filtration s.t. an almost-hole  $(0, f(x_k))$  appears, which allows us to reconstruct  $S$ .
B.9 Proof of Theorem 2: The expressive power of edge-color filtrations
$[\leftarrow ]$  We split the proof of the backward direction into three cases.
Proof. Case 1: The color-disconnecting set  $Q$  equals to  $X \cup X'$ . This is a trivial case. If  $Q = X \cup X'$ ,  $G$  and  $G'$  have distinct numbers of connected components when all the edges are removed from both graphs. This means  $|V| \neq |V'|$ . Now, if  $|V| \neq |V'|$ , then  $|\mathcal{D}_G^0| \neq |\mathcal{D}_{G'}^0|$  for any filtration.
Case 2: The color-disconnecting set  $Q$  is an empty set. Now, the graphs have distinct number of connected component (even if none of the edges are removed), i.e.  $\beta_G^0 \neq \beta_{G'}^0$ . The diagrams differ for any filtration since they have different numbers of real holes.
Case 3: The color-disconnecting set  $Q \neq \emptyset$  is a proper subset of  $X \cup X'$ : The existence of a color-disconnecting set implies there is a set  $S \subset X \cup X'$  such that by removing the edges of colors  $S$ , the two graphs will have different numbers of connected components. Without loss of generality, we can assume that after removing the edges of colors  $S$ ,  $G$  has more components than  $G'$ . Now,