Temporal clustering of social interactions trades-off disease spreading and knowledge diffusion

Non-pharmaceutical measures such as preventive quarantines, remote working, school and workplace closures, lockdowns, etc. have shown effectiveness from an epidemic control perspective; however, they have also significant negative consequences on social life and relationships, work routines and community engagement. In particular, complex ideas, work and school collaborations, innovative discoveries and resilient norms formation and maintenance, which often require face-to-face interactions of two or more parties to be developed and synergically coordinated, are particularly affected. In this study, we propose an alternative hybrid solution that balances the slowdown of epidemic diffusion with the preservation of face-to-face interactions, that we test simulating a disease and a knowledge spreading simultaneously on a network of contacts. Our approach involves a two-step partitioning of the population. First, we tune the level of node clustering, creating ‘social bubbles’ with increased contacts within each bubble and fewer outside, while maintaining the average number of contacts in each network. Second, we tune the level of temporal clustering by pairing, for a certain time interval, nodes from specific social bubbles. Our results demonstrate that a hybrid approach can achieve better trade-offs between epidemic control and complex knowledge diffusion. The versatility of our model enables tuning and refining clustering levels to optimally achieve the desired trade-off, based on the potentially changing characteristics of a disease or knowledge diffusion process.


I. INTRODUCTION
The recent experience with COVID-19 has made us all aware of epidemics, their possible appearance and their likelihood to overturn our lives all of a sudden.The COVID-19 pandemic, as of June 2023, has caused almost 800 million cases (among which 7 million deaths) around the world 1 .Many containment measures and nonpharmaceutical interventions (NPIs) have been put in place before vaccines became available: lockdowns, preventive quarantines, masks, physical distancing, school and workplace closures, remote working, etc. [1][2][3][4][5].All these measures have considerably impacted people's lives, social relationships, work, and economy [6][7][8][9][10].Indeed, if these measures can represent possible solutions to reduce disease spreading, the other side of the coin is that they imply a severe slowdown, or even interruption, of all the social exchanges and face-to-face interactions which prove fundamental for the proper functioning of a society and, specifically, for fruitful collaborative interactions.
Moreover, despite many collaborations, intimate relationships, and, more in general, information and knowledge sharing can nowadays easily travel through the Internet, the limits of only remote interactions have become clear [11][12][13].Several studies, indeed, have highlighted the importance of in-person interactions for physical, psychological and social wellbeing [14][15][16][17].In particular, observational, interview-based, and questionnaire-based studies have found that in workplaces face-to-face interactions are associated with increased trust and improved communication among employees, efficient problem solving and a positive effect on the overall organization knowledge diffusion, innovation ability, and performance [18][19][20][21].Similar results have been also found using wearable sensors to study face-toface interactions and their effect on productivity, performance and complex tasks' completion [22][23][24].For this reason it is crucial, along with the epidemic spreading reduction, to maintain as many physical interactions as possible.These two objectives are not easily pursued simultaneously.In this work, we will try to find a trade-off between them by working on the design of the network of social interactions, a useful exercise to find alternative solutions allowing us to cope with a fast-spreading disease.Tackling this problem within a coupled-dynamics framework can nourish new perspectives for the future management of epidemics and health emergencies.
Since the behaviour in time of a spreading process on a network is heavily conditioned by the network topology, several studies tried to regulate spreading by acting on the network structure [25][26][27][28].In this work, inspired by [29], we explore the "social bubbles" strategy, which implies partitioning the society into communities where each individual can physically interact at will inside the bubble but in a controlled amount (or not at all) outside.In this way, people can maintain a normal amount of face-to-face interactions but restrict them to a set of people who interact exclusively in the same group.For example, in a workplace this could imply restricting faceto-face interactions only among the members of the same team or department, while in a school and in a university campus only within a classroom or a dorm.This strategy has been proposed and largely discussed, and many numerical experiments have been performed to assess the effect of social bubbles on real populations [30] and in specific contexts like schools [31][32][33][34] and workplaces [35], always showing important advantages in reducing con- With "Si" representing agents susceptible to information "i", and "Ii" representing agents who acquired information "i".C) Schematically reproduce the main aspects of the two dynamics over a network of agents.Agents are represented with three concentric circles.The colour of the inner circle represents the epidemiological compartment the agent is in; the colour of the outer circles represents the progression of the information diffusion model from time "t" to time "t + 1".
tagions.In order to evaluate the effect of the community structure it is useful to consider synthetic networks where we can tune the modularity, i.e. the strength of division into modules or bubbles, and observe how this affects the spreading [36][37][38].In this work, we explore the effect of the social bubbles' reorganization of a network of proximity interactions.The specific goal of this study is to find an optimal topological network structure that minimizes the number of infected individuals (and in particular the number of simultaneously infected individuals) in order to avoid burdening hospital intensive care units (ICUs), and, at the same time, minimizing the social deterioration due to restrictions [39,40].For this reason, we consider two different and non-interacting spreading processes: one regarding a disease, and one regarding the diffusion of knowledge or of a social behaviour [41][42][43][44][45][46].The first one is represented by a simple contagion model, a SIR (Susceptible, Infected, or Recovered) compartmental model inspired by [47,48], while the second one is governed by a complex contagion approach, the threshold model with memory [49].The two processes take place simultaneously on an artificial population where individuals are connected via a temporal network, i.e. a set of pairwise links that appear and disappear in time.The way these links are distributed among nodes heavily affects the temporal evolution of the two spreading processes.The effect of social bubbles, which in networks is reflected by nodes clustering, is investigated for different sizes of the groups (e.g.different sizes of teams or departments in a workplace, different sizes of classrooms at school or university, etc.) and different levels of modularity (i.e. the strength of network partition, represented by the connectivity inside each bubble with respect to the admitted contacts between bubbles).Importantly, all these different networks have the same average num-ber of links, such that our analysis is not influenced by the number of connections (a parameter that clearly has a role in fastening all kinds of spreading processes).
We show that it is possible to find a trade-off between minimizing the timescale of the knowledge diffusion and the number of simultaneous infected individuals, two competing objectives.The effect of social bubbles (without preventive quarantines) is compared with the effect of quarantines (on a network that is not organized in bubbles).We will show that, even if the quarantines are more effective in containing the number of infected, they do not allow knowledge diffusion until most of the population is recovered.In contrast, with the bubbles strategy it is instead possible to share knowledge in the network since the beginning of the simulation, and simultaneously maintain the number of infected below a critical level (generally higher but comparable with the case of quarantines).The bubbles strategy, therefore, allows social processes to coexist with an epidemic.Additionally, in agreement with [37,38] we also find an optimal value of modularity for information diffusion, revealing a non-monotonic relation between knowledge diffusion and network structure.

