Multilayer Network Backboning

Today I want to tell a story about how sometimes science leads you to unexpected places. The main character of this story is the paper “Multilayer Network Backboning” (MNB to its friends), which I will present later this year at the CIKM conference. This was joint work with the excellent Valerio Siniscalco.

Network scientists know network backboning as the problem of identifying which edges in a weighted network are statistically significant, i.e. which ones we’re sure they actually exist. Network scientists also know other things — they’re a smart bunch — for instance that multilayer networks are networks where edges have different types. In this paper, these two worlds collide.

MNB, as a paper, didn’t really know what it wanted to do once it grew up. It was the child of another paper I wrote a while ago, about gender discrimination in the inclusion of women in Wikipedia biographies. Like all loving children, it looked at its parent with reverence, and thought it was going to go in the same line of business. See, the original paper’s entire argument relied on using network backboning to estimate the significance of edges: women had edges with greater significance than men, which suggested they were treated differently. When Valerio first proposed to write MNB, he pointed out that this was only done on the English language version of Wikipedia. Valerio wanted to see if the result also held when looking at multiple language versions.

The path for MNB, then, was clear: build the networks for a few other language versions (French, German, Italian, Spanish), redo the backboning analysis, and voila. “Voila” it was not, because as soon as you make a multilayer network you have to start asking yourself pesky questions. For instance: are we really really sure that person A linking to person B in the English edition bears no influence whatsoever on the likelihood of this A-B link existing in, say, the French edition? The entire multilayer network analysis business rests on the assumption that layers do influence each other one way or another, so we have to take such cross-pollination factors into account when estimating the likelihood of an edge truly existing. In short, we need a multilayer version of backboning.

“This is easy,” I told Valerio. “We just have to use one of the already-existing multilayer backboning methods. I’ll type in ‘Multilayer network backboning‘ on Google Scholar, pick the first random result that strikes my fancy* among the dozens available, and MNB can grow up and emulate its parent.” I did just that, and got zero hits. “Oh.”

See, maybe a normal person’s second thought after “Oh.” might be “Damn”. Not for a scientist. A scientist instead starts thanking the Gods of Science for their generous gift, and maybe does a little dance. “We know now what MNB will be. It’ll be the first backboning method that takes multilayer networks as input!” I said. “But the discrimination on Wikip…” Valerio tried to say. “The first backboning method that takes multilayer networks as input,” I kept repeating, in ecstasy, staring in the distance.

MNB, from that point onward, wrote itself. The starting point was the paper I published a while ago on single layer backboning, which established a null model based on how the two nodes linked by the edge we are testing connect in the rest of the network. One can apply it to multilayer networks as is, because one can represent them as multigraphs. But doing so results in an algorithm that considers layers independent and indistinguishable: you lose the information of which edge belongs to which layer.

MNB expands the original algorithm in two ways. First, we create a distinct null model per layer, which allows us to distinguish each layer. Then, we create an expectation estimate for each node pair to be connected which takes all layer information into account, allowing us to make the null models dependent on each other. This is based on the correlations between edge appearances in different layers, and our strategy is flexible enough to work also in the presence of anticorrelations. These happen when being connected in a layer makes the connection in another layer less likely — for instance if we have friendship and enmity layers.

The quality of the recovered backbone (y axis, higher is better) when making the test network progressively more noisy (left) or letting its layers have different levels of correlation with each other (right). The new proposed method is in green.

We can demonstrate that this works by creating synthetic networks where we control exactly which edges are signal and which are noise. The multilayer version of the backboning algorithm consistently outperforms single layer versions in recovering signal edges regardless of how much noise there is, how correlated the layers are, and other factors — as you can see from the figure above.

And the Wikipedia question? That turns out to have an interesting answer as well. In a world without MNB, we would apply the single layer backboning independently to each layer, as well as to a super-network pulling information from all languages. Doing so, funnily enough, results in a confusing puzzle: each language in isolation does not show any bias (and if anything, it is biased against men) while the aggregated version clearly shows an anti-woman bias. How could it be that the aggregated version shows the opposite of what its layers support?

The proportion (y axis) of male (blue) and female (red) profiles surviving a given backboning threshold (x axis), for the aggregated network (All) and each of its layers analyzed independently. The top row is the new multilayer method; the bottom row is a single layer version. Note how the lines flip between All and the other plots in the bottom row: from red on top to red on bottom. This does not happen in the top row.

