|
130 | 130 | "To understand what these persistence diagrams are telling us about the input weighted graphs, we briefly explain the **clique complex (or flag complex) filtration** procedure underlying the computations in ``VietorisRipsPersistence`` when ``metric=\"precomputed\"``, via an example.\n",
|
131 | 131 | "\n",
|
132 | 132 | "Let us start with a special case of a weighted graph with adjacency matrix as follows:\n",
|
| 133 | + "\n", |
133 | 134 | "- the diagonal entries (\"vertex weights\") are all zero;\n",
|
134 | 135 | "- all off-diagonal entries (edge weights) are non-negative;\n",
|
135 | 136 | "- some edge weights are infinite (or very very large).\n",
|
|
141 | 142 | "The procedure can be explained as follows: we let a parameter $\\varepsilon$ start at 0, and as we increase it all the way to infinity we keep considering the instantaneous subgraphs made of a) all the vertices in the original graph, and b) those edges whose weight is less than or equal to the current $\\varepsilon$. We also promote these subgraphs to more general structures called **(simplicial) complexes** that, alongside vertices and edges, also possess $k$**-simplices**, i.e. selected subsets of $k + 1$ vertices (a 2-simplex is an abstract \"triangle\", a 3-simplex an abstract \"tetrahedron\", etc). Our criterion is this: for each integer $k \\geq 2$, all $(k + 1)$-cliques in each instantaneous subgraph are declared to be the $k$-simplices of the subgraph's associated complex. By definition, the $0$-simplices are the vertices and the $1$-simplices are the available edges.\n",
|
142 | 143 | "\n",
|
143 | 144 | "As $\\varepsilon$ increases from 0 (included) to infinity, we record the following information:\n",
|
| 145 | + "\n", |
144 | 146 | "1. How many new **connected components** are created because of the appearance of vertices (in this example, all vertices \"appear\" in one go at $\\varepsilon = 0$, by definition!), or merge because of the appearance of new edges.\n",
|
145 | 147 | "2. How many new 1-dimensional \"holes\", 2-dimensional \"cavities\", or more generally $d$-dimensional **voids** are created in the instantaneous complex. A hole, cavity, or $d$-dimensional void is such only if there is no collection of \"triangles\", \"tetrahedra\", or $(d + 1)$-simplices which the void is the \"boundary\" of. *Note*: Although the edges of a triangle *alone* \"surround a hole\", these cannot occur in our particular construction because the \"filling\" triangle is also declared present in the complex when all its edges are.\n",
|
146 | 148 | "3. How many $d$-dimensional voids which were present at earlier values of $\\epsilon$ are \"filled\" by $(d + 1)$-simplices which just appear.\n",
|
|
242 | 244 | "And just as in the case of weighted graphs, we record the appearance/disappearance of connected components and voids as we keep increasing $r$.\n",
|
243 | 245 | "\n",
|
244 | 246 | "The case of point clouds can actually be thought of as a special case of the case of FCW graphs. Namely, if:\n",
|
| 247 | + "\n", |
245 | 248 | "1. we regard each point in the cloud as an abstract vertex in a graph,\n",
|
246 | 249 | "2. we compute the square matrix of pairwise (Euclidean or other) distances between points in the cloud, and\n",
|
247 | 250 | "3. we run the procedure explained above with $\\varepsilon$ defined as $2r$,\n",
|
|
278 | 281 | "What if, as is the case in many applications, our graphs have sparse connections and are unweighted?\n",
|
279 | 282 | "\n",
|
280 | 283 | "In ``giotto-tda``, there are two possibilities:\n",
|
281 |
| - "1. One can encode the graphs as adjacency matrices of non-fully connected weighted graphs, where all weights corresponding to edges which are present are equal to ``1.`` (or any other positive constant). See section ***Non-fully connected weighted graphs*** above for the different encoding conventions for sparse and dense matrices.\n", |
282 |
| - "2. One can preprocess the unweighted graph via [GraphGeodesicDistance](https://giotto-ai.github.io/gtda-docs/latest/modules/generated/graphs/processing/gtda.graphs.GraphGeodesicDistance.html) to obtain a FCW graph where edge $ij$ has as weight the length of the shortest path from vertex $i$ to vertex $j$ (and ``np.inf`` if no path exists between the two vertices in the original graph).\n", |
| 284 | + "\n", |
| 285 | + "1. Encode the graphs as adjacency matrices of non-fully connected weighted graphs, where all weights corresponding to edges which are present are equal to ``1.`` (or any other positive constant). See section ***Non-fully connected weighted graphs*** above for the different encoding conventions for sparse and dense matrices.\n", |
| 286 | + "2. Preprocess the unweighted graph via [GraphGeodesicDistance](https://giotto-ai.github.io/gtda-docs/latest/modules/generated/graphs/processing/gtda.graphs.GraphGeodesicDistance.html) to obtain a FCW graph where edge $ij$ has as weight the length of the shortest path from vertex $i$ to vertex $j$ (and ``np.inf`` if no path exists between the two vertices in the original graph).\n", |
283 | 287 | "\n",
|
284 | 288 | "### Example 1: Circle graph\n",
|
285 | 289 | "\n",
|
|
0 commit comments