# Computing Persistent Homology of Directed Flag Complexes
## 1 Introduction  
In an ongoing collaboration with the Blue Brain Project [1] and the Laboratory for Topology and Neuroscience [2], we study certain ordered simplicial complexes (Definition 3) arising from directed graphs that model brain microcircurty reconstructions created by the Blue Brain Project team. These complexes, which we refer to as directed flag complexes, generalise the usual concept of the flag complex (clique complex) associated to a graph, and prove particularly useful in studying directed networks in general and neural networks in particular. Over the past decade, homology and persistent homology, particularly in the form of persistent homology of Vietoris-Rips complexes of point clouds, entered the field of data analysis. Therefore, its efficient computation is of great interest, which led to several computational tools like Gudhi [3], PHAT [4] and quite a number of other packages. However, working with networks, and specifically with neural networks at this order of magnitude and level of detail, presents certain challenges that can not be addressed by existing software. One immediate problem is that network data is typically given in the form of a graph, rather than a point cloud. For instance, data emerging from the Blue Brain Project is typically encoded as a weighted directed graph. Since neurons and synaptic connections between them are modelled with great precision, if one wishes to exploit the full potential in the data, then considering the direction and weight of connections between nodes (neurons) is natural and in fact essential. To date we are not aware of any highly efficient software packages that are designed to work with directed graphs. The very impressive Gudhi package, for instance, is designed to work with simplicial complexes. The directed flag complex and numerous other topological constructions one may associate with a directed graph are not simplicial complexes. Hence to deal with networks that are directed by nature, one would need software capable of efficiently constructing various complexes one can associate with a directed graph. Furthermore, since the direction of connection does play an important role in the analysis, such software should be capable of incorporating information about direction as part of the data to be processed, beyond the mere construction of the complex. A second issue arises from the size of the networks in question. In our earlier work we considered networks in the order of magnitude of thirty thousand vertices and eight million directed edges (reconstructed neocortical column of a 14 day old rat [5]). Software was designed as part of the work that lead to the publication [6], and is freely available [7]. However, at that time the magnitude of the resulting complexes, typically six-dimensional with about 160 million simplices across all dimensions, limited our ability to conduct certain deeper investigations, as even the construction of the complexes required a considerable number of compute hours on a large High Performance Computing (HPC) node, and homology computations with the full complex were completely out of reach. More recent reconstructions by the Blue Brain Project team produced much larger and more complex models (see for instance the model of the full mouse cortex [8]). While advanced computational packages such as Gudhi and PHAT are perfectly capable of dealing with very large simplicial complexes due to the reduction techniques they use, they too fail to produce satisfactory results on networks of the size we are interested in, within reasonable compute time. Finally, we required a package that will allow us to flexibly associate weights to simplices in our complexes so that we could examine data with respect to a variety of filtrations. Inspired by our main object of study, neural networks, we had to take into account the fact that neurons have a very rich structure, as do connections between them.