By applying the multilayer version of the backboning, MNB in the end shows a consistent picture, where the bias is absent both in the aggregate and in each of the layers. As a result, the contradiction we got from single layer backboning disappears, although it is obviously not the final answer to the bias question — here we focus on the method, leaving in the background a number of choices that were instead the main focus of the previous paper.

So while the jury is still out about Wikipedia biases, one thing is for certain: extracting multilayer backbones is useful; it solves problems that would be difficult to handle with single layer backboning. In the end, MNB’s story has a happy ending: the paper has found its place in the world. If you want to play with the new multilayer backboning algorithm, you can find its implementation here. I’m looking forward to seeing its legacy: dozens of better multilayer network backboning algorithms in the future.


* Kids, don’t try this at home.

Comparing the Italian and Danish Music Industries

One of the blessings of being a digital humanist is being able to study something as inherently interesting as music. A while ago, I had fun trying to figure out which band was the most important in the Italian music scene. That was cool, but it left open a question, which I want to address today: are the patterns that I’m seeing specific to Italian music, or do they hold in another country?

To answer this question I needed to collect data about at least another country. Lisandro Marco Benetti and Daniel Fejerskov-Quist helped me compile a new dataset about Danish music. The result was the paper we co-authored: “Comparing the Italian and Danish Music Industries With Network Analysis,” which appeared in the journal Complexity earlier this month.

We applied the same methodology as in my previous paper to the bands releasing records in Denmark, to create a network that was directly comparable with the Italian one: bands connected to each other if they share a significant number of artists. Then, we could compare the two to figure out what stayed the same, what was different, and more.

Nodes are bands, connected by artist sharing. Node color is the average year of the band’s releases. Node size is centrality. Edge color is significance. Denmark on the left, Italy on the right.

The overall structure remained largely the same, with clear clustering by music genre and a temporal gradient, as you can see from the picture above. Sure, Denmark is smaller, has fewer bands, and a shorter time span, but overall the important structural properties of the networks are the same.

One new analysis we introduced in this paper is label nestedness. Record labels release music, so it is interesting to understand how specialized they are. When we sort labels by how much music they release, we see a nested pattern: small labels tend to focus on popular genres that are published by almost every label, while the many small specific genres are only published by the largest labels.

The dispersion of bands in the network (y axis) over time. The color background compares the observed value with what we’d expect given the number of records published. Green shows more dispersion than expected, red is less dispersion than expected (white matches expectation). Denmark on the left, Italy on the right.

Things start getting interesting when we look at the differences. For instance, by using network variance, we can quantify how much a year was innovative, by looking at how dispersed across the network the bands releasing records that year are (meaning the releases come from unrelated bands). We can control the amount of music produced, so that we know we’re not just looking at a lot of music, but specifically at a diverse body of music. The figure above shows that Denmark had its peak diversification during the 1980s and 1990s, while Italy was innovative earlier, in the 1970-1980 period.

Other differences include how the two music industries relate to different genres. Some genres show a low degree of specialization — meaning many unrelated bands have played them — in either Italy or Denmark, but not both. For instance, a diverse set of bands had tried to make beat music in Italy at its heyday, but not in Denmark. On the other hand, pop rock crops up across many unrelated Danish bands, not systematically, but this is not true in Italy. Various metal genres are also quite central in Denmark, but marginal in Italy.

The merged Danish-Italian music industry network. Nodes are still bands connected by artist sharing, with their size proportional to their centrality. Blue nodes for Italy, red nodes for Denmark.

The cool thing about this exercise is that, by using a consistent convention in making the dataset, the two networks can be merged. Artists who contributed to both Italian and Danish bands can create links across the countries. The global structure is what you see in the above figure. This significantly changes the centrality calculation. Rather than looking at the most important bands within a country, we are now looking at those bands that tie together two different countries.

Here are three examples:

  • Temperance: this Italian melodic power metal band is central because their records are produced by Jacob Hansen, a key figure in Danish rock / heavy metal;
  • Robertino: an Italian singer who was noticed at age 10 by Danish TV producer Volmer Sørensen, who launched his career;
  • Alex Puddu: an Italian funk artist born in Rome, but who relocated in Copenhagen at age 20*.

This has been fun, but, if you know me, you know that I don’t know when it’s time to quit. Of course the next step is to crank this up to eleven. Are the commonalities we see between Denmark and Italy just a coincidence? What if we add a third country? What if we add thirty? You’ll have to stay tuned, as I’m working on a paper to conclude this trilogy.