II. RESULTS
Combining simple and complex contagion allows in general to find strategies that take into account both the epidemic threats and the socio-economical issues deriving from prolonged isolation periods, societal fragmentation, and, potentially, segregation.Several works exist studying the interplay between different spreading processes [45,46,50].These works however consider that the two processes mutually interact or one strongly affects the other one, while in our work they are considered two parallel processes (knowledge does not affect disease, and disease affects knowledge only indirectly, via isolations and quarantines).The focus of this work is indeed on the network structure and how this can be set so as to regulate different spreading processes taking place on it.We hence chose to consider a setting where the interaction between the two processes is minimal, thus avoiding to insert additional effects with the risk of not being able to understand from what they are generated, and hence to complicate the results' interpretation.
The disease starts from one random infected node at time 0. Simple contagion implies that nodes can only be infected if they have an infected neighbour and each contagion event is independent of the other ones.When a connection appears between an infected and a susceptible node, the probability that the susceptible node gets infected is set by ω(τ ), which depends on the age τ of the infected node's infection, i.e. the time since it has been in turn infected (see Methods for more details).Infected individuals can be identified and isolated, which means that all their connections are cut and they cannot spread disease or knowledge for a fixed interval of time.This happens with a probability per unit time ε I , one of the parameters of the model.Infected nodes, whether they are isolated or not, eventually become recovered, hence immune.This is the baseline model that we use to simulate the disease spreading and to investigate social bubbles, but we can also additionally consider the existence of quarantines: in this case, once a node is isolated, its last contacts are traced and preventively quarantined with a probability ε T , which means cutting the nodes' contacts for a short interval of time without knowing if it is actually infected or not.All infected nodes that are not isolated or quarantined are classified as active infected ones, being free to spread the disease (see Methods for a more detailed description of the disease spreading).In parallel, knowledge spreads across the network.We consider 20 different pieces of knowledge distributed in the network, they can be thought of as 20 different pieces of information or expertise spread among different teams or departments in a workplace.Initially, each piece of knowledge is possessed by only one random node and we assume that the other nodes need multiple exposures in order to acquire them.This is represented by a threshold model with memory [49]: each susceptible node becomes infected (i.e. it acquires a specific knowledge) only after K interactions with nodes possessing that particular knowledge.Nodes progressively store and accumulate the different pieces of information that they get in touch with and only when the threshold is reached for a particular knowledge it is considered as acquired.This is an SI model: we assume that knowledge cannot be unlearned.See Fig. 1C for a schematic representation of the two processes: infected nodes (dark blue) infect their neighbours and then become recovered (grey) or isolated (bright blue) and their neighbours can be quarantined (green).In the meanwhile, nodes which possess a particular knowledge pass pieces of it to their neighbours.The neighbours start to collect them and when they obtain the entire set of K pieces that knowledge is acquired.In Fig. 1 only two different spreading pieces of knowledge are represented, the purple and the pink one, while in the numerical experiments we consider 20 pieces of knowledge.We analyze several scenarios in which the two processes can interact and several networks of contacts.The temporal networks are generated building each layer with the Stochastic Block Model [51] where the number of nodes is fixed (N = 680) and the number of links is fixed on average (400 links).The number of nodes and connections are chosen so as to mimic the proximity interactions' dataset of the Copenhagen Network Study [52].The population is partitioned in several communities which are strongly connected inside (random temporal connections with a probability p intra ) and poorly connected between each other (random temporal connections with a probability p inter ).Since the number of links is fixed, the values of p intra and p inter are not independent of each other, and increasing p intra implies decreasing p inter and vice-versa.Thus, we rely on a parameter p = p intra /p inter which represnets the network modularity: namely, tuning the value of p allows us to generate more self-contained bubbles (higher p) or more interconnected groups less connected inside (lower p).By doing this, we can explore the effect of stronger or weaker bubbles as possible ways to reorganize a network without cutting or adding any link (see Methods for a detailed description of network generation).
In Fig. 2 we depict the evolution in time of both disease and knowledge spreading quantities: the number of active infected (dark blue) individuals, isolated (light blue) individuals, and quarantined (green) individuals, plus the number of simultaneous infected (orange) individuals corresponding to the sum of active infected, isolated and true positive quarantined individuals (i.e.those that are actually infected).The horizontal dashed orange line highlights the maximum number of simultaneous active infected individuals reached during the temporal evolution.Additionally, we plot in purple the evolution of the mean number of different knowledge obtained by the nodes (averaged on all the nodes).We report mean knowledge in the y-axis on the right, which spans from 0 to 20 since we are considering 20 pieces of knowledge spreading in the network (at time 0 each piece of knowledge is only possessed by one node so the mean is 1/N = 0.0015).We highlight three significant steps of knowledge spreading: the time when the average reaches the number of pieces of knowledge initially contained in one cluster, 20/n with n being the number of clusters (n = 10 in the example of Fig. 2); the time when it reaches 50% of total pieces of knowledge (10 in this case); the time when it reaches 80% of total knowledge (16 in this case).All the reported results are obtained as averages over 200 stochastic simulations.The first scenario that is depicted (Fig. 2A) corresponds to the case without quarantines (ε T = 0) and where the social bubbles' strategy is not at play (p = 5, meaning that intra-bubbles and inter-bubbles connections are of the same order of magnitude).The only NPI is represented by the isolation of individuals who are identified as infected.This is the worst case: we have a peaked curve of infected individuals and at the maximum peak more than half of the population is simultaneously infected.The average knowledge stays around 0 for the entire time span where people are infected and starts to grow only after the epidemic has been controlled.Then, we introduce the scenario that serves as a benchmark to compare the social bubbles' strategy: it is the one with quarantines (ε T = 0.1), still without the bubbles' organization of the network of interactions (p = 5).Quarantines clearly have an effect on infections number, managing to flatten the curves so as to reduce the number of simultaneously active infected individuals.However, this reduction comes at a great social cost, confining a significative fraction of healthy individuals.In the example reported in Fig. 2B, while the maximum average number of simultaneous infected is only the 27% of the population, the average percentage of population confined at least once without being infected (collateral confinement) is as high as 30.6% (see Supplementary Material Section S6 for collateral confinement in simulations with different parameters).Moreover, we observe that flattening the curve also implies extending the time span of the epidemics and this, in turn, badly affects the possibility of people having face-to-face interactions, thus slowing down knowledge diffusion.In fact, we observe that the purple curve starts to grow only when the other curves are very low.The time needed to acquire knowledge is hence longer than in the previous case.In other words, also in this case knowledge spreading via physical interactions can hardly coexist with an ongoing epidemic.In Fig. 2B we finally introduce the social bubbles' strategy.In this case, no quarantine strategy is put in place (i.e.ε T = 0) but the network is generated with p = 199, meaning that the intra-bubbles' interactions are, on average, 199 times more frequent than inter-bubbles' interactions.The number of infected individuals is higher with respect to the previous case: a simple organization of the network of interactions in bubbles is not able to reduce infections as quarantines, even if they are reduced with respect to the case without a bubble structure (Fig. 2A).However, we notice that in this case knowledge starts to spread inside bubbles already during the unfolding of the epidemic.So, even if complete knowledge spreading remains quite slow, pieces of information that circulate inside bubbles guarantee that part of the knowledge is acquired from the beginning (in the reported case, already at day 59).This important achievement still has to pay the price of (i) a high number of simultaneously active infected individuals, and (ii) a still long time before all the pieces of knowledge are able to reach all the nodes.Hence, we consider an additional containment strategy: we add to the node clustering of nodes, represented by the social bubbles, a temporal clustering, thus obtaining temporal social bubbles.We leverage again the value of p setting the ratio of intra-bubbles' and inter-bubbles' connections but, in this strategy, the inter-bubbles' connections, instead of involving nodes of random different bubbles, are now concentrated only between specific couples of bubbles (as in the toy example depicted in Fig. 2D).So, each bubble (e.g. a team or department within an organization) only interacts with another bubble (e.g. a different team or department) at a specific time.Then, with a time periodicity d the couples change in such a way that, at the end of the simulation, each bubble has interacted with each other bubble.The result is that knowledge starts to grow from the early stages of the simulations inside each couple of bubbles and each node of one bubble easily acquires the ideas of its matched bubble, doubling the nodes' average knowledge.In a similar manner, once matches are updated, nodes are able to acquire knowledge from another bubble, and gradually augment their knowledge following a staggered growth.In Fig. 2D, this dynamic is clearly visible: the purple line shows the process of knowledge acquisition, which grows more rapidly in correspondence with the update of bubble matches (every d = 10 days in the reported simulations), and slows down once most of the matched bubble nodes have acquired the new piece of knowledge.For what concerns the disease spreading, leveraging the peculiar structure of node interactions, it naturally remains confined between a limited number of bubbles and, as a consequence, the number of infected individuals grows more slowly.Moreover, the number of simultaneously active infected does not reach a high value since a fraction of the infected nodes can recover within the time that matches between bubbles are changed.By observing the curves in Fig. 2D we notice that the disease curve and the knowledge one are partially overlapping, indicating that, in this framework, the epidemic can coexist with the diffusion of knowledge by social face-to-face interactions.In Fig. 3 we report, for different strategies and different parameters' settings, four significant quantities characterizing disease and knowledge spreading: (i) the maximum number of simultaneously active infected individuals (orange horizontal dashed lines in Fig. 2), (ii) the time at which the average knowledge acquired by nodes becomes equivalent to the number of different pieces of knowledge initially present in one cluster, (iii) the time at which it reaches 50% of the total knowledge, and (iv) the time at which it reaches 80% of the total knowledge (the three purple vertical lines in Fig. 2).For the quarantine strategy, these indicators are reported versus ε T and while, clearly, infected individuals decrease with ε T , the knowledge times it is only marginally affected by it.For the bubbles' strategy, the indicators are instead depicted as functions of p, where increasing p means making the bubbles more self-contained.In particular, we consider the case with temporal clustering for three different values of d (i.e. 5, 10, and 20 days), and without temporal clustering.In all cases, we notice that the number of infected individuals decreases with p, not drastically as for ε T , but significantly.This is due to the fact that closer bubbles tend to maintain the disease confined to a few bubbles, while the other nodes remain safe.The lowest numbers of infected individuals are obtained with temporal clustering of 20 days, in fact with longer temporal clustering there is more chance that infected individuals inside a bubble recover or are quarantined before they have the possibility to meet new susceptible nodes.For what concerns knowledge times, instead, we notice a peculiar behaviour with respect to the modularity, showing in all cases a minimum value in p, corresponding to an optimal value which varies according to different conditions.We also notice that in order to shorten times to reach partial knowledge, longer temporal clustering are to be preferred (see dark purple curves), while to shorten total knowledge times we need to decrease the length of the tournament d (see light purple curves).

