Mapping flows on hypergraphs
MMapping flows on hypergraphs
Anton Eriksson, ∗ Daniel Edler, Alexis Rojas, and Martin Rosvall
Integrated Science Lab,Department of Physics,Umeå University, SE-901 87 Umeå,Sweden (Dated: December 23, 2020)
Hypergraphs offer an explicit formalism to describe multibody interactions in complex systems. To connectdynamics and function in systems with these higher-order interactions, network scientists have generalisedrandom-walk models to hypergraphs and studied the multibody effects on flow-based centrality measures.But mapping the large-scale structure of those flows requires effective community detection methods. Wederive unipartite, bipartite, and multilayer network representations of hypergraph flows and explore how theyand the underlying random-walk model change the number, size, depth, and overlap of identified multilevelcommunities. These results help researchers choose the appropriate modelling approach when mappingflows on hypergraphs.
Researchers model and map flows on networks to identify impor- tant nodes and detect significant communities . From small tolarge system scales, random walk-based methods help to uncoverthe inner workings of the systems the networks represent . Whenstandard network models fail to adequately represent a system’sinteractions, researchers turn to higher-order models of complexsystems , including multilayer networks for multitype inter-actions, non-Markovian networks for multistep interactions,and combinatorial models such as simplicial complexes and hypergraphs with nodes in hyperedges for multibodyinteractions.While several methods can identify flow-based communities inmultilayer and memory networks with non-Markoviandynamics, researchers have just begun to unravel the large-scalesystemic effects of multibody interactions captured by hyper-graphs . However, different systems and research questionscall for different random walk and hypergraph models: Randomwalks can be lazy, able to visit the same node multiple timesin a row, or non-lazy and forced to move on. Hyperedges canhave arbitrary weights, and nodes can have hyperedge-dependentweights. Because these and other models can be represented withdifferent network types – bipartite, unipartite, and multilayer – the questions multiply: How do different hypergraph random-walkmodels combined with different network representations changethe flow dynamics at scales captured by communities?For example, random walks on hypergraphs can model the flowof ideas in co-authorship networks. A node represents an author,and a hyperedge connects all authors of a paper. In the simplestdynamics, a random walker on a node picks a random hyperedgeamong those that contain the node and steps to a random node ofthe picked hyperedge. Then repeats. Excluding author self-linksfor non-lazy walks or including hyperedge weights from papercitations or using hyperedge-dependent node weights for varyingauthor contributions are natural model variations that generate ∗ [email protected] different dynamics . How does the organisation of authors in nested communities from research groups to research areas changewith random-walk model and representation?For lazy random walks on hypergraphs with self-links andhyperedge-independent node weights, random walks on weighted,undirected networks generate equivalent dynamics . Each hyper-edge becomes a clique with properly adjusted link weights. Thisprojection enables standard flow-based methods developed forweighted networks to identify communities where random walksstay for a long time. Non-lazy walks or walks with hyperedge-dependent node weights require directed networks . A bipartiterepresentation provides hyperedge assignments, and a multilayerrepresentation enables overlapping communities.Representing hypergraphs with bipartite networks requiresweighted, directed links between two sets of nodes: one for thenodes and one for the hyperedges. Picking a random hyperedgebecomes an explicit step to a hyperedge node. Non-lazy walks onthe hypergraph require non-backtracking walks on the bipartitenetwork . With proper normalisation, the node-visit rates staythe same. Though unipartite and bipartite representations giveidentical node flows, the bipartite representation’s link flows fromnodes to hyperedge nodes and back to nodes can induce moreflows between communities and alter the optimal community com- position. The community-detection algorithm must also assignmore nodes, which implies more degrees of freedom and a largersearch space.Multilayer networks represent the hyperedges as layers withfully connected groups of nodes. Each node is present in each of itshyperedge layers. Hyperedge weights become layer weights, andhyperedge-dependent node weights become layer-dependent nodeweights. Though the node visit rates aggregated over layers remainthe same, multilayer networks multiply the degrees of freedomand enable new models. Reducing the inter-layer link weightsincreases the time a random walker spends within a hyperedgebefore moving to another. Reducing the inter-layer link weightsonly between dissimilar layers reinforces flows within similarlayers. The search space expands when nodes can belong tomultiple overlapping communities. a r X i v : . [ phy s i c s . s o c - ph ] J a n a bcd fe jhg i a bcd fe jhg ia b c d fe jhg i (a) (b) (c) (d) Fig. 1. A schematic hypergraph represented with three types of networks. (a) The schematic hypergraph with weighted hyperedges and hyperedge-dependent node weights. Thin borders for weight 1 and thick borders for weight 3. A lazy random walk on the schematic hypergraph represented on:(b) a bipartite network, (c) a unipartite network, and (d) a multilevel network. The colours indicate optimised module assignments, in (d) for hyperedge-similarity walks.
The many combinations of random-walk models and represen-tations available to address specific research problems require usto ask, for different data and different questions, which model andrepresentation is best?
To address which combination of model and representation isbest for answering different questions about various hypergraphdata, we derive unipartite, bipartite, and multilayer network repre-sentations of hypergraph flows with identical node-visit rates forthe same random-walk model. For unique node-visit rates whena representation requires directed links, we apply an unrecordedteleportation scheme robust to changes in the teleportation rateand that preserves the node-visit rates when teleportation is super-fluous in undirected networks . The information-theoretic andflow-based community detection method Infomap allows us toexplore how different hypergraph random-walk models and net-work representation change the number, size, depth, and overlapof identified multilevel communities.By analysing schematic and real hypergraphs, we find thatthe bipartite network representation requires the fewest links andenables the fastest community detection. A multilayer networkrepresentation that reinforces flows within similar layers gives thedeepest modular structures with the most overlapping communitiesbut at a high computational cost. The unipartite network repre-sentation provides a trade-off between the two, with intermediatecompactness, speed, and detectable modular regularities. Results and Discussion
Modelling flows on hypergraphs . We model flows on hyper-graphs with random walks, using hypergraphs with nodes 𝑉 ,hyperedges 𝐸 with weights 𝜔 , and hyperedge-dependent nodeweights 𝛾 . Each hyperedge 𝑒 has a weight 𝜔 ( 𝑒 ) . Each node 𝑢 with incident hyperedges 𝐸 ( 𝑢 ) = { 𝑒 ∈ 𝐸 : 𝑢 ∈ 𝑒 } has a weight 𝛾 𝑒 ( 𝑢 ) for each incident hyperedge 𝑒 . To simplify the notationwhen normalising weights into probabilities, we denote node 𝑢 ’stotal incident hyperedge weight 𝑑 ( 𝑢 ) = (cid:205) 𝑒 ∈ 𝐸 ( 𝑢 ) 𝜔 ( 𝑒 ) and hy-peredge 𝑒 ’ total node weight 𝛿 ( 𝑒 ) = (cid:205) 𝑢 ∈ 𝑒 𝛾 𝑒 ( 𝑢 ) . With theseweights, a lazy random walker moves from node 𝑢 at time 𝑡 tonode 𝑣 at time 𝑡 + :1. Picking hyperedge 𝑒 among node 𝑢 ’s hyperedges 𝐸 ( 𝑢 ) withprobability 𝜔 ( 𝑒 ) 𝑑 ( 𝑢 ) . 2. Picking one of the hyperedge 𝑒 ’s nodes 𝑣 with probability 𝛾 𝑒 ( 𝑣 ) 𝛿 ( 𝑒 ) .3. Moving to node 𝑣 . Variations include non-lazy walks, which never visit the samenode twice in a row with a modified second step2b. Picking one of the hyperedge 𝑒 ’s nodes 𝑣 ≠ 𝑢 with proba-bility 𝛾 𝑒 ( 𝑣 ) 𝛿 ( 𝑒 )− 𝛾 𝑒 ( 𝑢 ) ,and teleporting walks, which jump to a random node at somerate to ensure that all nodes can be reached from any node in afinite number of moves, so-called ergodic walks. We pick thenext hyperedge based on its similarity to the previously pickedhyperedge in hyperedge-similarity walks, which are useful formodelling flows that tend to stay among similar hyperedges suchas among research papers with similar author lists and likelysimilar topics. These walks require memory and correspond toa higher-order Markov chain model because they depend on thepreviously picked hyperedge.The bipartite, unipartite, and multilayer network representationshave different advantages and limitations (Fig. 1). A weighted,undirected network suffices for memoryless lazy random walkswithout hyperedge-dependent node weights, hyperedge-dependent node weights require directed networks, and hyperedge-similaritywalks require multilayer networks.Bipartite networks offer the most direct representation of thethree-step random-walk process above. We represent the hyper-edges with hyperedge nodes, and the three steps become a two-stepwalk between the nodes at the bottom and the hyperedge nodes atthe top in Fig. 1b. For simplicity, we refer to them as nodes andhyperedge nodes. First a step from a node 𝑢 to a hyperedge node 𝑒 , 𝑃 𝑢𝑒 = 𝜔 ( 𝑒 ) 𝑑 ( 𝑢 ) , (1)and then a step from the hyperedge node to a node 𝑣 , 𝑃 𝑒𝑣 = 𝛾 𝑒 ( 𝑣 ) 𝛿 ( 𝑒 ) . (2)By starting the random walk on the nodes and taking two stepsat a time, corresponding to a two-step Markov process , hyper-edge nodes are only intermediate stops with zero flow when therandom walk is back on the nodes after two steps. The station-ary distribution of the random walk is concentrated to the nodes.For non-lazy walks represented with bipartite networks, we useso-called state nodes in the hyperedge nodes. One state nodefor each incoming link has out-links to all nodes in the hyperedge,except the incoming link’s source ensures that the walks are notbacktracking (Fig. 2). a b c d fe jhg i Fig. 2. Bipartite network with state nodes for non-lazy random walks. Toprevent random walks on bipartite networks from visiting the same nodeat the bottom twice in a row by backtracking from the hyperedge nodeat the top, we use state nodes in the hyperedge nodes. Each hyperedgenode requires one state node for each node in the hyperedge. The statenodes have one incoming link from its source node and outgoing links toall other nodes in the hyperedge. Colours indicate the optimised partitionin Fig. 3(b).
To represent the random walk on a unipartite network, weproject the three-step random-walk process down to a one-stepprocess between the nodes and describe it with the transition ratematrix 𝑃 𝑢𝑣 = ∑︁ 𝑒 ∈ 𝐸 ( 𝑢,𝑣 ) 𝑃 𝑢𝑒 𝑃 𝑒𝑣 = ∑︁ 𝑒 ∈ 𝐸 ( 𝑢,𝑣 ) 𝜔 ( 𝑒 ) 𝑑 ( 𝑢 ) 𝛾 𝑒 ( 𝑣 ) 𝛿 ( 𝑒 ) , (3)where 𝐸 ( 𝑢, 𝑣 ) = { 𝑒 ∈ 𝐸 : 𝑢 ∈ 𝑒, 𝑣 ∈ 𝑒 } is the set of hyperedgesincident to both nodes 𝑢 and 𝑣 . Each hyperedge forms a fullyconnected group of nodes (Fig. 1c). Unipartite networks fornon-lazy walks have no self-links. Compared with the bipartiterepresentation, the unipartite representation with fully connectedgroups of nodes requires more links. To represent the random walk on a multilayer network, weproject the three-step random-walk process down to a one-stepprocess on state nodes in separate layers 𝛼 for each hyperedge 𝑒 .A state node 𝑢 𝛼 represents 𝑢 in each layer 𝛼 ∈ 𝐸 ( 𝑢 ) that containsthe node. All state nodes in the same layer form a fully connectedset (Fig. 1d). The transition rate between state node 𝑢 𝛼 in layer 𝛼 and state node 𝑣 𝛽 in layer 𝛽 is 𝑃 𝛼𝛽𝑢𝑣 = 𝜔 ( 𝛽 ) 𝑑 ( 𝑢 ) 𝛾 𝛽 ( 𝑣 ) 𝛿 ( 𝛽 ) for 𝛽 ∈ 𝐸 ( 𝑢, 𝑣 ) . (4)Node 𝑢 ’s state node visit rates in different layers sum to 𝑢 ’svisit rate in the unipartite and bipartite representations. Withone state node per hyperedge layer that contains the node, themultilayer representation requires the most nodes and links todescribe the walk. But this cost comes with benefits: the multilayer representation can describe higher-order Markov chains, whichcan capture more regularities in the data.For example, a useful variant of the basic hypergraph randomwalk is to pick a hyperedge not only proportional to its weightbut also proportional to its similarity to the hyperedge picked inthe previous step. To include hyperedge-dependent node weightinformation in the similarity measure, we use one minus the Jensen-Shannon divergence (JSD) between the transition rate vectors P 𝛼𝑣 and P 𝛽𝑣 to nodes at layers 𝛼 and 𝛽 as the hyperedge couplingstrength, 𝐷 𝛼𝛽𝑢 = 𝜔 ( 𝛽 ) [ − 𝐽𝑆𝐷 ( 𝛼, 𝛽 )] = 𝜔 ( 𝛽 ) (cid:20) − 𝐻 (cid:18) P 𝛼𝑣 + P 𝛽𝑣 (cid:19) + 𝐻 ( P 𝛼𝑣 ) + 𝐻 (cid:0) P 𝛽𝑣 (cid:1)(cid:21) (5)for 𝛽 ∈ 𝐸 ( 𝑢, 𝑣 ) . With node 𝑢 ’s total incident hyperedge weight in layer 𝛼 𝑆 𝛼𝑢 = ∑︁ 𝛽 ∈ 𝐸 ( 𝑢 ) 𝐷 𝛼𝛽𝑢 , (6)the hyperedge-similarity walk has the transition rates 𝑃 𝛼𝛽𝑢𝑣 = 𝐷 𝛼𝛽𝑢 𝑆 𝛼𝑢 𝛾 𝛽 ( 𝑣 ) 𝛿 ( 𝛽 ) for 𝛽 ∈ 𝐸 ( 𝑢, 𝑣 ) . (7)Because the transition rates at a node depend on the currentlayer, the random walks generate non-Markovian dynamics that aunipartite or bipartite network representation cannot capture.To ensure ergodic node-visit rates, we derived an unrecordedteleportation scheme that leaves the node-visit rates unchangedwhen teleportation is superfluous for hypergraphs with hyperedge-independent node weights, robust to changes in the teleportationrate when teleportation is needed , and independent of the repre-sentation (see Methods). Mapping flows on hypergraphs . To identify flow-based commu-nities or modules in hypergraphs, we seek to compress a modular description of random walks on the network representations guidedby their links. We cast the problem of finding flow-based commu-nities in hypergraphs as a minimum-description-length problemwith the map equation framework . With this compression-basedframework, we can compare how much the different representa-tions compress modular flows.When used to detect communities, the representation mattersbecause bipartite, unipartite, and multilayer networks provide thecommunity-detection algorithm Infomap with different degreesof freedom . Infomap assigns only nodes to communities in aunipartite network, but assigns also hyperedge nodes in a bipartitenetwork. The multilayer network, with a state node for eachhyperedge a node belongs to, implies even more node assignmentsand possibly overlapping communities.When mapping flows modelled by lazy and non-lazy randomwalks on the schematic network in Fig. 1, the optimal partitions Table I. Optimal flow-based communities of the schematic hypergraph inFig. 1 represented with different networks. The number of nodes includesstate nodes for the multilevel representations and the bipartite non-lazyrepresentation. We measure the overlap as the perplexity of the optimalsolutions (see Methods).
Representation Nodes Links Modules Codelength Overlap(bits)
Lazy
Bipartite 15 32 2 2.90 –Unipartite 10 40 3 2.35 –Multilayer 16 98 3 2.35 1.00Multilayer h-s a
16 98 4 2.28 1.09
Non-lazy
Bipartite 26 52 2 3.00 –Unipartite 10 30 3 2.63 –Multilayer 16 68 3 2.62 1.10Multilayer h-s a
16 68 4 2.32 1.29 a hyperedge-similarity of the bipartite networks have two communities, whereas theunipartite and multilayer networks have three communities (Table Iand Fig. 3). The bipartite network favours fewer modules – usingthe optimal three-module partition of the unipartite network onthe bipartite network gives code length 3.29 bits instead of 2.90bits for two modules –– because the random walker transitionsmore frequently between modules when they include hyperedges:Even if a hyperedge node contains no flows at the end of each two-step walk from node through hyperedge node to node, assigningit to a module costs extra bits when it has nodes in multiplemodules. For example, if nodes 𝑎 , 𝑏 , and 𝑐 in the bipartitenetwork in Fig. 1(b) would belong to a third green module as inthe optimal unipartite solution, and the random walker at node 𝑐 would return to the hyperedge it comes from before revisitingnode 𝑐 , it would first need to exit the green module and enterthe orange module, then exit the orange module and re-enter thegreen module. The corresponding walk on the unipartite networkstays within the green module. As a result, the unipartite networkrepresentation favours more, smaller modules than the bipartitenetwork representation for lazy and non-lazy walks (Table I). Multilayer networks enable further compression with overlap-ping modules. But for this small network, only non-lazy walks giveoverlapping modules with 0.01 bits compression gain (Table I).With walks that preferentially move to similar hyperedges, theoptimal partitions of the multilayer hyperedge-similarity networkrepresentations for lazy and non-lazy random walks both havemore overlap in four modules (Table I and Fig. 3). The hyperedge-similarity walks favour these overlapping modules because theystay longer within them than the regular walks.For a given random-walk model, the representations give equiv-alent node-visit rates but alter the link flows, and with differentlink flows, the optimal partition can change. The bipartite networkrepresentation favours partitions with fewer modules than the uni-partite network representation because assigning hyperedge nodesto modules implies encoding more transitions between modules.Multilayer representations, especially with walks that spend longer
Multilayer h-s a MultilayerUnipartiteBipartite (a)(b) g, h, i, ja, b, cd, e, f gd, e, fa, b, ca, b, cc, f, gd, e, fg, h, i, jg, h, i, j g, h, i, ja, b, cd, e, f
Fig. 3. Alluvial diagrams of optimal partitions for the schematic hypergraphin Fig. 1. (a) Optimal partitions for lazy walks represented with the networksin Fig. 1(b-d). (b) Optimal partitions for non-lazy walks. time among similar hyperedges, favour more overlapping modules.The random-walk model determines how much the multilayernetwork modules overlap. Non-lazy and hyper-edge similaritywalks favour overlap because they lead to longer persistence timesamong nodes in possibly overlapping groups.
Experiments . To illustrate how the network representation affectsdetected communities in real hypergraphs, we generated a collab-oration hypergraph from the 734 references in
Networks beyondpairwise interactions: Structure and dynamics by F. Battistonet al. We modelled the referenced articles as hyperedges and theirauthors as nodes. Authors with multiple articles form connectionsbetween the hyperedges. We analysed the largest connected com- ponent with | 𝑉 | =
361 author nodes in | 𝐸 | =
220 hyperedges.The median number of authors in a hyperedge is 3, and the authorshave contributed to 2.2 articles on average though most have onlycontributed to one.We assigned the relative importance of references by theirnumber of citations 𝑐 in December 2020. Some references hadno citations and some were highly cited. One such example is Diffusion of innovations by Everett M. Rogers, with more than120 ,
000 citations. To avoid disproportionally large or smallhyperedge weights 𝜔 ( 𝑒 ) , we weighted the edges by the logarithmof the number of citations and added unit constants to avoid thezero citation problem, 𝜔 ( 𝑒 ) = ln ( 𝑐 + ) + . (8)We modelled the authors’ different contributions to articles byassigning higher weights to the first and last author . We used Table II. Optimised flow-based multilevel communities of the collabo-ration hypergraph represented with different networks. The number ofnodes includes state nodes for the multilevel representations and the bi-partite non-lazy representation. Shortest codelength of 100 trials with thevariance in parenthesis. We measure the overlap as the perplexity of theoptimised solutions (see Methods).
Representation Nodes Links Modules CodelengthTop Leaf Levels Overlap (bits)
Lazy
Bipartite 581 1,560 4 23 3 – 5.178(1)Unipartite 361 2,607 9 69 4 – 3.82557(2)Multilayer 780 17,193 9 76 4 1.003 3.82730(2)Multilayer h-s a
780 17,193 8 90 4 1.127 3.54939(3)
Non-lazy
Bipartite 1,141 3,548 5 25 3 – 5.1733(2)Unipartite 361 2,246 7 49 4 – 4.25104(8)Multilayer 780 12,843 7 54 4 1.098 4.16349(8)Multilayer h-s a
780 12,843 9 66 4 1.181 3.70432(1) a hyperedge-similarity the edge-dependent node weights 𝛾 𝑒 ( 𝑣 ) = (cid:40) 𝑣 is first or last author,1 otherwise. (9)We assumed equal contribution for alphabetically sorted authors,and assigned all of them weight 𝛾 ( 𝑣 ) =
1. This model ranks aco-corresponding author’s contributions lower than those of thecorresponding authors.To study how hypergraph representations and random-walkmodels affect the community structure, we generated bipartite,unipartite, and multilayer representations for lazy and non-lazyrandom walks on the collaboration network. We identified nestedhierarchical partitions in each network with Infomap, using 100independent searches for each network. Infomap’s running timedepends on the number of nodes, links, and solution levels: Thebipartite and unipartite representations finished 3–7 times fasterthan the multilayer representations. The non-lazy bipartite repre-sentation with many state nodes ran almost as long.
The optimised partitions for the lazy and non-lazy representa-tions behave like the schematic example: The bipartite represen-tations have the fewest leaf modules and highest codelengths, andthe multilayer hyperedge-similarity representations have the mostleaf modules and shortest codelengths, with the unipartite and theregular multilayer representations in between (Table II). Exceptfor the non-lazy bipartite representation with its many state nodes,the lazy representations have more leaf modules and shorter codelengths than their corresponding non-lazy representations becausethe lazy random walk is more confined than the non-lazy randomwalk.With more nodes than in the schematic example, the solutionshave more depth. The bipartite solutions have three, and the uni-partite and multilayer solutions have four hierarchical levels. Theunipartite and multilayer solutions also have more top modules.With non-lazy dynamics, they split the largest top module, and
Multilayer h-s a MultilayerUnipartiteBipartite (a)(b)
NewmanPetriBianconiMorenoBianconiPetriBickPerc NewmanFanelliNewman BianconiPetriBickSigmundPorterPikovskyPercNewmanPetriBianconiSigmundPikovskyLatoraMorenoPerc
Fig. 4. Alluvial diagrams of optimised partitions for different representa-tions of the collaboration hypergraph . Lazy walks in (a) and non-lazy walksin (b). Module names from the top-ranked author within each module. in the lazy dynamics, they split the two largest top modules. Butthe second-largest top module reunites in the hyperedge-similarityrepresentation, with stronger connections between similar hyper-edges (Fig. 4 and Fig. 7 in Appendix A). The unipartite andmultilayer solutions are also most similar at the leaf level (Fig. 8in Appendix A).In this larger example, the multilayer hyperedge-similarity rep-resentations give more overlap. The non-lazy representationsresult in higher average overlap because random walkers visit-ing a node must continue to other nodes, often in the same or asimilar hyperedge layer. When random walkers from dissimilarhyperedges come together at a node, they tend to return to where they came from and favour overlapping modules. The non-lazyrepresentations also result in higher max overlap with the sameauthors topping all representations (Fig. 5).In line with the information-theoretic duality between findingregularities in data and compressing those data, representationsthat enable deeper solutions with more modules have shortercodelengths (Table II). The lazy multilayer representation is anexception. Its optimised codelength is bound above by the lazyunipartite representation’s codelength – they have the same code-length for the same hard partition – and overlapping modules canpotentially reduce the codelength. Infomap’s best codelength wasinstead 0.05 percent longer than for the lazy unipartite representa-tion. Multilayer representations with their many state nodes andlinks aggravate the search problem, and Infomap could not finda better solution in 100 attempts. But the gain from overlappingmodules is higher for the non-lazy multilayer representation and
Boccaletti Boccaletti BoccalettiPorter Porter PorterKurths Kurths KurthsCaldarelli Caldarelli CaldarelliScarpino Scarpino ScarpinoPeixoto Peixoto PeixotoLoreto Loreto Loreto
Lazy Lazy h-s Non-lazy Non-lazy h-s E ff e c t i v e a ss i gn m en t s Fig. 5. Authors in the collaboration hypergraph with the highest averageeffective number of assignments in the lazy and non-lazy multilayer rep-resentations (see Methods).
Infomap finds a solution with a significantly shorter codelength.
A case study on fossil data . Palaeontologists classify majorgroups of marine animals archived in the fossil record into global-scale faunas that change over time . They have used differentnetwork representations to understand the macroevolutionary pat-tern of marine biodiversity . However, it is still unclear howsuch an organisation of marine animals into modules represent-ing global faunas changes with random-walk model and networkrepresentation. To illustrate how the network representation ofthe underlying paleontological data affects empirical estimates ofthis macroevolutionary pattern, we generated a hypergraph fromgenus-level fossil occurrences presented in ref. 30 and retrieved from the PaleoDB . We restricted our analysis to fossil occur-rences from the Cambrian (541 MY) to the Cretaceous period (66MY) and modelled 77 geological stages as hyperedges and 13,276genera as nodes. Genera occurring in multiple geological stagesform connections between hyperedges. We weighted the hyper-edges by dividing the number of samples where a genus occurs ina given geological stage by the total number of samples recordedat the stage, a procedure modified from ref. 33. We generated bi-partite, unipartite, and multilayer network representations for lazyand non-lazy random walks from the underlying palaeontologydata and identified optimised partitions in the assembled networksusing Infomap.For lazy random walks, Infomap partitioned only the multilayerrepresentations into multilevel communities: three modules at thefirst hierarchical level [Fig. 6(a)]. Similar to the schematic exam-ple and the collaboration hypergraph, the bipartite representation Multilayer h-s a MultilayerUnipartiteBipartite (a)(b)
Cambrian CambrianOrdovician OrdovicianSilurian-Devonian SilurianCarboniferous-PermianCambrianOrdovicianSilurian-DevonianCarboniferous-Permian Carboniferous-PermianMesozoic CretaceousJurassicTriassicCretaceousJurassicTriassic DevonianCambrianOrdovicianSilurianCarboniferous-PermianCretaceousJurassicTriassicDevonian
Fig. 6. Alluvial diagrams of optimised partitions for the fossil hypergraphrepresented with different networks. Lazy walks in (a) and non-lazy walksin (b). We show top modules when a partition lacks deeper levels and leafmodules marked with dashed lines when they exist. Module names fromthe geological period or era represented by the fauna assemblage. for the lazy random walks has the fewest leaf modules and thehighest codelength. The multilayer hyperedge-similarity repre-sentation has the most leaf modules and the shortest codelength(Table III).For non-lazy random walks, Infomap partitioned the bipartiterepresentation into a multilevel solution with shorter codelengththan the unipartite representation and the standard multilevel rep-resentation [Fig. 6(b)]. The multilayer hyperedge-similarity rep-resentation once more provides the most leaf modules and thehighest overlap.The multilayer network representations, including lazy andnon-lazy random walks, reproduce modules reminiscent of theCambrian, Paleozoic, and modern evolutionary faunas widely used in macroevolutionary research . Also, leaf modules in themultilayer representations capture subfaunas from specific geolog-ical periods as nested modules such as Silurian, Triassic, Jurassic,and Cretaceous. Infomap applied to the bipartite representation ofthe non-lazy random walks identified similar subfaunas but com-bined Cambrian and Paleozoic faunas into a single top module,obscuring the large-scale pattern. Overall, our results indicatesome advantages of using multilayer over bipartite and unipartiterepresentations of fossil occurrence data to quantify the marinebiodiversity’s macroevolutionary patterns, with lazy and non-lazyrandom walks providing similar solutions. Conclusions
We have derived unipartite, bipartite, and multilayer networkrepresentations of hypergraph flows with different advantages.
Table III. Optimised flow-based multilevel communities of the fossil hypergraph represented with different networks. The number of nodes includes statenodes for the multilevel representations and the bipartite non-lazy representation. The number of non-trivial top and leaf modules. Average number oflevels weighted by the flow volume. We measure the overlap as the perplexity of the optimised solutions (see Methods). Shortest codelength of 20 trialswith the variance in parenthesis.
Representation Nodes Links Modules Codelength Time (× ) (× ) Top Leaf Levels Overlap (bits) (hh:mm:ss)
Lazy
Bipartite 13 79 5 8 2.02 – 10.50927(5) 00:00:06Unipartite 13 16,155 6 13 2.02 – 10.3953503(1) 00:13:24Multilayer 40 174,490 3 17 3.00 1.011 10.39819(1) 09:08:43Multilayer h-s a
40 174,490 3 19 3.28 1.135 9.84170(1) 14:19:39
Non-lazy
Bipartite 53 25,937 2 15 3.02 – 10.34889(3) 01:14:25Unipartite 13 16,141 6 12 2.02 – 10.4031798(6) 00:13:04Multilayer 40 174,209 3 15 3.00 1.010 10.406141(9) 08:55:03Multilayer h-s a
40 174,209 3 16 3.00 1.135 9.84912(1) 13:23:13 a hyperedge-similarity We used the information-theoretic and flow-based communitydetection method Infomap to explore how different hypergraphrandom-walk models and network representation change the num-ber, size, depth, and overlap of identified multilevel communities.By identifying flow-based communities both in a schematic andreal hypergraphs – a small collaboration hypergraph of researchersworking on networks beyond pairwise interactions and a large fau-nal hypergraph of sampled species across geological stages – wefound that the bipartite network representation is the most com-pact and enables the fastest community detection. A multilayernetwork representation that reinforces flows within similar layers– one for each hyperedge – gave the deepest modular structureswith the most module overlap. But the modular detection gaincomes at a high computational cost: Combining fully connectedlayers with other layers requires many more nodes and links thanin the bipartite network representation. If the research questiondoes not require hyperedge assignments or overlapping modules,the unipartite network representation provides a trade-off with in-termediate compactness, speed, and the ability to reveal modularregularities. Among the random-walk models, lazy walks typi-cally give more modules in deeper nested structures, and non-lazy walks provide higher modular overlap. Our methods and resultshelp researchers model and map flows on hypergraphs to studythe effects of multibody interactions in complex systems.
Methods
Unrecorded teleportation . With hyperedge-independent nodeweights where 𝛾 𝑒 ( 𝑢 ) = 𝛾 ( 𝑢 ) for all hyperedges 𝑒 ∈ 𝐸 ( 𝑢 ) , undi-rected weighted networks can represent the dynamics, and thestationary distribution of the random walk 𝜋 𝑢 is proportional tothe product of node 𝑢 ’s total incident hyperedge weight 𝑑 ( 𝑢 ) andweight 𝛾 ( 𝑢 ) . With normalised node-visit rates , 𝜋 𝑢 = 𝑑 ( 𝑢 ) 𝛾 ( 𝑢 ) (cid:205) 𝑣 ∈ 𝑉 𝑑 ( 𝑣 ) 𝛾 ( 𝑣 ) . (10)For the multilayer network representation, the node-visit rates splitbetween layers based on the node 𝑢 ’s incident hyperedge weight per layer state node 𝜋 𝛼𝑢 = 𝜔 ( 𝛼 ) 𝛾 ( 𝑢 ) (cid:205) 𝑣 ∈ 𝑉 𝑑 ( 𝑣 ) 𝛾 ( 𝑣 ) . (11)With hyperedge-dependent node weights 𝛾 𝑒 ( 𝑢 ) , only directedweighted networks can represent the dynamics. We use randomteleportation to ensure ergodic walks when deriving the node-visitrates with the power-iteration method. Unrecorded teleportationto links minimises the distortion : In each iteration of the power-iteration method, we distribute a fraction 𝜏 = .
15 of each node’sflow volume among all nodes proportional to their out-link weights.The remaining flow volume moves on the links proportional totheir weights. In the last iteration, we move all flows on thelinks proportional to their weights and record all flows on linksand nodes to obtain the ergodic node- and link-visit rates withunrecorded teleportation. This procedure gives equivalent visitrates as simulating a random walker that only records moves onlinks: With probability 1 − 𝜏 , the random walker moves to a nodeby following the links proportional to their weights and records thelink and the target node. With probability 𝜏 , the random walkerteleports without recording to the link’s source node proportional to the link weight. The normalised number of recordings of eachnode and link gives the visit rates.We want teleportation applied to undirected networks – where itis unnecessary – to leave the node- and link-visit rates unchanged.We achieve this smooth teleportation by scaling the transitionrates from nodes by the node-visit rates: Then unrecorded telepor-tation proportional to the nodes’ total out-link weights followedby recorded moves on the links proportional to their weightsdistributes on the nodes according to the ergodic visit rates onundirected networks . For the general case when the node weights can depend on the hyperedge, and the network may be directed, we use Eq. 10 without assuming 𝛾 𝑒 ( 𝑢 ) = 𝛾 ( 𝑢 ) as an approximationof the node-visit rates:˜ 𝜋 𝑢 = (cid:205) 𝑒 ∈ 𝐸 ( 𝑢 ) 𝜔 ( 𝑒 ) 𝛾 𝑒 ( 𝑢 ) (cid:205) 𝑣 ∈ 𝑉,𝑒 ∈ 𝐸 ( 𝑣 ) 𝜔 ( 𝑒 ) 𝛾 𝑒 ( 𝑣 ) (12)for nodes and˜ 𝜋 𝛼𝑢 = 𝜔 ( 𝛼 ) 𝛾 𝛼 ( 𝑢 ) (cid:205) 𝑣 ∈ 𝑉,𝑒 ∈ 𝐸 ( 𝑣 ) 𝜔 ( 𝑒 ) 𝛾 𝑒 ( 𝑣 ) for 𝛼 ∈ 𝐸 ( 𝑢 ) (13)for state nodes. With exact node-visit rates, we would obtainthe stationary flow volumes on links by multiplying the transitionrates by the source nodes’ visit rates. With approximate node-visitrates, instead, we obtain the link weights 𝑤 𝑢𝑒 = ˜ 𝜋 𝑢 𝑃 𝑢𝑒 (14)for bipartite networks, 𝑤 𝑢𝑣 = ˜ 𝜋 𝑢 𝑃 𝑢𝑣 (15)for unipartite networks, and 𝑤 𝛼𝛽𝑢𝑣 = ˜ 𝜋 𝛼𝑢 𝑃 𝛼𝛽𝑢𝑣 for 𝛽 ∈ 𝐸 ( 𝑢, 𝑣 ) (16)for multilayer networks. With unrecorded teleportation propor- tional to these link weights, modelling flows on hypergraphs givenode-visit rates robust to changes in the teleportation rate andindependent of the representation. Overlap metric . Modules overlap when Infomap assigns a node’sstate nodes in the multilayer network representations to differentmodules. Measuring the overlap through the absolute number ofassignments is misleading because the overlap is 2 regardless ofthe number of state nodes assigned to a different module than therest. Instead, we used the effective number of assignments. If afraction 𝑓 of node 𝑢 ’s state nodes is assigned to the 𝑚 th module in 𝑢 ’s module assignment set, the 𝑚 th element of 𝑢 ’s assignment vec-tor is 𝑎 𝑢𝑚 = 𝑓 and the effective number of assignments measuredby the perplexity of 𝑢 ’s module assignments is 𝑜 𝑢 = 𝐻 ( a 𝑢 ) . (17)The effective number of assignments is one if all 𝑢 ’s state nodes arein one module, and it is equal to the number of assignments whenthe state nodes are divided evenly among 𝑢 ’s module assignments. We averaged over all nodes for the partition overlap.
Data and code availability
All data and source code are available on GitHub: http://github.com/mapequation/mapping-hypergraphs . References
1. Brin, S. & Page, L. The anatomy of a large-scale hypertextual websearch engine.
Comput. Netw. , 107–117 (1998).2. Simonsen, I., Eriksen, K. A., Maslov, S. & Sneppen, K. Diffusionon complex networks: a way to probe their large-scale topologicalstructures. Physica A , 163–173 (2004).3. Rosvall, M. & Bergstrom, C. T. Maps of random walks on complexnetworks reveal community structure.
Proc. Natl. Acad. Sci. U.S.A. , 1118–1123 (2008).4. Delvenne, J., Yaliraki, S. & Barahona, M. Stability of graph communi-ties across time scales.
Proc. Natl. Acad. Sci. U.S.A , 12755–12760(2010). 5. Boccaletti, S., Latora, V., Moreno, Y., Chavez, M. & Hwang, D.-U. Complex networks: Structure and dynamics.
Phys. Rep. ,175–308 (2006).6. Fortunato, S. Community detection in graphs.
Phys. Rep. ,75–174 (2010).7. Lambiotte, R., Rosvall, M. & Scholtes, I. From networks to optimalhigher-order models of complex systems.
Nat. Phys. , 313–320(2019).8. Battiston, F. et al. Networks beyond pairwise interactions: structureand dynamics.
Phys. Rep. (2020).9. Mucha, P. J., Richardson, T., Macon, K., Porter, M. A. & Onnela, J.-P.Community structure in time-dependent, multiscale, and multiplexnetworks.
Science , 876–878 (2010).10. Kivelä, M. et al.
Multilayer networks.
J. Complex Netw. , 203–271(2014).11. De Domenico, M., Granell, C., Porter, M. A. & Arenas, A. Thephysics of spreading processes in multilayer networks. Nat. Phys. ,901–906 (2016).12. Rosvall, M., Esquivel, A. V., Lancichinetti, A., West, J. D. & Lam-biotte, R. Memory in network flows and its effects on spreadingdynamics and community detection. Nat. Commun. , 1–13 (2014).13. Scholtes, I. et al. Causality-driven slow-down and speed-up ofdiffusion in non-markovian temporal networks.
Nat. Commun. , 1–9(2014).14. Xu, J., Wickramarathne, T. L. & Chawla, N. V. Representing higher-order dependencies in networks. Science Adv. , e1600028 (2016).15. Parzanchevski, O. & Rosenthal, R. Simplicial complexes: spectrum,homology and random walks. Random Struct. Algorithms , 225–261 (2017).16. Salnikov, V., Cassese, D. & Lambiotte, R. Simplicial complexes andcomplex systems. Eur. J. Phys. , 014001 (2018).17. Iacopini, I., Petri, G., Barrat, A. & Latora, V. Simplicial models ofsocial contagion. Nat. Commun. , 1–9 (2019).18. Schaub, M. T., Benson, A. R., Horn, P., Lippner, G. & Jadbabaie, A.Random walks on simplicial complexes and the normalized hodge1-laplacian. SIAM Rev. Soc. Ind. Appl. Math , 353–391 (2020).19. Zhou, D., Huang, J. & Schölkopf, B. Learning with hypergraphs:Clustering, classification, and embedding. In Advances in neuralinformation processing systems , 1601–1608 (2007).20. Chitra, U. & Raphael, B. J. Random walks on hypergraphs withedge-dependent vertex weights. In , 2002–2011 (International MachineLearning Society (IMLS), 2019).21. Carletti, T., Battiston, F., Cencetti, G. & Fanelli, D. Random walkson hypergraphs.
Phys. Rev. E , 022308 (2020).22. Carletti, T., Fanelli, D. & Lambiotte, R. Random walks and commu-nity detection in hypergraphs. arXiv:2010.14355 (2020).23. De Domenico, M., Lancichinetti, A., Arenas, A. & Rosvall, M.Identifying modular flows on multilayer networks reveals highlyoverlapping organization in interconnected systems.
Phys. Rev. X ,011027 (2015).24. Jeub, L. G., Mahoney, M. W., Mucha, P. J., Porter, M. A. et al. A localperspective on community structure in multilayer networks.
Netw.Sci. , 144–163 (2017).25. Alon, N., Benjamini, I., Lubetzky, E. & Sodin, S. Non-backtrackingrandom walks mix faster. Commun. Contemp. Math. , 585–603(2007).26. Lambiotte, R. & Rosvall, M. Ranking and clustering of nodes innetworks with smart teleportation. Phys. Rev. E , 056107 (2012).27. Edler, D., Bohlin, L. et al. Mapping higher-order network flows inmemory and multilayer networks with infomap.
Algorithms , 112(2017).28. Kheirkhahzadeh, M., Lancichinetti, A. & Rosvall, M. Efficientcommunity detection of network flows for varying markov times and bipartite networks. Phys. Rev. E , 032309 (2016).29. Sepkoski, J. J. A factor analytic description of the Phanerozoicmarine fossil record. Paleobiology , 36–53 (1981).30. Rojas, A., Calatayud, J., Kowalewski, M., Neuman, M. & Rosvall, M.A multiscale view of the phanerozoic fossil record reveals the threemajor biotic transitions. preprint, Paleontology (2019).31. Muscente, A. D. et al. Quantifying ecological impacts of massextinctions with network analysis of fossil communities.
Proc. Natl.Acad. Sci. U.S.A. , 5217–5222 (2018).32. Peters, S. E. & McClennen, M. The Paleobiology Database applica-tion programming interface.
Paleobiology , 1–7 (2016).33. Rojas, A., Patarroyo, P., Mao, L., Bengtson, P. & Kowalewski, M.Global biogeography of Albian ammonoids: A network-based ap-proach. Geology , 659–662 (2017). Acknowledgments
We thank Christopher Blöcker, Manlio De Domenico, Michael Schaub,and Jelena Smiljanić for valuable comments that helped us improve themanuscript. A.E was supported by the Swedish Foundation for StrategicResearch, Grant No. SB16-0089. A.R., D.E. and M.R. were supportedby the Swedish Research Council, Grant No. 2016-00796.The computations was enabled by resources provided by the SwedishNational Infrastructure for Computing (SNIC) at High Performance Com-puting Center North (HPC2N), partially funded by the Swedish ResearchCouncil through grant agreement no. 2018-05973.
Author contributions
A.E. and M.R. conceived the study. A.E., A.R. and D.E. performed thenumerical experiments and analysed the results. A.E. and M.R. wrote themanuscript.
Competing interests
The authors declare no competing interests. A. Appendix
L J DubeG Petri H MarkramL-D LordE Ibanez-Marcelo A BarrotJ C Wright BillingsM GuerraV LatoraM San Miguel S BoccalettiD FanelliM Diakonova L V GambuzzaIvano LodatoS Assenza M Alberto JavaroneM Lucas U Alvarez-RodriguezG Bianconi R Pastor-SatorrasS FortunatoM U G KraemerL RossiA BaronchelliD CentolaJ F F MendesC CatuttoC Brandon OgbunuDajie Liu J IacovacciM Reitz Y MorenoA Arenas R LambiotteM A Porter H A HarringtonA F PachecoA Diaz-Guilera J P Gleeson K SneppenJia Gao C Gracia-LazaroJ-P OnnelaG Ferraz de ArrudaR M d'Souza A AletaC Payrato-Borras A MellorCan XuMatjaz PercJ Gomez-GardenesGyorgy SzaboStefano BoccalettiDirk HelbingAndreas AmannChen ShenDaniele Vilone Paolo Grigolini A S PikovskyJ KurthsC Bick C S ZhouJ Jost H-J FreundF A RodriguesJi Jia A KoseskaC KuehnC C GongK SigmundR M May C HauertH BrandtM E J NewmanM Boguna (a)(b)
L J DubeG PetriH Markram J C Wright BillingsM PercY MorenoA S PikovskyR Lambiotte K SigmundM San Miguel C BickD Fanelli J JostL Wang G BianconiV Loreto S V ScarpinoR Pastor-SatorrasS Fortunato L RossiJ F F MendesM E J NewmanM BogunaT P Peixoto
Fig. 7. Hierarchical maps of the collaboration hypergraph using (a) the bipartite representation and (b) the multilayer hyperedge-similarity representation.Module colours are the same as in Fig. 4(a). Aggregated inter-module links with sizes proportional to the exiting flow volume and length inversely propor-tional to the flow volume. White sub-modules are labelled with the top-ranked author. The largest blue top module in (a) contains ten sub-modules. In (b),the partition assigns those nodes to five top modules containing more sub-modules. S. Boccaletti, one of the most overlapping authors and highlightedin red, is assigned to one module in (a) and three top modules and six sub-modules in (b). La zy N on - l a zy Lazy Non-lazy
BipartiteUnipartiteMultilayerMultilayer h-sBipartiteUnipartiteMultilayerMultilayer h-s B i pa r t i t e U n i pa r t i t e M u l t il a y e r M u l t il a y e r h - s B i pa r t i t e U n i pa r t i t e M u l t il a y e r M u l t il a y e r h - s1.000.950.900.850.800.75