* To make the figure above, we used the country of origin to decide the node’s color. Alex Puddu was the one case we couldn’t quite figure out. So Lisandro and Daniel resolved to do the only logical thing, and just wrote Alex himself. He was very kind in answering, with details that would likely be appreciated by my friend Max Schich, as in the end even Alex couldn’t call himself either Italian or Danish. In the end, I flipped a coin 🙂

Is What Politicians Do Similar to What they Say?

Part of the Italian lore infused on me when growing up is to be disillusioned when it comes to interactions with politicians. Assuming that what a politician promises carries information about what they’re going to do is not the wisest way of living one’s life. This is a gut feeling and it could be completely wrong. It asks for verification and data: is it true that what politicians do in parliament is not similar to how they present themselves to the public?

The data to answer this question is what the excellent Christian Ivert Andersen provided, which eventually led to the publication of the paper “Disconnect between the Public Face and the Voting Behavior of Political Representatives,” which recently appeared in the journal Applied Network Science.

Christian had spotted some promising features about how elections are handled here in Denmark. Like in some other countries in the world, Denmark has a number of voting advice applications. These apps ask politicians for their position on a number of salient issues. This allows them to place the politicians somewhere into a political ideological space. The citizen can answer the same questions and figure out which politician is the closest to them — with the assumption they should vote for them, if they do not want to heed the Italian cautionary tales.

We decided to represent this data as a network: each node is a politician and each pair of politicians is connected if they agree on a significant number of issues. Altinget was kind enough to share their data with us for our work. We’ll get to the why we represent this data as a network, but for now let’s verify whether these networks make sense:

From A to D the networks corresponding to the 2011, 2015, 2019, and 2022 elections.

It seems they do! We clearly see the two blocks (red and blue) that are the ideological coalitions typical of the Danish political environment.

This data by itself is fascinating, but not enough to answer our question. It represents the “public face” of a politician: their explicitly stated position they use to campaign and attract votes. We need a data source for the actions they take once they are elected.

Luckily, Denmark publishes excruciatingly detailed reports of parliament actions in an open format. Unluckily, such an open format is a nightmare to work with, is highly fragmented, and I’m a bit concerned about Christian’s mental health after he had worked with it (get well soon, Christian!). With this data we can build a different network, this time connecting politicians according to their voting behavior similarity in parliament:

From A to D the networks corresponding to the 2011, 2015, 2019, and 2022 legislatures.

By analyzing the connections in these two networks we can create a numerical score which summarizes the ideology of a politician, depending on the politicians they’re connected to in the network — and who they are connected to and so on. I’ve been using such score as the node color in the network pictures in this post.

So: why networks? “Why not?” I would reply as a person whose obsession with networks has now reached pathological levels. But I know that’s not going to cut it. The reason we use networks is that they allow to calculate the distance between the two ideological scores we just built — one based on the politicians’ words, the other on their actions — in a more nuanced way.

Trivially, with two ideological scores, one would simply check their difference. However, the difference between ideological scores matters most for those politicians that are supposed to be ideologically close. It matters a lot if you’re shifting your position relative to the other members of your own party, more than if you do it relatively to parties that are not ideologically similar to you.

This nuanced distance estimation can be achieved by calculating the good old network distance measure I’ve been working with for the past few years. The only issue with it is that we just get a distance value and we need to contextualize it. To do so, we compare it with a null model: we calculate the same distance but we randomly shuffle the ideological scores on the networks. This way, we know what distance we should be seeing when there is no connection between the two ideological scores on the network.

In red, the number of null models (y axis) with a given words-to-actions distance (x axis). In green, the observed distance in the real data. From A to D corresponding to the 2011, 2015, 2019, and 2022 legislatures, above row for distances calculated on the networks based on campaign words, below for distances on the parliament action networks.

Above you see the distribution of expected distances in the null model in red, and the distance we observe as the green bar. Distressingly, the green bar is to the right of the expectation, and almost always significantly so. This means that the distance we observe — the actual difference between promises and actions — is larger than what we would expect in the scenario in which the two are randomly picked! To put it bluntly: how politicians present themselves during a campaign is significantly different from what they do in parliament once elected. Looks like my Italian guts were right.

