Abstract
We present a model for network transformation mediated by confinement, as a demonstration of a simple network dynamics that has a direct connection with real world quantities. The model has the capacity of generating complex structures similar to real world networks by the use of two parameters. Starting from an ErdösRényi network, nodes are randomly selected to be temporarily confined. Confined nodes form new links among themselves at the same pace they lose connections with the outside nodes. As the network evolves according to the parameters of the model, a series of non trivial network characteristics emerge: the formation of stable heterogeneous degree distributions similar to those of empirical networks, an increasing clustering coefficient, and the emergence of communities outside the confined space. Different from the traditional benchmarks used to create modular networks, there is no arbitrary definition of the number of modules, nor node metadata defining it as a member of a particular community, nor a tunable parameter directly related with expected modularity. Modules emerge as a result of the dynamics while nodes move among them as connections are rewired. The proposed algorithm has the potential to simulate community dynamics cases in situations where time stamped network data is scarce or absent.
Introduction
In several fields, there are networks exhibiting complex ordering and heterogeneity features that are not present in strictly random networks. Among these complex features, we can name some of special interest: clustering (Watts and Strogatz 1998), different forms of network centrality (Freeman et al. 1991; Freeman 1977), heterogeneity of degree distribution, and network path length. The presence of such distinct features in realworld systems suggests an underlying ordering, coming from nonlinear interactions between network elements, which can only be explained by taking such interactions into account.
In network science, two topics are of great interest nowadays: dynamic networks and structural communities. Complex network data is generally collected as static snapshots, while actual complex systems are naturally dynamic. They may grow or shrink as nodes and connections are created, destroyed, or redirected. Structural communities are based on the general idea that a group of nodes in the network are strongly connected, while they are weakly connected to the rest of the network. This subject is in fact more complex since it includes the possibility of nested, intersected, or multilevel communities (Palla et al. 2005). Communities in networks is also a very active subject (Fortunato 2010), with contributions steadily coming on characterization of communities in real world networks, faster algorithms for detecting such structures in large networks (Yang et al. 2016), and the development of benchmarks (Condon and Karp 2001) for testing those models. The two topics come together in the present contribution, where we study community structures mediated by confinement in dynamic networks.
Several processes in the dynamics of complex networks are mediated by the temporary confinement of agents. Considering imprisonment for instance, while there is some controversy whether high levels of imprisonment actually decrease crime rates, it is common practice worldwide. The idea is, precisely, to keep the criminal in quarantine away from society, either as retribution, or for incapacitation, deterrence, or rehabilitation (Pratt and Cullen 2005). Penal methods vary widely depending on the legal system —from the Pennsylvanian solitary incarceration system, to the day worknight confinement Auburn model, going through the progressive stages, or marking system, where conditions and level of incarceration improve as a result of good behavior, time lapse, or other “marks” (Kerley 2017). Regarding human dynamics, what usually happens in real world prisons is that when someone is sent to jail, a fraction of their relationships are lost due to incarceration, while the closest relationships (family, partner) are weakened but kept. On the other hand, the inmate is likely to make new contacts while serving time in prison, and some of these new relationships may remain after the person is released, possibly resulting in recidivism (Brame et al. 2018).
Nevertheless, confined spaces are not restricted to prisons; they can be a neighborhood, where residents are prone to meet, an online group of people connected by a common interest, a school or university where students enter and leave the institution every year, due to enrollments, transferring, and graduation. In such examples, while the structure of the community remains approximately the same, the individuals who form these structures change over time. Two mechanisms can be identified then: the favorable conditions for forming new connections in a subset of a bigger social network, and the flow of agents inside and outside that subgroup; mechanisms that we call “confinement dynamics". Spaces do not have to be defined by physical boundaries, they may be real or virtual spaces where agents tend to connect more easily among themselves than with agents outside of confined space, while remaining there for a finite period of time.
We propose a simple model for capturing and studying the essential aspect of the processes discussed above, based in two parameters with clear meaning: the relative size of the confined space and the rate of exchange in and out of the confinement. In order to study the confinement dynamics we propose a computational model consisting of a graph which represents a network and where the confined space is a subgraph of nodes labeled as confined. There is flux of nodes in and out of the confinement and the connections are rearranged in order to reflect the tendency of the confined subgraph to increase internal connections while losing external connections. We show that the dynamics based on the proposed model provides a simple explanation for the appearance of complex structures observed in social networks, such as high clustering, heterogeneous degree distribution, and hubs. In addition, the results show the emergence of highly connected subgraphs that fit modern definitions of structural communities.
In “Introduction” section we present the methodology, including the description of the numerical simulations. “Methodology” section contains the results on the networks’s dynamics and a discussion about the emergence of communities and other relevant measures. “Results” section is devoted to conclusions.
Methodology
The confinement mediated dynamic network model
The model is characterized by an initial network \(\mathcal {N}\) (not necessarily fully connected), where each node is in one of two states: confined or free. Links are unweighted and undirected, without self connections. The initial network is transformed by changing the states of nodes and rewiring of connections, which occurs at every time step, until a steady topological state is eventually reached. The detailed algorithm works as follows:

We start with a random network \(\mathcal {N}(\langle k \rangle)\), with N nodes and an average degree 〈k〉, built by the ErdösRényi (ER) algorithm \(\mathcal {N}(p,N)\) (Erdös and Rényi 1959).

A subset of N_{c} nodes is randomly selected and temporarily labeled as confined; we refer to this subset and its links as a confined space or simply a confinement, and we call it \(\mathcal {P}\). During the dynamics, nodes enter and leave the confinement while keeping N_{c} constant. We define the relative confinement size, p_{s}, as the ratio between N_{c} and the network size N:
$$ p_{s} = \frac{N_{c}}{N}\;, $$(1)which is one of the model’s key parameters.

The algorithm proceeds in discrete time steps, each one composed of two phases: a) the flux phase and b) the rewiring phase. At the flux phase, N_{f} nodes outside confinement are randomly selected and turned into confined, while N_{f} confined nodes are randomly selected and set free. Notice that at this phase the topology of the network does not change, only the labels of the nodes. Then, the flux of nodes is governed by a second key parameter, the flux ratio p_{f}:
$$ p_{f}=\frac{N_{f}}{N}\;. $$(2) 
Therefore, all the links in the network are of one of three types (ℓ_{in}, ℓ_{out}, ℓ_{io}) identified as follows: ℓ_{in} is the number of links among confined nodes or internal links, ℓ_{out} is the number of connections between free (external) nodes, and ℓ_{io} denotes the number of links between free and confined nodes. These three quantities vary with time but the total number of edges, ℓ, is conserved:
$$ \ell = \ell_{in}(t) + \ell_{out}(t) + \ell_{io}(t). $$(3) 
The topology changes at the rewiring phase: each one of the N_{c} randomly selects one of its connections to a free node, redirecting it to a confined one, selected randomly as well. This represents the tendency of the confined nodes to alienate from the nonconfined, or “outside”, part of the network, while they increase their links among themselves. Denoting a confined node as \(n_{j}^{c}\), it will have one of its links changed if it has at least one link outside the confinement and if there is a confined node not yet connected to it (multiple links between nodes are not allowed). If both conditions are fulfilled, one of the links to the outside is selected, cut, and replaced by a link to a confined node selected at random among all the possible candidates.
There are two binding conditions between the parameters p_{s} and p_{f}. The influx/outflux can not exceed the size of the confined space, so \(N_{c} \geqslant N_{f}\), i.e.:
On the other hand, N_{f}≤N−N_{c} must be satisfied, for the number of influx nodes (N_{f}) has to be less than the number of available free nodes, that is
however, as in any realistic scenario, N_{c}≪N, from condition Eq. 4, condition Eq. 5 is always satisfied.
As the dynamics progress, the topological characteristics of the network transform, except the number of nodes and edges, until a steady state is eventually reached. At this stage, the roles of individual nodes and edges are in continuous transformation, but the general form of the network remains stable. Hereafter, we use this model to demonstrate the complex behavior that emerges from the described confinement dynamics, as well as the influence of the size and the flux in the resulting networks.
Computational simulations
Unless otherwise stated, all simulations use ER random networks, with N=10^{4} nodes and average connectivity degree 〈k〉=4 as starting conditions. Different network sizes and link densities may modify the numerical results of the simulations; however, in this research, we focus mainly on the effects of the confinement parameters: p_{s} (relative confinement size) and p_{f} (relative flux). Besides, we restrict the study to networks with a single confined space; afterward, we introduce multiple confined spaces and discuss system size scaling.
Each simulation runs until the network reaches a steady state. One simulation time step is defined as a rewiring phase that sweeps all confined agents, followed by a flux phase. The number of individual time steps m necessary to reach a steady state, depends on the parameters p_{s} and p_{f}; for all results presented here we use 10^{3}<m<2×10^{4}. In general, both a smaller p_{s} (smaller confined space \(\mathcal {P}\)) and a smaller p_{f} (smaller flux of nodes trough \(\mathcal {P}\)) require longer times to reach a steady state.
During the network evolution we compute the following metrics: the average clustering coefficient C (Watts and Strogatz 1998), the degree distribution P(k), and network fragmentation, i.e. size and stability of the largest connected component. Besides, the dynamics tend to create highly interconnected clusters with lower connectivity between them. In order to find partitions that may define these clusters, we use the “Louvain algorithm” (Blondel et al. 2008), which we also use to follow the time evolution of the modularity.
Results
Clustering Increase
Most empirical networks of interest, particularly social networks, display highly interconnected subgraphs. The concept of a global clustering coefficient C, or transitivity (Holland and Leinhardt 1971), is one of the ways we use to quantify this effect. It is well known that large random networks present very low clustering coefficient compared to real world networks with equal density —in social networks we can find usually C∝10^{−1} (Albert and Barabási 2002; Liljeros et al. 2001). This relatively elevated coefficient must be driven by some intentional or plannedmechanism typical of social interactions.
Figure 1 shows the time evolution of the global clustering coefficient, starting from a random network (C≈〈k〉/N=4×10^{−4}), for a fixed p_{s}=0.01 and several values of the parameter p_{f}; it can be seen that C always increases and, after a transient, reaches a stable state. Hence, the confinement dynamics transforms the initial ER network, gradually increasing the clustering coefficient, depending on the parameters p_{s} and p_{f}, which play a key role in such reshaping. The increase in C occurs inside the confined space, where nodes tend to connect to each other due to the rewiring mechanism. Such behavior, which increases the confinement subgraph density, is typical of a socially driven network. At the same time, the flux dynamics continuously disseminates members of these groups to the outside of the confinement.
Noteworthy, the asymptotic values of C are independent of the initial network; if, for example, we start from a WattsStrogatz (WS) network, the clustering decreases to the same asymptotic values of Fig. 1, which, for fixed N, seem to depend inversely on parameter p_{f}. The reason different input networks yield the same resulting steady state is the quasirandom nature of the dynamics, in which confined and released nodes, along with the rewiring, are all chosen randomly. Therefore, the initial configuration has no influence in the asymptotic state.
We have previously shown that the clustering coefficient inversely depends on the flux p_{f}; in addition, it weakly depends on the relative confinement size p_{s}. This behavior can be better visualized in the phase diagram of C in the p_{s}−p_{f} plane (Fig. 2). A smaller flux makes nodes spend more time in confinement, gaining more links and having greater chances of forming new triangles, thus increasing clustering. On the other hand, a bigger confined space \(\mathcal {P}\) increases the chance of forming new triangles, partially because nodes stay longer inside \(\mathcal {P}\), having more time to form new connections, but also because the number of links that can be redirected to the confinement is proportional to the number of nodes inside it. The newly formed triangles eventually go outside the confinement, contributing to the general increase in the value of C.
Nevertheless, if p_{s} is of the size of the system, there is no actual confinement, just pure reshuffling. In such a case, C is not expected to change from its very low initial value. Therefore, a non monotonic behavior for Cvs p_{s} would be exhibited if all possible values of p_{s} were explored, but that is outside the region of practical interest (p_{s}≪1).
We have to mention that a size dependence of C(p_{s},p_{f}) is observed and it is discussed in the last two sections, which regard the size scaling of the model.
Community Emergence:
Apart from increasing the global clustering, the proposed confinement dynamics generates highly internally connected clusters, weakly linked between them; the kind of network structures associated with the idea of structural communities. The detection and characterization of communities (or modules) in large networks is a trending topic in network science (Barabási and et al. 2016), and the emergence of community structures is a remarkable result of the proposed network dynamics.
We use a modularity (Newman 2006) maximization algorithm, the “Louvain method” (Blondel et al. 2008), for partitioning the network, measuring the modularity Q, and detecting communities. Moreover, we visually inspect the networks’ configuration by making snapshots using a drawing software (Bastian et al. 2009; Martin et al. 2011) and a forcedirected graph drawing algorithm (Jacomy et al. 2014) (see Fig. 3).
Unlike known benchmarks for modular networks, the proposed dynamics does not prefix the modularity value, and neither the number of modules nor the average size of them; communities emerge naturally during simulation, without the use of any a priori grouping metadata. While the procedure is not crafted to produce the modular separation of the graph, it is obviously the mechanism behind the emergence of such reordering of the network.
In order to understand how communities emerge during the dynamics, we consider the confined space \(\mathcal {P}\) as being one partition or community, named c, and examine its contribution to the global modularity M, named M_{c} (Newman 2006):
In Eq. 6, ℓ is the number of edges in the entire network, so \(\sum _{i=1}^{N} k_{i} = 2\ell \), A_{ij} is the adjacency matrix, \(\frac {k_{i} k_{j}}{2 \ell }\) is the expected number of connections between nodes i and j for a random network, and the sum \(\sum _{i,j}^{c}\) is computed over the nodes inside the partition c with N_{c} nodes. This expression for M_{c} can be written in a simple form as
where \(\ell _{c} = 1/2\sum _{i,j}^{c} A_{ij}\) and \(k_{c} = \sum ^{c}_{i} k_{i}\) are the number of links and the total degree of partition c, respectively. As nodes inside \(\mathcal {P}\) receive new connections, the connectivity matrix gets additional A_{ij}=1 terms. For each node rewired, both ℓ_{c} and k_{c} increase by 1, and as usually k_{c}≪ℓ, then M_{c} is increased by
The above increase in the local contribution to the modularity is for each node that is rewired; in order to estimate the effective initial increase in modularity, all nodes that participate in the rewiring have to be considered:
and as ℓ=〈k〉N/2, we end up with
This mean field estimation of the modularity increase rate is restricted to the condition p_{s}≪p_{f} and even so, it represents an upper estimation, as fluctuations and correlations are not taken into account. Moreover, it is valid at the beginning of the dynamics, when the distribution of links is uniform, so modularity is at the random value M(0)=0.5. With the increase of internal connections after the transient, some nodes may no longer have connections to the outside, thus less rewiring occurs.
Similar arguments can be applied to explain how clusters survive outside the confinement using Eq. 6. Now consider that partition c is a cluster that has left \(\mathcal {P}\) some time ago. This newly formed cluster is rich with internal connections and is well connected to the confined space, then it may be detected as a single community. As time goes on, internal connections are preserved so the sum \(\sum ^{c}_{ij} A_{ij}\) remains the same, but the second (negative) term of the summation becomes less significant as the average connectivity 〈k_{c}〉 decreases —due to rewiring of edges between the confined space and the cluster outside— resulting in an increased modularity M_{c}. Then, with less connections to the confined space, the structure eventually separates from it. Summarizing, there is a constant process of community creation inside the confined space and its neighborhood, leaving and separating from the confinement. These structures eventually may disappear as new communities are formed by the continuous process of confinement and flux; this dual mechanism results in stable modularity, number of communities, and average community size, while the nodes that form them change all the time.
The detection and evolution of communities in dynamic networks is still a debating task (Palla et al. 2007; Delvenne et al. 2010), so we limit our investigation to taking snapshots of the structures at each time step, measuring the modularity, and observing the stability of other proposed quantities. Figure 3 shows one selected snapshot of the network, using a forcedirected algorithm for the visual representation in two different ways: the upper panel colors the eight identified communities at the time of the snapshot, while the lower panel colors the confined nodes (red) and outside confinement nodes (blue).
Figure 4 shows the time evolution of modularity for selected sets of relative confinement sizes, p_{s}, and relative flux parameter, p_{f}, along with the phase diagram of modularity in a region of interest of these two parameters. Partitioning of the network was achieved using the Louvain algorithm. It is shown in the left panel that modularity reaches a stable state after a transient that depends on the input network. The right panel shows a partial phase diagram of the key parameters of the model, showing a higher modularity in the darker blue region, associated with a smaller flux and intermediate confinement size. This sufficiently large confinement and small flux is consistent with the formation of highly connected clusters inside the confinement and their slow separation, forming an independent community.
While modularity is useful in evaluating the quality of a given partition and the detected community structures seem to agree with graphical visualization, community detection algorithms have limitations regarding detection resolution in situations such as the merging of two communities into a single one, the partitioning of a single community, or ignoring nested communities. Another example of limitation is the finding of multiple communities with modularity superior to zero, when the Louvain algorithm is applied to a completely random network. This is due to local fluctuations in big networks, in which possible community partitions may arise from the modularity maximization algorithm. Nevertheless, as long as their limitations are taken into account (Fortunato 2010; Lancichinetti et al. 2008), these detection algorithms remain very useful.
As explained at the beginning of this section, communities are not predetermined, but emerge as an indirect result of the confinement dynamics. Therefore, we propose a second parameter to measure the existence and quality of the modules partition. We define the parameter ϕ(c) of a given partition c of size N_{c} as the ratio between the numbers of external and total links of that partition, so that for a node j of the partition c, \(k_{j}^{ext}\) is the number of external links and k_{j} the degree of node j. Then,
So, for a partition with only internal connections, i.e. a completely closed community, ϕ(c)=0, while in a random partition of a random network we expect ϕ=0.5. We are interested in the average ratio for all partitions, thus, we define a global ratio \(\Phi (\mathcal {N})\) as a complementary way to follow the emergence and stability of the community structures:
Where \(k_{j}^{ext,N_c}\) is the number of external links of node j in partition N_{c}, with the sums made over the entire network. Figure 5 shows a clear correspondence with modularity data of Fig. 4; using the same sets of parameters p_{s} and p_{f}, we see that the curve with the lower asymptotic modularity has the higher asymptotic Φ(N).
Degree Distribution
Starting from the initial network, the dynamics change the degrees of individual nodes. Eventually, the degree distribution P(k) reaches a stationary state, while the degree of individual nodes continue to change over time. The stable asymptotic form of P(k) depends on the network size N, the average degree 〈k〉, and the parameters p_{s} and p_{f} of the dynamics. Figure 6 shows the final stable distributions obtained from simulations using some sets of the parameters p_{s} and p_{f}. Increased degree heterogeneity results for smaller p_{f} and bigger p_{s}, (i.e. bigger confinement and/or smaller flux).
The distributions P(k) presented in Fig. 6 are some examples of the many different distributions that can be generated, each one corresponding to a distinct set of parameters. If p_{s}=p_{f} the network stabilizes and displays Poisson’s degree distribution like a random network of the same size and average degree. As the confinement increases and/or the flux decreases the resulting degree distributions shift to longer tails type with increasing heterogeneity. Among the P(k) distributions found in the simulations we encounter curves that could be better fitted either with Poisson or Gaussian distributions. However, log normal and power law distributions are ubiquitous, mostly in the lower region of p_{f}, and to a less significant effect, in bigger confinement sizes, as can be seen in Fig. 7left.
Through the rewiring mechanism, confined nodes tend to increase connectivity, while free nodes tend to lose connections. By the flux mechanism, nodes are confined at random, and will also leave confinement at random. This means that the time spent in the confinement for t→∞ is similar for every node, so the heterogeneity of node degree must come from confinement during the last time steps. Assuming that a node j is confined at time t=t^{′}, the probability \(P_{f}^{j}(t=t^{\prime }+1)\) that the same node is released at the next flux step is:
Since p_{s}≥p_{f}, such probability is well defined, where a lower ratio means less chance of release. Since all nodes are picked at random, some pass quickly trough the confinement, while others might linger. The probability that a node stays in the confinement for a certain period Δt, (1−p_{f}/p_{s})^{Δt}, decreases exponentially with time. Nodes tend to gain connections while confined due to the rewiring dynamics, so those confined for a longer time tend to become more connected. From the exponentially decaying probability of confinement time, its average can be estimated as τ≈p_{s}/p_{f}, which explains why degree heterogeneity increases if p_{s} increases (p_{f} fixed, Fig. 6left) and/or p_{f} decreases (p_{s} fixed, Fig. 6right).
In order to check if the present model makes sense, we compare its results with a real network case. The data appeared in the paper “Topology, robustness, and structural controllability of the Brazilian Federal Police criminal intelligence network” (da Cunha and Gonçalves 2018), which consists of the network representation and topological analysis of data, obtained after several Brazilian Federal Police investigations in 2013. The network, designated BFP2013, shows very high modularity (M=0.96) and high clustering coefficient (C=0.4), higher than the maximum values of the present simulations (M=0.88 and C=0.14) obtained with N=10^{4}, 〈k〉 = 4, p_{s}=0.035, and p_{f}=0.005. Taking the stable state of the network that corresponds to the above parameters, we compute the normalized degree distribution P(k) and compare it with the normalized P(k) of the BFP2013 network (Fig. 7right). Considering that the real network is much more modular structured, the qualitative agreement is remarkable. We must notice that the real network is only a small part of a much bigger social network (all Brazilian inhabitants) while in the simulation we consider the whole population, scaled down. If we restrict ourselves to nodes recently released from confinement, we would probably observe values even closer to those of the real criminal network. Given this practical case, we can say that the model has the potential for representing real case scenarios.
Network Fragmentation
The rewiring phase increases the link density inside the confined space. As the number of links is conserved in the whole network, nodes outside \(\mathcal {P}\) tend to have their connectivity degree reduced, eventually reaching k=0. Therefore, the outside confinement subgraph may eventually fragment, decreasing the size of the largest connected component (LCC). This fragmentation is counterbalanced by the constant influx and outflux of random nodes, so an orphaned node or a separated cluster may be reconnected to other nodes, when confined to \(\mathcal {P}\). In order to follow and characterize the level of fragmentation of the network, we measure the time evolution and stable states of the LCC and show the results in Fig. 8.
Figure 8, left panel, shows that after a time transient those two effects, fragmentation by rewiring and reconnection by flux, balance each other and a stable size of the LCC is reached. The size of the LCC depends, apart obviously from network size and link density, on the two parameters of the dynamics, p_{s} and p_{f}. The phase diagram of p_{s} and p_{f} in the right panel of Fig. 8 shows increasing fragmentation for bigger relative size of confinement p_{s}, which is an expected result since the number of links rewired to subgraph \(\mathcal {P}\) is proportional to p_{s}N, resulting in decreased connectivity degree outside of \(\mathcal {P}\). Likewise, when p_{f} decreases, nodes outside \(\mathcal {P}\) are less likely to be confined and reconnected to other clusters. The average degree outside \(\mathcal {P}\) also decreases with lower flux as the connectivity of nodes outside depends only on the link sets ℓ_{io} and ℓ_{out}, which are created only trough outflux of nodes.
Size scaling with multiple confined spaces
The single confinement dynamics is useful to introduce and illustrate the mechanism that results in increased clustering, community forming, and degree heterogeneity, in relative small sized network. However, we briefly noticed, in previous sections, that, for a fixed confinement size p_{s} and flux p_{f}, different network sizes and densities yield networks with different metrics and a degree distribution which does not scale with size. In other words, the single confinement space does not scale with network size. Nonetheless, in the real world, we expect the number of confined spaces to pace with the size of the population.
It can be shown that introducing multiple confined spaces inside the same network makes the model to scale with size. We start with a small network, N=1000. With p_{s}=0.05 and p_{f}=0.005 we have a confined space of size 50 with 5 nodes changing during flux phase. When the network size doubles (N=2000), instead of increasing the confinement to 100 nodes and the flux to 10 nodes, we add a second confined space of the same size than the first one. We repeat the process as the network grows, keeping the confinement size and flux rate, but increasing the number of confined spaces so the network still has a fixed relative number of confined nodes p_{s} and relative flux p_{f}, but divided among independent confined spaces. Each confined space operates only with the free nodes (apprehending, releasing, and rewiring as previously described); once a node is released, it can be reapprehended by other confined space or even the same one.
In this multiple confinement scenario, the clustering and the relative size of the giant component have size invariance, as can be seen in Fig. 9left. Meanwhile, modularity, as well as community size, exhibits a weak dependence with network size (N), both increasing slowly with N (Fig. 9left). As we mention before, community detection algorithms have limitations, particularly concerning resolution. The “true” community structure that emerge from our proposed model is not known a priori. It is an emerging, dynamic, and indirect consequence of the key parameters of the model. Therefore, partitions sizes and modularity are good indicators of the observed structure but not the exact ones.
In the left panel of Fig. 9 we present the resulting degree distributions for different sizes showing a nice size invariance, except for a normalization and a weak but expected tail dependence on size.
Finally, we want to point out that while multiple confinements is a whole new venue for further research (for example multilevel confined spaces or intersecting confinements), it was considered here just for scaling matters.
Final considerations
In “Degree Distribution” section (degree distributions), we pointed out that hubs are formed inside the confinement: while the rewiring is random, only the nodes inside the confinement receive new links. In real social networks the mechanism of preferential attachment is not always explicit, and the reason for a node to form connections can be as subtle as one remaining in a limited place while other nodes go through that place.
The main difference from standard growing models with preferential attachment is the dynamic nature of the hubs inside the structure. Older nodes of the network are not necessarily hubs, but rather the older confined nodes. We can scale the network size up (adding nodes, edges, or confined spaces) or down. As long as the dynamics have sufficient time to reach the steady state, the networks preserve their form and the measured metrics. In this sense, our results differ from the temporal growth model proposed by Bagrow and Brockmann (2013) in which new nodes attach to older ones with an initial attractiveness proportional to the clustering coefficient of each node. This model gives rise to several interesting features, including community formation. However, Bagrow and Brockmann model evolves adding new nodes on the system, while our research focuses on the dynamic of topologically confined subsets (of fixed size) of nodes.
The proposed model also produces nodes with degrees of variable timespan, a feature that most social networks exhibit. When a perturbation is applied to the network structure, after a short transient, the network reaches an equivalent stable state.
Conclusions
In the present contribution we have introduced a simple model for dynamic networks, which we call confinement dynamics. The proposed model and the parameters that control it bear similarities with complex phenomena of real networks, particularly social networks, and so do the resulting structures. The size and number of confined spaces can be associated with real world organizations: individuals of a commercial firm, inmates of a prison, or social media groups. As for the flux, it can be associated with the time scale dynamics.
We have shown that the model gives rise to the appearance and stability of complex phenomena observed in empirical networks, such as high clustering, heterogeneous degree distributions (scalable with network size), and formation of communities. Size scalability is verified using multiple confined spaces, and the stability of the general network form is observed while the components are in continuous flux —an important characteristic often manifested in real systems. Remarkably, all those features emerge from just two parameters (p_{s} and p_{f}) and from any input network; indeed the self organization of the resulting networks becomes evident due to the choice of random networks –which lack all the complex structures developed during the dynamics– as starting configurations. The key element for such independence from the initial conditions is the random criteria for confinement, release, and rewiring of individual nodes, with no memory of the initial state —except, naturally for the transient behavior— in addition to network size and number of links.
The incarceration example is of particular interest when analyzing criminal dynamics. Criminal network detection and dismantling models are of great utility in generating public welfare and in reducing personal and patrimonial damages. Most models assume that an inmate is removed from the network while incarcerated (Duijn et al. 2014; Gordon et al. 2009; Gambra and Frey 2011; Schneider et al. 2014). This assumption may overestimate the incarceration system’s ability to remove the agent from criminal dynamics, and, at the same time, overlooks the capacity of the confinement systems to generate new contacts and reorganize criminal networks.
Future research could aim to further develop this model by considering simulations with more realistic initial conditions, such as seed networks, and more complex wiring dynamics, such as the configuration model or nonMarkovian wiring.
Characterizing the time evolution of communities, as they born or dye out, merge, or split, is a difficult task that involves dealing with huge sets of timestamped data, and tracking individual modules of the network (Palla et al. 2007; Hopcroft et al. 2004). Although the model we introduce represents a simplified view of a complex phenomenon, we believe it can help to understand, in a simple way, the underlying modular characteristic of real complex networks and, more importantly, how communities can emerge and evolve.
Abbreviations
 BFP2013:

Brazilian federal police network available in ref (da Cunha and Gonçalves 2018)
 ER:

Erdös Rényi networks
 LCC:

Largest connected component
 WS:

WattsStrogatz networks
References
Albert, R, Barabási AL (2002) Statistical mechanics of complex networks. Rev Mod Phys 74(1):47.
Bagrow, JP, Brockmann D (2013) Natural emergence of clusters and bursts in network evolution. Phys Rev X 3(2):021016.
Barabási, AL, et al. (2016) Network Science. Cambridge university press, Cambridge, UK.
Bastian, M, Heymann S, Jacomy M, et al. (2009) Gephi: an open source software for exploring and manipulating networks. Icwsm 8(2009):361–362.
Blondel, VD, Guillaume JL, Lambiotte R, Lefebvre E (2008) Fast unfolding of communities in large networks. J Stat Mech: Theory Exp 2008(10):10008.
Condon, A, Karp RM (2001) Algorithms for graph partitioning on the planted partition model. Random Struct & Algoritm 18(2):116–140.
da Cunha, BR, Gonçalves S (2018) Topology, robustness, and structural controllability of the brazilian federal police criminal intelligence network. Appl Netw Sci 3(1):36.
Delvenne, JC, Yaliraki SN, Barahona M (2010) Stability of graph communities across time scales. Proc Natl Acad Sci 107(29):12755–12760.
Duijn, PA, Kashirin V, Sloot PM (2014) The relative ineffectiveness of criminal network disruption. Sci Rep 4:4238.
Erdös, P, Rényi A (1959) On random graphs, i. Publ Math (Debr) 6:290–297.
Freeman, LC (1977) A set of measures of centrality based on betweenness. Sociometry 40(1):35–41.
Freeman, LC, Borgatti SP, White DR (1991) Centrality in valued graphs: A measure of betweenness based on network flow. Social Networks 13(2):141–154.
Fortunato, S (2010) Community detection in graphs. Phys Rep 486(35):75–174.
Gambra, MB, Frey E (2011) Social dynamics with peer support on heterogeneous networks. Euro Phys J B 83(4):507–518.
Gordon, MB, Iglesias JR, Semeshenko V, Nadal JP (2009) Crime and punishment: the economic burden of impunity. Euro Phys J B 68(1):133–144.
Holland, PW, Leinhardt S (1971) Transitivity in structural models of small groups. Comp Group Stud 2(2):107–124.
Hopcroft, J, Khan O, Kulis B, Selman B (2004) Tracking evolving communities in large linked networks. Proc Natl Acad Sci 101(suppl 1):5249–5253.
Jacomy, M, Venturini T, Heymann S, Bastian M (2014) Forceatlas2, a continuous graph layout algorithm for handy network visualization designed for the gephi software. PloS one 9(6):98679.
Lancichinetti, A, Fortunato S, Radicchi F (2008) Benchmark graphs for testing community detection algorithms. Phys Rev E 78(4):046110.
Liljeros, F, Edling CR, Amaral LAN, Stanley HE, Åberg Y (2001) The web of human sexual contacts. Nature 411(6840):907.
Martin, S, Brown WM, Klavans R, Boyack KW (2011) OpenOrd: an opensource toolbox for large graph layout In: Proc. SPIE 7868, Visualization and Data Analysis 2011, 786806 (24 January 2011). https://doi.org/10.1117/12.871402.
Newman, ME (2006) Modularity and community structure in networks. Proc Natl Acad Sci 103(23):8577–8582.
Palla, G, Derényi I, Farkas I, Vicsek T (2005) Uncovering the overlapping community structure of complex networks in nature and society. Nature 435(7043):814.
Palla, G, Barabási AL, Vicsek T (2007) Quantifying social group evolution. Nature 446(7136):664.
Pratt, TC, Cullen FT (2005) Assessing macrolevel predictors and theories of crime: A metaanalysis. Crime Justice 32:373–450.
Kerley, KR (2017) The Encyclopedia of Corrections. http://doi.wiley.com/10.1002/9781118845387.
Brame, R, Mulvey EP, Schubert CA, Piquero AR (2018) Recidivism in a sample of serious adolescent offenders. J Quant Criminol 34(1):167–187.
Schneider, ÉM, Iglesias JR, Hallberg K, Kuperman MN (2014) Crimes against humanity: the role of international courts. PloS one 9(6):99064.
Watts, DJ, Strogatz SH (1998) Collective dynamics of ’smallworld’networks. Nature 393(6684):440–442.
Yang, Z, Algesheimer R, Tessone CJ (2016) A comparative analysis of community detection algorithms on artificial networks. Sci Rep 6:30750.
Acknowledgements
See Funding.
Funding
EMS acknowledges financial support from Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) and CAPES #1. BRC acknowledges the Science Foundation Ireland (Grant No. 16/IA/4470) for partial financial support.
Availability of data and material
The datasets generated during the current study are available from the corresponding author on request.
Author information
Authors and Affiliations
Contributions
EMS design, simulation, data, discussion and writing; SG design, discussion and writing; JRI and BRC discussion and writing. All authors revised and approved the manuscript.
Corresponding author
Ethics declarations
Ethics approval and consent to participate
Not applicable.
Consent for publication
The authors consent for publication.
Competing interests
The authors declare that they have no competing interests.
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Schneider, É., Gonçalves, S., Iglesias, J. et al. Dynamic Modular Networks Model Mediated by Confinement. Appl Netw Sci 4, 30 (2019). https://doi.org/10.1007/s4110901901432
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s4110901901432
Keywords
 Temporal communities
 Modular networks
 Dynamic network models
 Confinement models