III. DISCUSSION
In this work, we have investigated the social bubbles' framework as a potential strategy for controlling disease spreading and simultaneously allowing higher levels of face-to-face interactions, which in turn facilitate the process of knowledge diffusion.More specifically, we have considered different settings of the social interactions' network organization in bubbles with the aim of finding an alternative strategy to preventive quarantines.
From the point of view of reducing the number of infected individuals, the quarantine strategy is the most effective one.However, arguably, quarantines impede social contacts and, as a consequence, all the diffusion processes that do not rely on simple contagion models but require multiple contacts to spread, as is the case for the considered knowledge-spreading process.The bubbles' strategy instead permits face-to-face interactions between people, albeit limited to smaller groups than to an entire organization, school, university campus, workplace, etc.These free physical interactions allow complex dynamics (like complex contagions) to emerge, as it is demonstrated by the progress of knowledge spreading, here represented by the threshold process.We notice in fact that, despite the acquirement of the entire knowledge set is still reached after a long time, the singular ideas are free to circulate since the beginning inside the bubbles and are then easily acquired by the nodes (see Fig. 2C).Other strategies to flatten the infection curve by making use of social bubbles consist in cutting inter-bubble links instead of rewiring them [29].However, the reduction of connections incontestably induces a slowdown of the epidemic spreading, which is not entirely due to the organization in bubbles.In our work, we show instead that the bubbles strategy is effective even if the number of links is maintained constant.In particular, we use networks with different levels of modularity, quantified by different values of p, but we generate the networks always with the same average number of links.
One of the most salient results of this work is that the existence of communities in a network facilitates knowledge diffusion (i.e.complex contagion), limiting collateral confinement, while it mitigates disease diffusion (i.e.simple contagion).An analogous conclusion about knowledge diffusion, implemented as a linear threshold model, has been obtained by Nematzadeh et al. [37] (and by Peng et al. [38] in a follow-up of the first work).They observe that strong communities enhance local spreading, while weak communities enhance global spreading, and they find an optimal range of intermediate values for community strength (analogous to our p) that maximize diffusion and the speed of cascades.This result agrees with our results on knowledge spreading; in fact, with our analyses we also observe the existence of an optimal value of p corresponding to the shortest times of knowledge diffusion (see Fig. 3).The minimum in p tells us that the best performances of the bubbles' strategy are not monotonic with p, on the contrary, very high or very low values of p slow down the knowledge diffusion.In fact, trivially, if p is too small we lose the effect of population partition and what we observe is a mixed population without bubbles and without quarantines, so a very inefficient network structure.If, instead, we increase p, i.e. we make the bubbles progressively more self-contained, we interestingly observe progressively longer knowledge spreading times, suggesting that a certain level of promiscuity between bubbles is instead advisable.It is important to notice that the existence of quarantines and isolations does not affect the ratio p between the amount of intra-and inter-bubble connections.In Supplementary Material, Fig. S9, we show indeed that, while the number of overall connections in the network is significantly reduced during the central phase of the disease epidemic, both within and between clusters, the ratio p intra /p inter remains stable around the value p set to generate the networks.This confirms the validity of the parameter p to discern the different networks and the resulting processes.The greatest advantage is however obtained with the insertion of bubbles' temporal clustering.In fact in that case we have a combined effect: the existence of bubbles allows to keep the epidemics under control, and the temporal clustering enforce the nodes to be exposed to periodically different ideas.The result is a faster acquisition of knowledge while the disease is kept under control.This strategy reveals impressively effective and, up to our knowledge, it is a completely novel idea.All these results are confirmed by considering different sizes of bubbles (with the same number of nodes and the same average number of links), in particular 5 bubbles of 136 individuals and 20 bubbles of 34 individuals, as reported in Section S2 of the Supplementary Material.
Our work comes with some limitations that could be addressed by further exploring this research direction in the future.First of all, we are only considering synthetic networks, which are generated with random interactions without temporal correlations, clustering, or other structural information that would make them more similar to real networks of interactions.The reason for this choice stemmed from the need to investigate the effect of social bubbles, disentangled from other possible structural constraints that could affect the dynamics.The choice of random networks ensures that the only structure existing in the considered graphs is the modularity, which we introduce and control by setting the parameter p when generating the networks.This allows us to directly scrutinize the phenomenon and draw untwisted conclusions.Envisaging possible applications to real networks will be matter of future investigations.Moreover, the effect of network density is not explored, but we test different network sizes (increasing or decreasing the number of nodes and changing consequently the number of links so as to keep density fixed) and different bubble sizes and we observe that the results essentially do not change (see Section S3 of the Supplementary Material).Finally, only some of the simple and complex spreading parameters are explored, which implies that the results about optimal p are not general, they only apply in this specific context.However, the interesting result is that a minimum exists, even if its exact value will probably change by changing the parameters.In conclusion, we realize that the temporal social bubbles strategy represents a valid alternative to other NPIs like preventive quarantines when looking for a solution permitting to coexist with a spreading disease.This strategy, while still affecting the social structure of interactions, allows the pursuit of a series of otherwise hardly attainable collective goals that prove fundamental to the growth and social enrichment of society and individuals, from collaborations to social relationships, from knowledge transfer to opinion exchange.These results could spur innovative approaches to epidemic control strategies, for example, based on different interaction-mixing prescriptions in different settings, such as home, work and leisure places.While a systematic assessment of mixed strategy approaches is needed to better inform policymakers, our results provide a solid proof of concept for social bubble strategies, proving its efficacy under the prescription of temporal clustering, evidencing how the choice of a strategy solely focused on flattening the curve can dramatically affect knowledge diffusion and social cohesion.