But we shouldn’t put it bluntly, not yet at least. This study is just the first step and it does require substantial robustness checks. The most important of which is that the topics representatives in parliament vote on are not necessarily the same issues they’re asked about during the campaign. The most blatant case for this is that no one had asked anything about COVID during the 2019 campaign, but we all know what politicians had to deal with starting from early 2020. We should match the votes with specific questions and use only votes sufficiently similar to at least one question to build the parliament networks. We can do this, using some natural language processing magic, so that will come next.

From these very preliminary results, the most cautious lesson learned should be: maybe be wary of making your voting decisions based on a voting advice app. There are a number or reasons — not necessarily shady, as the COVID case exemplifies — that make them not exactly a faithful representation of what you’re voting for.

The Atlas for the Aspiring Network Scientist v2

After a year of dedicated effort, I’m glad to announce that the second version of my atlas for network science is finally out! Just like version one, the PDF is available free of charge both on arXiV and on the companion website, which also contains all the solutions to the exercises. If you’re a fan of physical books, you can buy it on Amazon.

Four years ago I published version one with the ambition of having a single text covering all I knew about network science in a coherent manner. The result was nice, but it had large margins of improvement. With this second edition, I aimed at improving the most egregious blind spots of the book.

The first one was about learning on graphs. Version one only had a small, confusing, imprecise chapter on this vast topic. That one chapter has blown up to four chapters, which now tackle shallow and deep learning more in depth. Of course none of those chapters get to the depth or sophistication of, say, Hamilton’s book, but I believe the value in having them in the Atlas is to show how much graph neural networks actually fit neatly into everything else from network science. They are not an extraneous body with esoteric methods: all GNNs do is adding some machine learning flavor to analyses we’ve been doing for decades, like using random walks to learn structural properties of the network.

Then, I decided to greatly expand on the background knowledge necessary to approach network science. This includes all the non-network techniques that will help you making sense of data. Again, what before was one background chapter became a whole book part with four chapters, covering probability theory, statistics, machine learning, and linear algebra.

The last major content addition is a chapter to deal with uncertain network data: what do you do when you’re unsure about the presence/absence of specific nodes/edges? There are more minor additions to the book, which are mentioned in the introduction.

Finally, last time no one yelled at me nearly enough for how tongue-in-cheek my introduction was. I took this as an encouragement to write an even more outlandish one. Fingers crossed someone will start a flame war on the social media du jour, and maybe the book goes viral and I get to retire with the $0.49 I make in profit per copy sold 🤞

Also bad news for those who want to stay healthy. All that added content means version two of the Atlas is even more back-breaking than version one:

The dinosaur is courtesy of my son.

For this book I had the additional help of a few more reviewers: Giovanni Puccetti, Matteo Magnani, Maria Astefanoaei, Daniele Cassese, and Paul Scherer. You’re very welcome to contact me if you find some more mistakes or if you have any grievances with the content — version one did ruffle some feathers.

So, if you want to become an expert on network science, a reminder: grab the free PDF on arXiV or on the website. And, if you really want to fuel my tiramisù addiction, you can always buy a physical copy on Amazon (or some other online seller). You could also go the Patreon route. I’ll see what I can cook in the next four years. Ta-ta.

Italian Music through the Lens of Complex Networks

Last year I was talking with a non-Italian, trying to convey to them how nearly the entirety of contemporary Italian music rests on the shoulders of Gianni Maroccolo — and the parts that don’t, should. In an attempt to find a way out of that conversation, they casually asked “wouldn’t it be cool to map out who collaborated with whom, to see whether it is true that Maroccolo is the Italian music Messiah?” That was very successful of them, because they triggered my network scientist brain: I stopped talking, and started thinking about a paper on mapping Italian music as a network and analyzing it.

Image credit: bresciaoggi.it

One year later, the paper is published: “Node attribute analysis for cultural data analytics: a case study on Italian XX–XXI century music,” which appeared earlier this month on the journal Applied Network Science.

I spent the best part of last year crawling the Wikipedia and Discogs pages of almost 2,500 Italian bands. I recorded, for each album they released, the lineup of the song players and producers. The result was a bipartite network, connecting artists to the bands they contributed to. I tried to have a broad temporal span, starting from the 1902 of Enrico Caruso — who can be considered the first Italian musician of note (hehe) releasing actual records — until a few of the 2024 records that were coming out as I was building the network — so the last couple of years’ coverage is spotty at best.

Image credit: wikipedia.org

