*2.1. The Generalized EULER Characteristic*

In Refs. [21,22], the formulas for the Euler characteristic for graphs with the standard boundary conditions at the vertices and with the mixed ones, standard and Dirichlet boundary conditions at vertices, were derived. In the case of the standard boundary conditions,

$$\chi = 2 + 8\pi^2 \sum\_{\substack{k\_n \in \Sigma(L^\aleph(\Gamma)) \\ k\_n \neq 0}} \frac{\sin(k\_n/t)}{(k\_n/t)\left((2\pi)^2 - (k\_\mathcal{U}/t)^2\right)} |\_{t \ge t\_{0^\circ}} \tag{4}$$

where Σ(*L*st(Γ)) denotes the spectrum of the Laplacian *L*st(Γ) with the standard vertex conditions, taken in the square root scale, i.e., the numbers *kn* are the square roots of the eigenenergies *λ<sup>n</sup>* and *t* is a scaling parameter [19–21] with *t*<sup>0</sup> = <sup>1</sup> <sup>2</sup>*lmin* , where *lmin* is the length of the shortest edge of the graph. The above formula is equivalent to Equation (3); however, instead of using topological information about graphs or networks, such as the number of vertices |*V*| and edges |*E*|, it requires a certain number of the lowest eigenenergies (resonances) of graphs or networks.

For graphs and networks with the mixed boundary conditions, namely the standard and Dirichlet ones (|*VD*| = 0), the generalized Euler characteristic can be expressed by the following formula:

$$\chi\_G := \chi - |V\_D| = 8\pi^2 \sum\_{k\_n \in \Sigma(L^{\bullet D}(\Gamma))} \frac{\sin(k\_n/t)}{(k\_n/t)((2\pi)^2 - (k\_n/t)^2)} |t\_{\ge t\_0}| \tag{5}$$

In Equation (5), the spectrum of the Laplacian *L*st,D(Γ) with the standard and Dirichlet vertex conditions is denoted by Σ(*L*st,D(Γ)).

The above two equations can be unified into a single one for the generalized Euler characteristic:

$$\mathcal{E}(|V\_D|) = 2\delta\_{0,|V\_D|} + 8\pi^2 \sum\_{\substack{k\_\pi \in \Sigma(L(\Gamma)) \\ k\_\pi \neq 0}} \frac{\sin(k\_\pi/t)}{(k\_\pi/t)\left((2\pi)^2 - (k\_\pi/t)^2\right)} |\_{t \ge t\_0}. \tag{6}$$

Depending on the boundary conditions, Σ(*L*(Γ)) denotes either the spectrum of the Laplacian *<sup>L</sup>*st(Γ) or *<sup>L</sup>*st,D(Γ). In the borderline cases |*VD*| = 0 and |*VD*| = 0, E(|*VD*| = <sup>0</sup>) = *<sup>χ</sup>* and E(|*VD*| = 0) = *χG*, recovering, respectively, Equations (4) and (5).

From the experimental point of view, the usefulness of Equation (6) stems from the fact that the generalized Euler characteristic can be evaluated using only a limited number *K* = *Kmin* of the lowest eigenvalues (resonances) [21,22,68,69]

$$K \ge |V| + 2\mathcal{L}t \left[1 - \exp\left(\frac{-\epsilon\pi}{\mathcal{L}t}\right)\right]^{-1/2},\tag{7}$$

where |*V*| is the total number of graph vertices, L = <sup>∑</sup>*e*∈*<sup>E</sup> le* is the total length of the graph, and is the accuracy of determining the Euler characteristic from Formula (7). To obtain the smallest possible number of resonances *Kmin*, for a given accuracy , we assign to *t* its smallest allowed value *t* = *t*<sup>0</sup> = <sup>1</sup> <sup>2</sup>*lmin* . Since the Euler characteristic is an integer, the accuracy of its determination should be taken < 1/2. In our calculations of *Kmin*, we assumed = 1/4.

## *2.2. A Graph Split into Two Disconnected Subgraphs*

In order to simplify the description of the graphs, we introduce the following notation of graphs and networks Γ(|*V*|, |*E*|, |*VD*|), where |*V*| = |*VN*| + |*VD*|. A graph or network Γ(|*V*|, |*E*|, |*VD*|) contains |*V*| vertices, including |*VN*| and |*VD*| vertices with standard (Neumann) and Dirichlet boundary conditions and |*E*| edges.

We will consider a general situation when an original graph Γ*o*(|*Vo*|, |*Eo*|, |*VDo* |) is split into two disconnected subgraphs Γ*i*(|*Vi*|, |*Ei*|, |*VDi* |), *i* = 1, 2, at the common for the subgraphs vertices *Vc*, which are characterized by the Neumann boundary conditions. In the partition process, each common vertex *v* ∈ *Vc* will be split into two new vertices belonging to the different subgraphs (see Figure 1).

The generalized Euler characteristics of the original graph and its subgraphs are E*o*(|*VDo* |) = |*Vo*|−|*Eo*|−|*VDo* | and E*i*(|*VDi* |) = |*Vi*|−|*Ei*|−|*VDi* |, *i* = 1, 2, respectively. The relationships between the number of vertices and edges of the graphs are the following: |*Vo*| + |*Vc*| = |*V*1| + |*V*2|, |*Eo*| = |*E*1| + |*E*2|. It leads to the following relationship between E*o*(|*VDo* |) and E*i*(|*VDi* |), *i* = 1, 2

$$\mathcal{E}\_1(|V\_{\rm D\_1}|) + \mathcal{E}\_2(|V\_{\rm D\_2}|) = \mathcal{E}\_o(|V\_{\rm D\_o}|) + |V\_{\rm c}| + |V\_{\rm D\_o}| - |V\_{\rm D\_1}| - |V\_{\rm D\_2}|.\tag{8}$$

where |*Vc*| denotes the number of common vertices.

In Figure 1, we show the case when the original graph Γ*o*(|*Vo*| = 6, |*Eo*| = 9, |*VDo* | = 0) = Γ*o*(6, 9, 0) is divided into two subgraphs Γ1(4, 6, 0) and Γ2(4, 3, 0). Using Equation (8), one can find that the subgraphs before the disconnection were connected in |*Vc*| = 2 common vertices. In this relatively simple situation, the generalized Euler characteristics of the graphs or networks can be found from their topological properties, i.e., the numbers of vertices and edges of the graphs. However, if we do not see the graphs and therefore do not know their topological properties but we know their eigenvalues (spectra), the only available solution to the problem is to use Equation (6) to find their generalized Euler characteristics and consequently the number |*Vc*| of the common vertices. The same situation exists for the graphs possessing the Dirichlet boundary conditions. In this case, in order to identify them, one needs to know (measure) the eigenvalues (resonances) of graphs or networks and use Equations (6) and (8) to evaluate the number |*Vc*| of the common vertices.

**Figure 1.** The scheme of the original graph Γ*o*(6, 9, 0), which was divided into two subgraphs Γ1(4, 6, 0) and Γ2(4, 3, 0). All graphs possess the vertices with the Neumann boundary conditions, which are marked by blue capital letters *N*. In the case of the graphs with the mixed boundary conditions, the original graph Γ*o*(6, 9, 1) was divided into two subgraphs Γ1(4, 6, 0) and Γ2(4, 3, 1). The vertices with the Dirichlet boundary conditions are marked by red capital letters *D*. The vertices where a vector network analyzer was connected to the microwave networks simulating quantum graphs presented in this figure are marked by VNA.