A. Disease spreading
The disease-spreading model is inspired by previous literature on COVID-19 models [53][54][55].Each numerical simulation starts with one random infected individual, who has been infected for a number of days, τ , randomly sampled between 0 and 10.The variable τ is important in the spreading process since we assume that infectiousness, i.e. the probability of transmitting the disease, of an infected individual depends on the time since their own contagion, with a function ω(τ ) which has a maximum peak at around 5 days (see Fig. S1  FIG. 3. Scenario with 10 bubbles (i.e.ten different teams or departments in an organization).Orange stars represent the maximum number of infected individuals, the other symbols represent the time at which the nodes reach on average 10%, 50%, and 80% of knowledge.The first percentage corresponds to acquiring the entire knowledge initially contained in one bubble from all the nodes.We report results for εI = 0.1 (continuous lines), εI = 0.25 (dashed lines), εI = 0.4 (dotted lines).The quarantine results are reported vs. εT , the bubbles results vs. p and for different levels of temporal clustering.
the Supplementary Material).Such probability governs which individuals, among those that the infected seed meets according to the temporal network, will contract the disease.These can in turn infect their contacts.We assume that every infected individual becomes recovered, hence immune 2 , after 25 days [56].We assume that 80% of infected individuals become symptomatic after being infected, with a symptom onset probability which increases in time according to a function s(τ ) [55] (see Fig. S1 in the Supplementary Material).As soon as they show symptoms they have a probability ε I of being isolated.If this does not happen they go on spreading, otherwise their contacts are cut for the next 30 days, at the end of which they will become recovered.When an individual is isolated, their past contacts (last 7 days) are traced and preventively quarantined with a probability ε T .The quarantined individuals can be infected (true positive) or susceptible (false positive).In the first case, if they show symptoms during quarantine, they will 2 If we extend the time span of the simulations we should consider the fact that immunity only exists for a finite period of time, however, since we are considering only around 4 months, considering that recovered people remain immune until the end of the simulations is a good approximation of reality.
become isolated (the only difference with quarantine is that their past contacts are traced and, in the end, they will be recovered), otherwise, they finish the quarantine after 10 days and they are released.