Then I could make two projections of this network. In the first, I connected bands together if they shared a statistically significant number of players over the years. I used my noise corrected backboning here, to account for potential missing data and spurious links.

This is a fascinating structure. It is dominated by temporal proximity, as one would expect — it’s difficult to share players if the bands existed a century apart. This makes a neat left-to-right gradient timeline on the network, which can be exploited to find eras in Italian music production by using my node attribute distance measure:

The temporal dimension: nodes are bands, connected by significant sharing of artists. The node color is the average year of a released record from the band.

You can check the paper for the eras I found. By using network variance you can also figure out which years were the most dynamic, in terms of how structurally different the bands releasing music in those years were:

Network variance (y axis) over the years (x axis). High values in green show times of high dynamism, low values in red show times of structural concentration.

Here we discover that the most dynamic years in Italian music history were from the last half of the 1960s until the first half of the 1980s.

There is another force shaping this network: genre. The big three — pop, rock, electronic — create clear genre areas, with the smaller hip hop living at the intersection of them:

Just like with time, you can use the genre node attributes distances to find a genre clusters, through the lens of how they’re used in Italian music.

What about Maroccolo? To investigate his position, we need to look at the second projection of the artist-band bipartite network: the one where we connect artists because they play in the same bands. Unfortunately, it turns out that Maroccolo is not in the top ten most central nodes in this network. I checked the degree, closeness, and betweenness centralities. The only artist who was present in all three top ten rankings was Paolo Fresu, to whom I will hand over the crown of King of Italian Music.

Image credit: wikipedia.org

My Winter in Cultural Data Analytics

Cultural analytics means using data analysis techniques to understand culture — now or in the past. The aim is to include as many sources as possible: not just text, but also pictures, music, sculptures, performance arts, and everything that makes a culture. This winter I was fairly involved with the cultural analytics group CUDAN in Tallinn, and I wanted to share my experiences.

CUDAN organized the 2023 Cultural Data Analytics Conference, which took place in December 13th to 16th. The event was a fantastic showcase of the diversity and the thriving community that is doing work in the field. Differently than other posts I made about my conference experiences, you don’t have to take my word for its awesomeness, because all the talks were recorded and are available on YouTube. You can find them at the conference page I linked above.

My highlights of the conference were:

  • Alberto Acerbi & Joe Stubbersfield’s telephone game with an LLM. Humans have well-known biases when internalizing stories. In a telephone game, you ask humans to sum up stories, and they will preferably remember some things but not others — for instance, they’re more likely to remember parts of the story that conform to their gender biases. Does ChatGPT do the same? It turns out that it does! (Check out the paper)
  • Olena Mykhailenko’s report on evolving values and political orientations of rural Canadians. Besides being an awesome example of how qualitative analysis can and does fit in cultural analytics, it was also an occasion to be exposed to a worldview that is extremely distant from the one most of the people in the audience are used to. It was a universe-expanding experience at multiple levels!
  • Vejune Zemaityte et al.’s work on the Soviet newsreel production industry. I hardly need to add anything to that (how cool is it to work on Soviet newsreels? Maybe it’s my cinephile soul speaking), but the data itself is fascinating: extremely rich and spanning practically a century, with discernible eras and temporal patterns.
  • Mauro Martino’s AI art exhibit. Mauro is an old friend of mine, and he’s always doing super cool stuff. In this case, he created a movie with Stable Diffusion, recreating the feel of living in Milan without actually using any image from Milan. The movie is being shown in various airports around the world.
  • Chico Camargo & Isabel Sebire made a fantastic analysis of narrative tropes analyzing the network of concepts extracted from TV Tropes (warning: don’t click the link if you want to get anything done today).

But my absolute favorite can only be: Corinna Coupette et al.’s “All the world’s a (hyper)graph: A data drama”. The presentation is about a relational database on Shakespeare plays, connecting characters according to their co-appearances. The paper describing the database is… well. It is written in the form of a Shakespearean play, with the authors struggling with the reviewers. This is utterly brilliant, bravo! See it for yourself as I cannot make it justice here.

As for myself, I was presenting a work with Camilla Mazzucato on our network analysis of the Turkish Neolithic site of Çatalhöyük. We’re trying to figure out if the material culture we find in buildings — all the various jewels, tools, and other artifacts — tell us anything about the social and biological relationships between the people who lived in those buildings. We can do that because the people at Çatalhöyük used to bury their dead in the foundations of a new building (humans are weird). You can see the presentation here:

