# Computing Persistent Homology of Directed Flag Complexes
## 2 Results  
Flagger generates the (directed or undirected) flag complex of a finite (directed or undirected) graph from its connectivity matrix. The construction algorithm is parallelisable to an arbitrary number of cores, which proves extremely useful when working with very large graphs (see Figure 3). To save storage space and increase speed, only the graph is loaded into memory, while by default the much larger directed flag complex is never stored. This enables a very fast construction of the directed flag complex, and allows Flagger to deal with graphs of remarkable size (see Figure 2).  
The homology computation algorithm of Flagger is based in part on a rather new addition to the topological data analysis software collection, Ripser by [PERSON] [10]. However, since Flagger is designed to work primarily with graph data structures, it includes the capability to generate the flag complex of a finite graph from its connectivity matrix and perform computations on the complex without storing its simplices in memory. In addition the reduction algorithm and coboundary computation methods were modified and optimised for use with very large sparse graphical datasets. We performed a number of comparisons of Flagger with Gudhi, which showed that Flagger outperformed Gudhi when the dataset was large and sparse, while Gudhi performed better on denser datasets. However, some of the graphs we examined were so complex that none of the software we tested, including Flagger, were capable of finishing a precise computation (see 'SimpleWiki' in Table 7).  
To address this problem, Flagger includes an extremely useful feature: The Approximate function. In general when one performs data analysis computation, the order of magnitude of a specific homology module is much more important that the precise value of the Betti number in question. The Approximate function allows the homology computation part of the program to compute Betti numbers and persistent homology within a user defined accuracy, and as a result dramatically reduce compute time. With Flagger we are able to perform the construction of the directed flag complex of the neocortical column of a rat [5] on a laptop within less than 30 s, and compute a good approximation for its homology within a few of hours on an HPC cluster (Table 1). Such computations were completely out of reach before. The accuracy parameter for the Approximate function can be modified to suit requirements. Experimentation suggests (although we cannot prove it in general) that the actual accuracy of computations that use the Approximate function is much higher than the accuracy theoretically guaranteed (see Figure 1).  
Flagger has a built-in flexible way of associating weights to vertices and/or edges in a given graph, and the capability to have user defined weight functions that allow filtering the complex in question in a variety of ways. In particular this flexibility allows combining weights that arise from different features of the data to create a single filtration on the complex. Flagger also contains the capability of computing homology with coefficients in odd characteristics.  
The directed flag complex is only one of the topological constructions one may associate with a directed graph. Motivated by more recent ideas we developed modifications of Flagger: Flagger-count, Tournser, and Deltser (see Section 2.3 for detail).