B. Network generation
We generate a synthetic temporal network with N nodes organized in N c clusters, characterized by a strength of network modularity p = p intra /p inter , and a total number of links L. We hence generate a series of static networks which are going to constitute the layers of the temporal network.In each layer, nodes are classified into clusters (the first n 1 nodes in the first cluster, the second n 2 nodes in the second cluster, and so on, with n i the a priori chosen number of nodes in cluster i, the same for each static network).All the temporal layers are characterized by the same values of intra-cluster connections probability p intra and of inter-cluster connections probability p inter .
The static networks are generated using the Stochastic Block Model [51], once all the parameters (N c , n i , p intra , p inter ) have been fixed.
Since p intra and p inter are not independent of each other but are constrained by the value of L, we need first to find the function that associates these three variables.We consider the general case where clusters do not contain the same number of nodes, but each cluster i contains a number n i of nodes.This means that, statistically, in cluster i we can find a number of internal links given by: and summing over all clusters we obtain: For what concerns the inter-cluster links, instead, we should consider that each node in cluster i can be connected to a number of external nodes (N − n i )p inter .This is true for every node in the cluster, so it should be multiplied by n i to find the number of connections of cluster i that point to other clusters: To obtain the total number of inter-cluster links we just have to sum over all the clusters and divide by 2, to avoid double counting: The total number of links can therefore be written as: (5) This equation represents the constraint between L, p intra , and p inter .In our case we consider all the clusters with the same number of nodes: n i = N/N c ≡ n c ∀i, hence it reduces to The networks that we generate for this manuscript have a fixed number of links, L = 400.By varying the chosen value for p intra we can obtain different choices of p inter (and hence of p), always maintaining constant the number of links L, by inverting equation 6: V. CODE AVAILABILITY The code used for the generation of temporal network, simulations and analysis is available at: https: //github.com/giuliacencetti/Social_bubblesFor the sake of completeness, we report results obtained for different numbers of nodes with respect to the 680 nodes of the Main Text, in particular a reduction of 25%, corresponding to 510 nodes, and an increase of 25%, corresponding to 850 nodes.The number of links is changed accordingly so as to keep density fixed (225 links on average for the networks of 510 nodes, 400 links for 680 nodes, 625 links for 850 nodes).Results are depicted in Figs.S6 and S7 respectively.Comparing them with Fig. 3 we notice that changing the size of the network does not change the conclusions obtained in the Main Text.