After the conference, I was kindly invited to hold a seminar at CUDAN. This was a much longer dive into the kind of things that interest me. Specifically, I focused on how to use my node attribute analysis techniques (node vector distances, Pearson correlations on networks, and more to come) to serve cultural data analytics. You can see the full two hour discussion here:

And that’s about it! Cultural analytics is fun and I look forward to be even more involved in it!

Predictability, Home Advantage, and Fairness in Team Sports

There was a nice paper published a while ago by the excellent Taha Yasseri showing that soccer is becoming more predictable over time: from the early 90s to now, models trying to guess who would win a game had grown in accuracy. I got curious and asked myself: does this hold only for soccer, or is it a general phenomenon across different team sports? The result of this question was the paper: “Which sport is becoming more predictable? A cross-discipline analysis of predictability in team sports,” which just appeared on EPJ Data Science.

My idea was that, as there is more and more money and professionalism in sport, those who are richer will become stronger over time, and dominate for a season, which will make them more rich, and therefore more dominant, and more rich, until you get Juventus, which came in first or second in almost 50% of the 119 soccer league seasons played in Italy.

My first step was to get data about 300,000 matches played across 49 leagues in nine disciplines (baseball, basket, cricket, football, handball, hockey, rugby, soccer, and volleyball). My second step was to blatantly steal the entire methodology from Taha’s paper because, hey, why innovate when you can just copy the best? (Besides, this way I could reproduce and confirm their finding, at least that’s the story I tell myself to fall asleep at night)

Predictability (y axis, higher means more predictable) over time (x axis) across all disciplines. No clear trend here!

The first answer I got was that Taha was right, but mostly only about soccer. Along with volleyball (and maybe baseball) it is one of the few disciplines that is getting more predictable over time. The rest of the disciplines are a mixed bag of non-significant results and actual decreases in predictability.

One factor that could influence these results is home advantage. Normally, the team playing home has slighter higher odds of winning. And, sometimes, not so slight. In the elite rugby tournament in France, home advantage is something like 80%. To give an idea, 2014 French champions Toulon only won 4 out of their 13 away games, and two of them were against the bottom two teams of the league that got relegated that season.

It’s all in the pilou pilou. Would you really go to Toulon and tell this guy you expect to win? Didn’t think so.

Well, this is something that actually changed almost universally across disciplines: home advantage has been shrinking across the board — from an average of 64% probability of home win in 2011 to 55% post-pandemic. The home advantage did shrink during Covid, but this trend started almost a decade before the pandemic. The little bugger did nothing to help — having matches played behind closed doors altered the dynamics of the games –, but it only sped up the trend, it didn’t create it.

What about my original hypothesis? Is it true that the rich-get-richer effect is behind predictability? This can be tested, because most American sports are managed under a socialist regime: players have unions, the worst performing teams in one season can pick the best rookies for the next, etc. In Europe, players don’t have unions and if you have enough money you can buy whomever you want.

Boxplot with the distributions of predictability for European sports (red) and American ones (green). The higher the box, the more predictable the results.

When I split leagues by the management system they follow, I can clearly see that indeed those under the European capitalistic system tend to be more predictable. So next time you’re talking with somebody preaching laissez-faire anarcho-capitalism tell them that, at least, under socialism you don’t get bored at the stadium by knowing in advance who’ll win.

Node Attribute Distances, Now Available on Multilayer Networks! (Until Supplies Last)

I’ve been a longtime fan of measuring distances between node attributes on networks: I’ve reviewed the methods to do it and even proposed new ones. One of the things bothering me was that no one had so far tried to extend these methods to multilayer networks — networks with more than one type of relationships. Well, it bothers me no more, because I just made the extension myself! It is the basis of my new paper: “Generalized Euclidean Measure to Estimate Distances on Multilayer Networks,” which has been published on the TKDD journal this month.

Image from https://atlas.cid.harvard.edu/

You might be wondering: what does it mean to “measure the distance between node attributes on networks”? Why is it useful? Let’s make a use case. The Product Space is a super handy network connecting products on the global trade network based on their similarity. You can have attributes saying how much of a product a country exported in a given year — in the image above you see what Egypt exported in 2018. This is super interesting, because the ability of a country to spread over all the products in the Product Space is a good predictor of their future growth. The question is: how can we tell how much the country moved in the last ten years? Can we say that country A moved more or less than country B? Yes, we can! Exactly by measuring the distance between the node attributes on the network!

