{'fraction_non_alphanumeric': 0.032087330466424084, 'fraction_numerical': 0.009813650898665784, 'mean_word_length': 4.6915594603074995, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Model of mobile agents for sexual interactions networks

We present a novel model to simulate real social networks of complex interactions, based in a granular system of colliding particles (agents). The network is build by keeping track of the collisions and evolves in time with correlations which emerge due to the mobility of the agents. Therefore, statistical features are a consequence only of local collisions among its individual agents. Agent dynamics is realized by an event-driven algorithm of collisions where energy is gained as opposed to granular systems which have dissipation. The model reproduces empirical data from networks of sexual interactions, not previously obtained with other approaches.


Introduction
A social network is a set of people, each of whom is acquainted with some subset of the others. In such a network the nodes (or vertices) represent people joined by edges denoting acquaintance or collaboration. Empirical data of social networks include networks of scientific collaboration [1], of film actor collaborations [2], friendship networks [3] among some others [4]. One kind of social network is the network of sexual contacts [5,6,7,8], where connections link those persons (agents) that have had sexual contact with each other. The empirical investigation of such networks are of great interest because, e.g. the topological features of sexual partners distributions help to explain why persons can have the same number of sexual partners and yet being at distinct risk levels of contracting HIV [9].
The simplest way to characterize the influence of each individual on the network is through its degree k, the number of other persons to whom the individual is connected. Sexual contact networks are usually addressed as an example of scalefree networks [6,7,8,10], because its property of having a tail in its degree distribution, which is well fitted by a power-law P (k) ∼ k −γ , with an exponent γ between 2 and 3. However, another characteristic feature, not taken into account, is that the small k-region, comprehending the small-k values varies slowly with k, deviating from the power-law. Moreover, the size of the small-k region also increases in time, yielding rather different distributions when considering the number of partners during a one year period or during the entire life, e.g. for entirelife sexual contacts, the degree distribution shows that at least half of the nodes have degree in the small-k region [5,6]. A model predicting all these different distributions shapes for different time spans is of crucial interest, because the transmission of diseases occur during the growth mechanism of the network. In the on-line version two colors represent the two sexual genders and larger symbols emphasize those which belong to the network (linked agents).
One of the main difficulties for validating a model of sexual interactions is that typical network studies of sexual contacts involve the circulation of surveys, or anonymous questionnaires, and only the number of sexual partners of each interviewed person is known, not being possible to obtain information about the entire network, in order to calculate degree correlations, closed paths (cycles), or average distance between nodes.
In this work we propose a model of mobile agents in two dimensions from which the network is build by keeping track of the collisions between agents, representing the interactions among them. In this way, the connections are a result not of some a priori knowledge about the network structure but of some local dynamics of the agents from which the complex networks emerge. Below, we show that this model is suitable to reproduce sexual contact networks with degree distribution evolving in time, and we validate the model using contact tracing studies from health laboratories, where the entire contact network is known. In this way, we are able to compare the number of cycles and average shortest path between nodes as well as compare the results with the ones obtained with Barabási-Albert scale-free networks [11], which are well-known models, accepted for sexual networks [6,7,8]. We start in Sec. 2 by describing the model of mobile agents, and in Sec. 3 we apply it to reproduce the statistical features of empirical networks of sexual contacts. Discussion and conclusions are given in Sec. 4.

Model of mobile agents for sexual interactions
The model introduced below is a sort of a granular system [12], where N particles with small diameter d represent agents randomly distributed in a two-dimensional system of linear size L ≫ √ N d (low density) and the basic ingredients are an increase of velocity when collisions produce sexual contacts, two genders for the agents (male and female), and n/N , the fraction of agents that belong to the network, which constitutes an implicit parameter for the resulting topology of the evolving the network.
The system has periodic boundary conditions and is initialized as follows: all agents have a randomly chosen gender, position and moving direction with the same velocity modulus |v 0 |. We mark one agent from which the network will be constructed. When the marked agent collides for the first time with another one of the opposite gender, the corresponding collision is taken as the first connection of our network and its colliding partner is marked as the second agent of the network (Fig. 1a). Through time, more and more collisions occur, increasing the size n of the network ( Fig. 1b and 1c) till eventually all the agents composing the system are connected.
Collisions between two agents take place whenever their distance is equal to their diameter and the collision process is based on an event-driven algorithm, i.e. the simulation progresses by means of a time ordered sequence of collision events and between collisions each agent follows a ballistic trajectory [13]. Since sexual interactions rely on the sociological observation [14] that individuals with a larger number of partners are more likely to get new partners, we choose a collision rule where the velocity of each agent increases with the number k of sexual partners. The larger the velocity one agent has the more likely it is to collide. Moreover, contrary to collision interactions where velocity direction is completely deterministic [15], here the moving directions after collisions are randomly selected, since in general, sexual interactions do not determine the direction towards which each agent will be moving afterwards. Therefore, momentum is not conserved.
Regarding these observations our collision rule for sexual interactions reads where k i is the total number of sexual partners of agent i, exponent α is a real positive parameter, ω = (e x cos θ + e y sin θ) with θ a random angle and e x and e y are unit vectors. Collisions which do not correspond to sexual interactions only change the direction of motion. Collisions corresponding to sexual interactions, i.e. with a velocity update as in Eq. (1), are the only ones which produce links, and occur in two possible situations: (i) between two agents which already belong to the network, i.e. between two sexually initiated agents and (ii) when one of such agents finds a non-connected (sexually non-initiated) agent. For simplicity, we do not take into account sexual interactions between two non-connected agents, and therefore our network is connected (see the discussion in Sec. 4).
When interactions of type (i) and (ii) occur, both the distribution tail and the small-k region are observed, as shown by the cumulative distribution P cum (k) in Fig. 2a. Here, we use a system of N = 320×320 agents with ρ = 0.02, α = 1 and distributions are plotted for different stages of the network growth, namely n = 10 3 , n = 10 4 , n = 5 × 10 4 and n = 10 5 ∼ N . As one sees, the exponent of the power-law tail and the transition between the tail and the small-k region increase during the growth process. These features appear due to the fact that at later stages most of the collisions occur between already connected agents. Consequently, the average number of partners increases as well.
If one considers only type-(ii) sexual contacts, the system reproduces a stationary scale-free network, as shown in Fig. 2b. In this case the average number of partners, defined as [16] k = k min (γ − 1)/(γ − 2) with k min the minimum number of partners, is always 2 (k min = 1 and γ = 3). As we show below, while empirical data of sexual contacts over large periods have distributions like the ones for regime (i)+(ii), data for shorter periods (1 − 10 years) are scale-free (only (ii)). With our model one can easily interpolate between both interaction regimes, (i)+(ii) and (ii), by introducing a parameter s of 'selectivity', defined as the probability that sexual initiated agents in case of collision with another initiated agent, have no sexual contact. Physically, this selectivity accounts for the intrinsic ability that a node has to select from all its contacts (collisions) the ones which are sexual. These intrinsic abilities were already used in other contexts, e.g. as a new mechanism leading to scale-free networks in cases where the power-law degree distribution is neither related to dynamical properties nor to preferential attachment [17]. For s = 0 one obtains the two regions illustrated in Fig. 2a, namely the small-k region and the power-law tail, while for s = 1 one obtains the pure scale-free topology illustrated in Fig. 2b. In Fig. 3a, we show the crossover between these two regimes.
The shape of the cumulative distributions is also sensible to the exponent α in the update velocity rule, Eq. (1), as shown in Fig. 3b. While for small values of α 1 one gets an exponentiallike distribution, for α 1.4 the distribution shows that a few nodes make most of the connections. Henceforth, we fix α = 1.

2.
Having described the model of mobile agents we proceed in the next section of a specific application, i.e. modeling empirical networks of sexual contacts.

Reproducing networks of sexual contacts
In this Section we will show that, by properly choosing the parameter values in our model, one can reproduce real data distributions of sexual contact networks. In Fig. 4 the cumulative distributions of a real contact network [6] are shown for females (circles) and males (triangles) separately, based on empirical data from 2810 persons in a Swedish survey of sexual behavior. The solid lines in Fig. 4 indicate the simulated distributions. The simulated power-law tails have exponents γ m = 2.4 and γ f = 4.0 for males and females respectively, compared with the empirical data γ m = 2.6 ± 0.3 and γ f = 3.1 ± 0.3 [6].
To stress that, while the power-law tails are also well fitted by distributions obtained with scale-free networks (dashed lines in Fig. 4), these distributions have a minimum number of connections (partners) of k min = 5 for females and k min = 7 for males, contrary to the real value k min = 1 also reproduced with our agent model. In fact, the model of mobile agents takes into account not only the power-law tail of these distributions, but also the small-k region which comprehends the significant amount of individuals having only a few sexual partners (k 1).
Is important to note that in order to reproduce the difference in the exponents is necessary to have 58% females and 42% males, which is far from the expected difference among number of females and males in typical human populations, with ratios of females:males of the order of 1.1. The difference in the exponents of the distributions tails for males and females separately, present in the data of sexual surveys, has generated much controversy and is often considered due to a bias either of sampling or honest reporting (see Ref. [5] and references therein). The exponents γ m and γ f on a bipartite network are expected to be nearly the same when the percentage of males and females are similar, as shown in Fig. 5. In each plot five different realizations are shown for males (solid lines) and females (dashed lines). In Fig. 5a, we plot the results for the same conditions as in Fig. 4 (58% females and 42% males). Taking  the average of the five curves for each gender yields the curves shown in Fig. 4. Figures 5b-d show the distributions obtained for other percentages illustrating that when decreasing the difference in the ratio females:males difference in the exponents dissappear. A characteristic feature of our model is that the average number k of partners increases as the network grows, which is natural characteristic expected to occur in real sexual networks according to the observed differences in the shape of the degree distribution for yearly and entire-life reports of number of sexual partners [6,7]. This feature is not observed in scale-free networks, as illustrated in Fig. 6. Of course, that this growth also indicates non-stationary regimes, where k diverges with the network growth. In the next section we explain how to overcome this shortcoming. While in the homosexual network triangles and squares appear, in the heterosexual network triangles are absent (see Table 1). We compare the model, with two empirical networks of sexual contacts. One network is obtained from an empirical data set, composed solely by heterosexual contacts among n = 82 nodes, extracted at the Cadham Provincial Laboratory (Manitoba, Canada) and is a 6-month block data [19] between November 1997 and May 1998 (Figure 7a sketches this network). The other data set is the largest cluster with n = 250 nodes in the records of a contact tracing study [18], from 1985 to 1999, for HIV tests in Colorado Springs (USA), where most of the registered contacts were homosexual (see Figure 7b). partners. However, the agent model with s = 0.7 reproduces, as well, the clustering coefficient distribution that we measure from the empirical network.
The clustering coefficient C(i) of one agent is defined [2] as the total number of triangular loops of connections passing through it divided by the total number of connections k i . Averaging C(i) over all nodes with k i neighbors yields the clustering coefficient distribution C(k). While for the scale-free graph which better reproduces these empirical data, the clustering coefficient is zero, our agent model yields a distribution which resembles the one observed in the real network (Fig. 8c). This feature is due to the co-existence of a tree-like substructure and closed paths (see Figs. 7b).
For both heterosexual and homosexual networks of sexual contacts, the model of mobile agents reproduces other important statistical features, namely the average clustering coefficient C and the number of loops of a given order. Table 1 indicates the number T of triangles (loops composed by three edges), the number Q of squares (loops with four edges) and the average clustering coefficients C given by [2] the average of C(i) over the entire network.
When using the agent model with the same number N of nodes as in the real networks we obtain similar results for L, T , Q and C, as shown in Table 1 Table 1 we also show the values obtained with scale-free networks, for both cases of one and two genders, whose minimum number of connections was chosen to be k min = 2, for which the clustering coefficient distributions are as close as possible from the distributions of the real networks. Clearly, the agent model not only yields clustering coefficient values much closer to the ones measured in the empirical data, but also does not show the formation of huge amounts of loops (triangles and squares), a feature of scale-free networks which is not observed in empirical data.

Discussion and conclusions
In this paper we presented a new model for networks of complex interactions, based on a granular system of mobile agents whose collision dynamics is governed by an efficient eventdriven algorithm and generate the links (contacts) between agents. As a specific application, we showed that the dynamical rules for interactions in sexual networks can be written as a velocity update rule which is a function of a power α of the previous contacts of each colliding agent. For suitable values of α and selectivity s, the model not only reproduces empirical data of networks of sexual contacts but also generates networks with similar topological features as the real ones, a fact that is not observed when using standard scale-free networks of static nodes. Furthermore, our model predicts that the growth mechanism of sexual networks is not purely scale-free, due to interactions among internal agents, having a mean number of partners which increases in time. This should influence the predictions from models of spreading of infections [16]. Our agent model offers a realistic approach to study the emergence of complex networks of interactions in real systems, using only local information for each agent, and may be well suited to study networks in sociophysics, biophysics and chemical reactions, where interactions depend on specific local dynamical behavior of the elementary agents composing the network.
While given promising results the model may be improved in two particular aspects. First, it should enable the convergence towards a stationary regime with a growth process starting with all possible collisions instead of one particular agents from which the network is constructed. Second, the dependence of the above results on the velocity rule in Eq. (1) should be studied in detail, namely for the case of constant velocity (α = 0). Preliminary results have shown that the stationary regime is easily obtained with the model above by introducing a simple aging scheme, while by varying the parameter α one is able to reproduce other non-trivial degree distributions. Moreover, we introduced the selectivity parameter s to select from all possibles social interactions (collisions) the ones which are of sexual nature. Without introducing this selectivity, the model of mobile agents is able to reproduce other social networks of acquaintances. These and other questions will be addressed elsewhere [20].