S5. STABILITY IN TIME OF EFFECTIVE p
The parameter p proves fundamental to explain the results shown in the Main Text.This parameter is set to generate the layers of the temporal networks and establishes the ratio between the probability of the existence of links within clusters and the probability of the existence of links between clusters, p = p intra /p inter .However, the process involves isolations and quarantines of nodes, which implies that all the links of the corresponding nodes are cut in the temporal layers corresponding to their isolation/quarantine period.This causes a general reduction of connections in the network during the epidemic phase, as shown in the lower panels of Fig. S9.One could therefore wonder if the ratio between intra and inter-cluster links is preserved or altered by these modifications, where this last possibility would question the reliability of parameter p in characterizing the processes under study.We hence computed the number of connections inside and outside bubbles in the effective networks, i.e. those without the links of isolated and quarantined nodes, obtaining an effective value of the ratio p.This is reported in the upper panels of Fig. S9 for the four different cases (A, B, C, D) represented in Fig. 2 of the main text.The effective p fluctuates around the value that has been set to generate the networks (represented by the horizontal line) without any significant change in time, in contrast to the number of total links which shows a dramatical change.This means that, while both intra and inter-cluster links are reduced for an interval of time, their ratio remains constant, thus confirming the reliability of p in identifying networks and discerning the resulting processes.In terms of impact on individuals' lives, quarantines (i.e.preemptive confinement strategy) are probably one of the policies with the highest social costs for individuals.Jointly with high-quality tracing and testing policies, it can significantly reduce infective disease spread.In this work, we use this strategy as a reference for comparison with the social bubble framework, whose social costs are arguably lower.In the main manuscript, we compare quarantines and social bubbles with temporal clustering to understand which strategy has a smaller effect in slowing down the knowledge diffusion process.As a reference, since a direct comparison with the temporal clustering bubbles is not possible, we report, for different simulation configurations, the percentage of the population which was confined without being infected as an additional measure of the collateral costs.