The Product Space is but an example of many. One can estimate distances between node attributes when they tell you something about:

  • When and how much people were affected by a disease in a social network;
  • Which customers purchased how many products in a co-purchase network (à la Amazon);
  • Which country an airport belongs to in a flight network;
  • etc…
Image from https://manliodedomenico.com/

Let’s focus on that last example. In this scenario, each airport has an attribute per country: the attribute is equal to 1 if the airport is located in that country, and 0 otherwise. The network connects airports if there is at least a flight planned between them. In this way, you could calculate the network distance between two countries. But wait: it’s not a given that you can fly seamlessly between two countries even if they are connected by flights across airports. You could get from airport A to airport B using flight company X, but it’s not a given than X provides also a flight to airport C, which might be your desired final destination. You might need to switch to airline Y — the image above shows the routes of four different companies: they can be quite different! Switching between airlines might be far from trivial — as every annoyed traveler will confirm to you –, and it is essentially invisible to the measure.

It becomes visible if, instead of using the simple network I just described, you use a multilayer network. In a multilayer network, you can say that each airline is a layer of the network. The layer only contains the flight routes provided by that company. In this scenario, to go from airport A to airport C, you pay the additional cost of switching between layers X and Y. This cost can be embedded in my Generalized Euclidean measure, and I show how in the paper — I’ll spare you the linear algebra lingo.

Image from yours truly

One thing I’ll say — though — is that there are easy ways to embed such layer-switching costs in other measures, such as the Earth’s Mover Distance. However, these measures all consider edge weights as costs — e.g., how long does it take to fly from A to B. My measure, instead, sees edge weights as capacities — e.g. how many flights the airline has between A and B. This is not splitting hairs, it has practical repercussions: edge weights as costs are ambiguous in linear algebra, because they can be confused with the zeros in the adjacency matrices. The zeros encode absent edges, which are effectively infinite costs. Thus there is an ambiguity* in measures using this approach: as edges get cheaper and cheaper they look more and more like infinitely costly. No such ambiguity exists in my approach. The image above shows you how to translate between weights-as-costs and weights-as-capacities, and you can see how you can get in trouble in one direction but not in the other.

In the paper, I show one useful case study for this multilayer node distance measure. For instance, I am able to quantify how important the national flagship airline company is for the connectivity of its country. It’s usually extremely important for small countries like Belgium, Czechia, or Ireland, and less crucial for large ones like France, the UK, or Italy.

The code I developed to estimate node attribute distances on multilayer networks is freely available as a Python library — along with data and code necessary to replicate the results. So you have no more excuses now: go and calculate distances on your super complex super interesting networks!


* This is not completely unsolvable. I show in the paper how one could get around this. But I’d argue it’s still better not to have this problem at all 🙂

Pearson Correlations for Networks

We all know that correlation doesn’t imply causation:

And yet, we calculate correlations all the time. Because knowing when two things correlate is still pretty darn useful. Even if there is no causation link at all. For instance, it’d be great to know whether reading makes you love reading more. Part of the answer could start by correlating the number of books you read with the number of books you want to read.

The very important questions the Pearson correlation coefficient allows you to ask: will consuming cheese bring upon you the doom of dying by suffocating in your bedsheets? source: https://www.tylervigen.com/spurious-correlations

As a network scientist, you might think that you could calculate correlations of variables attached to the nodes of your network. Unfortunately, you cannot do this, because normal correlation measures assume that nodes do not influence each other — the measures are basically assuming the network doesn’t exist. Well, you couldn’t, until I decided to make a correlation coefficient that works on networks. I describe it in the paper “Pearson Correlations on Complex Networks,” which appeared in the Journal of Complex Networks earlier this week.

The formula you normally use to calculate the correlation between two variables is the Pearson correlation coefficient. What I realized is that this formula is the special case of a more general formula that can be applied to networks.

In Pearson, you compare two vectors, which are just two sequences of numbers. One could be the all the numbers of books that the people in our sample have read, and the other one is all of their ages. In the example, you might expect that older people had more time to read more books. To do so, you check each entry in the two vectors in order: every time you consider a new person, if their age is higher than the average person’s, then also the number of books they read should be higher.