FIG. 1 .
FIG. 1. Schematic representation of the combined model dynamics.A)The epidemic spread is modelled through a modified SIR compartmental model framework."S" are individuals susceptible to the infection, "Q" are quarantined individuals, "I" are infected individuals, "Is" are isolated individuals, and "R" are recovered individuals.B) The information dynamics follows a standard multistrain SI compartmental model.With "Si" representing agents susceptible to information "i", and "Ii" representing agents who acquired information "i".C) Schematically reproduce the main aspects of the two dynamics over a network of agents.Agents are represented with three concentric circles.The colour of the inner circle represents the epidemiological compartment the agent is in; the colour of the outer circles represents the progression of the information diffusion model from time "t" to time "t + 1".
FIG. S8.Time to reach 50% knowledge and number of maximum infected for simulations with 680 nodes, 10 clusters, for εI =0.5.These results are also reported in Fig. 3, here are shown as knowledge time vs. infected.In the panel with quarantines, different symbols correspond to different values of εT , in the other panels different colours correspond to different values of modularity p, while εT = 0.
FIG.S9.The effective value of p is computed on the networks where links of isolated nodes have been cut and are reported in grey in the upper panels (each dot corresponds to one layer of the temporal network).The horizontal line reports the value of p set to generate the networks.The lower panels report the number of total connections in the same networks, while the horizontal line shows the number of connections statistically assigned when networks are generated.We observe a drastic reduction of links during the epidemic phase, not mirrored by any change in the effective p which remains stable.The networks used for these figures are the same used for the simulations in the main text, with 10 bubbles of 68 nodes, εI = 0.25, εT = 0 and three values of p: 5, 100, and 200.

TABLE S1 .
Percentage of non-infected quarantined population.For each configuration of the testing (ϵI ) and quarantine (ϵT ) parameters, we report the fraction of the population that was quarantined at least once without being infected.