If you are in a network, each entry of these vectors is the value of a node. In our book-reading case, you might have a social network: for each person you know who their friends are. Now you shouldn’t look at each person in isolation, because the numbers of books and the ages of people also correlate in different parts of the network — this is known as homophily. Some older people might be pressured into reading more books by their book-addicted older friends. Thus, leaving out the network might cause us to miss something: that a person’s age tells us not just about the number of books they have read, but it also allows us to predict the number of books their friends have read.

This is the type of networks you are forced to work with when you use the Pearson correlation. That’s just silly, isn’t it?

To put it simply, the classical Pearson correlation coefficient assumes that there is a very special network behind the data: a network in which each node is isolated and only connects to itself — see the image above. When we slightly modify the math behind its formula, it can take into account how close two nodes are in the network — for instance, by calculating their shortest path length.

You can interpret the results from this network correlation coefficient the same way you do with the Pearson one. The maximum value of +1 means that there is a perfect positive relation: for every extra year of age you read a certain amount of new books. The minimum of -1 means that there is a perfect negative relationship: a weird world where the oldest people have not read much. The midpoint of 0 means that the two variables have no relation at all.

Is the network correlation coefficient useful? Two answers. First: how dare you, asking me if the stuff I do has any practical application. The nerve of some people. Second: Yes! To begin with, in the paper I build a bunch of artificial cases in which I show how the Pearson coefficient would miss correlations that are actually present in a network. But you’re not here for synthetic data: you’re a data science connoisseur, you want the real deal, actual real world data. Above you can see a line chart, showing the vanilla Pearson (in blue) and the network-flavored (in red) correlations for a social network of book readers as they evolve over time.

The data comes from Anobii, a social network for bibliophiles. The plot is a correlation between number of books read and number of books in the wishlist of a user. These two variables are positively correlated: the more you have read, the more you want to read. However, the Pearson correlation coefficient greatly underestimates the true correlation, at 0.25, while the network correlation is beyond 0.6. This is because bookworms like each other and connect with each other, thus the number of books you have read also correlates with the wishlist size of your friends.

This other beauty of a plot, instead, shows the correlation between the age of a user and the number of tags they used to tag books. What is interesting here is that, for Pearson, there practically isn’t a correlation: the coefficient is almost zero and not statistically significant. Instead, when we consider the network, there is a strong and significant negative correlation at around -0.11. Older users are less inclined to tag the books they read — it’s just a fad kids do these days –, and they are even less inclined if their older friends do not tag either. If you were to hypothesize a link between age and tag activity and all you had was lousy Pearson, you’d miss this relationship. Luckily, you know good ol’ Michele.

If this makes you want to mess around with network correlations, you can do it because all the code I wrote for the paper is open and free to use. Don’t forget to like and subscrib… I mean, cite my paper if you are fed up with the Pearson correlation coefficient and you find it useful to estimate network correlations properly.

Networks in Economics Satellite @ Networks21 Conference

This year’s NetSci conference will be special. For the first time it will be held jointly with the other major network event of the year: Sunbelt, or the main network conference for social sciences. I could not miss an opportunity like this, and so I decided to organize a satellite event with the excellent Morgan Frank and Lingfei Wu. The topic of the satellite will be network applications on research about economic development and innovation.

We’re looking for contributors to send an abstract about their work in the area. If you’re unsure about what area that is, think about my research on the Product Space, or on the impact of business travel on economic growth, or economic convergence in Colombia, etc. Specifically, if you are interested in issues like:

  • Mapping the relationship of complex economic activities at the global, regional, and local level;
  • Tracking flows of knowhow in all its forms;
  • Estimating the relatedness of tasks and skills to estimate knockoff effects and productivity gains of automation;
  • Investigating the dynamics of research and innovation via analysis of patents, inventions, and science;
  • Uncovering scaling laws and other growth trends able to describe the systemic increase in complexity of activities due to agglomeration;

and you study them using networks and the tools of the science of complex systems, then you really should send us your abstract. The submission link is: https://easychair.org/my/conference?conf=cnei21. You should send a one-page one-figure abstract before May 5th, 2021.

We have a fantastic lineup of invited speakers you’ll mingle with:

The event will be held online on Zoom. The exact date is still to be determined, but it will be between June 21st and July 3rd. So stay tuned for updates! You should bookmark the official website of the satellite, to get fresh news about it: https://mrfrank8176.github.io/Complex-Networks-in-Economics-and-Innovation/

I hope to see your abstract in my inbox and then you presenting at the satellite!