The shape of our planet can be approximated by a sphere with a radius of about miles. Many real transportation and mobility networks have vertices located on the surface of that sphere. These are examples of spatial networks, networks whose vertices are embedded in a space . In many transportation and mobility networks, the surface of the sphere is simplified as a projection on a plane  while in some other cases, e.g., air transportation networks [13, 10, 11], such an approximation is often not possible due to the long distances involved.
When vertices are embedded in some space, edges may cross. While crossings are exceptional in many spatial networks to the point of being neglectable , crossings can also be scarce but not neglectable in one-dimensional layouts of certain networks: syntactic dependency and RNA secondary structures, where vertices are arranged linearly (distributed along a line) [8, 5]. The former are networks whose vertices represent words of a sentence and the edges represent syntactic dependencies between them. These have become the de facto standard to represent the syntactic structure of sentences in computational linguistics  and the fuel of many quantitative studies [14, 19]. In RNA secondary structures, vertices are nucleotides A, G, U, and C, and edges are Watson-Crick (A-U, G-C) and (U-G) base pairs . In these one-dimensional networks, two edges cross whenever the endpoints’ positions are interleaved in the sequence.
Statistical properties of C, the number of edge crossings of a graph , have been studied in generic embeddings, denoted as , that meet three mathematical conditions : (1) only independent edges can cross (edges that do not share vertices), (2) two independent edges can cross in at most one point, and (3) if several edges of the graph, say edges, cross at exactly the same point then the amount of crossings equals . In our view, generic embeddings are two-fold: a space and a statistical distribution of the vertices in such space. In , the space is the surface of a sphere while the distribution of the vertices on that surface is uniformly random. Compact formulae for the expectation and the variance have been obtained . Here we apply such a framework to revise the problem of calculating the distribution of C in arrangements of vertices on the surface of a sphere. We use to denote the expectation of the number of crossings C, and to denote the variance of C in a generic layout .
In his pioneering research , J. W. Moon analyzed the properties of the distribution of C in uniformly random spherical arrangements (rsa), where vertices are arranged on the surface of a sphere uniformly at random and independently from each other, and edges become geodesics on the sphere’s surface. Specifically, Moon studied and , the expectation and variance of C in the random spherical layout, for two kinds of graphs: complete graphs of vertices, , and complete bipartite graphs, , with vertices in one partition and vertices in the other. His derivations of are straightforward. Borrowing the notation in , Moon obtained that the expectation of C is
where is the number of pairs of independent edges  and
is the probability that two independent edges cross. Indeed,is a handle for the size of the set , consisting of the pairs of independent edges of a graph [18, 2]. Thanks to
He also derived formulae for the variance of C for these two kinds of graphs, i.e.
which simplifies to
where the superscript is used to distinguish Moon’s work from our own derivations. Here we revise equations 2 and 3 in light of computer simulations and a recently introduced theoretical framework to investigate .
This article is organized as follows. Section 2 summarizes the general mathematical framework for the calculation of , and section 3 adapts it to the case of random spherical arrangements. In section 4
, we review Moon’s calculations, and compare them with our own with the help of numerical estimates ofin complete and complete bipartite graphs in sections 4.1 and 4.2 respectively. These numerical estimates confirm the correctness of our derivations and show that Moon’s (2)-(3) underestimate significantly the true variance. Section 5 discusses our findings and attempts to shed light on the origins of the inaccuracy of and . Section 6 details all the numerical methods involved in the numerical calculation of . This section is placed after the discussion to make the presentation of the main arguments more streamlined.
2 The variance of C in generic layouts
In , C was defined as a summation of pairwise crossings between independent edges, i.e.
is an indicator random variable that equals 1 whenever the independent edgesand cross in the given layout. This definition was used to derive the expectation of C as
for two independent edges and embedded in the layout. Hereafter, an edge is a set of two vertices, denoted as . Since is an indicator random variable, is the probability that two independent edges cross in the given layout . For example, in Moon’s random spherical arrangement . Therefore, using (5) we obtain
Moreover, in uniformly random linear arrangements (rla), where the vertices of a graph are placed along a linear sequence uniformly at random, , and then
00 8 0 0 01 7 0 1 021 6 0 2 022 6 0 2 03 5 0 3 04 4 0 4 12 6 1 2 13 5 1 3 24 4 2 4
The same definition of C was used again in  to study the variance of C in a general layout, similarly to the way Moon did for the particular case of random spherical arrangements . In , the variance of C was expressed compactly as a summation over products between graph-dependent terms, the ’s, and layout-dependent terms, the ’s, i.e.
Formally, the type of a product is obtained applying a function on a pair and then ,
The crux to understand (8) are the layout-dependent terms, , actually a shorthand for
where is the type of the product for . The type of product is determined by the vertices forming the edges of as explained in detail in table 1. The set of all distinct types of products is
following the encoding of each type in table 1.
The amount of products of type in the given graph satisfies 
where is a positive integer constant that depends only on , and is the number of subgraphs of isomorphic to the graph defined by the edges involved in the product of type . Figure 1 depicts all these graphs. Table 2 shows the values of the and the formal definition of each .
For the sake of brevity, we use the shorthand
Since is an indicator random variable, is the probability that both pairs of independent edges cross in a generic embedding *.
Therefore, as it was concluded in , in order to calculate the variance of C of a graph in a given layout one only needs to know the values of the ’s in (which are independent of the layout) and the values of the in the given layout (which are independent of the graph). The values of the ’s in complete and complete bipartite graphs, shown in table 3, have allowed to derive expressions for the variance of C that are valid for a generic embedding * . The substitution of the these values in (8) yields
A step further consists of instantiating the equations above replacing * by a uniformly random linear arrangements (rla). After calculating the values of the and substituting them into (12), one obtains 
as expected. Interestingly, the same approach on (13) produces
Next section shows how equivalent results can be obtained when replacing by a random spherical arrangement, which turns out to be a more complex case.
00 01 021 022 03 04 12 13 24
3 The variance of C in spherical random arrangements
Here we aim to calculate the values so as to establish the foundations to derive an arithmetic expression for the variance of C in uniformly random spherical arrangements of complete and complete bipartite graphs. Recall that, in this layout, vertices are distributed on the surface of a sphere uniformly at random, and edges become geodesics on that surface, i.e., great arcs (see section 6.2 for a detailed account of what we consider valid arc-arc intersections). We use the ’s to instantiate equations 12 and 13 and then obtain arithmetic expressions for and (section 3.4). Each is calculated via (9): once has been derived from 11, (6) is subtracted.
and, following (9), we obtain
Furthermore , and then
Notice that, given a pair of edges , we can form a type 04 combining with or , which gives two configurations of type 04, and . For , we need both indicator variables to be for each pair of edges. However, if then it is impossible that or that .
So far we have calculated and for using arguments that can be applied to most layouts. Now we move on to for using an ad hoc approach for the spherical layout that is based on spherical trigonometry and integration over surfaces. Such surfaces are delimited by the edges that make up type (table 1).
We proceed gradually towards such aim. First, we introduce the relevant background from spherical trigonometry (section 3.1). Second, we propose a derivation for that is more detailed than that of Moon  (section 3.2). Finally, we proceed with the remainder of types of products namely , , , , (section 3.3).
3.1 Spherical trigonometry
We first recall some definitions and properties of spherical trigonometry . Henceforth, we assume a unit-radius sphere. Let , and be three points on a sphere of center , such that , and do not lie all together on a plane containing .
Points , , define a spherical triangle, denoted by , whose vertices are , and , and whose sides are the geodesics joining with , with , and with . Let , and denote the length of the sides , and , respectively (figure 2(a)).
For every point , let denote its antipodal vertex, that is, and are diametrically opposite. Thus, the segment goes through the center . Segment , the semicircle on the sphere containing , and , and the semicircle on the sphere containing , and delimit two disjoint regions on the sphere. The wedge is the one with smaller area. The angle of is the angle in defined by the planes containing the semicircles delimiting the wedge (figure 2(b)). The angles at vertices , and of a spherical triangle are the angles , and in of the wedges , and , respectively (figure 2(a)).
With this notation, the following formula relates the lengths , of two sides with the angles and of the spherical triangle
Using this equation, from the length of two sides and the angle at the shared vertex of a spherical triangle, the remaining angles can be calculated. Concretely,
Since this relation is used often in our calculations, let us define a function such that for any real numbers ,
Let denote the area of a region of the sphere of radius 1. It is well-known that the area of a wedge is , where is the angle of the wedge, and the area of a spherical triangle is , where , and are the angles at vertices , and , respectively.
3.2 The probability that two edges cross
Let , and be three fixed points on the sphere and let be a random point. The geodesic crosses if and only if lies in the spherical triangle (figure 3(a)). Hence, the probability of this occurring is the area of the spherical triangle divided by the area of the sphere’s surface,
Let denote the length of the geodesic defined by two random points on the sphere. The density function of is
Indeed, we know that and that must be proportional to the length of the circle obtained by intersecting the plane containing one of the points and perpendicular to the line that goes through the other point and the center of the sphere (figure 3(b)). Taking into account these facts, we conclude that satisfies (20).
Let be a geodesic of length . The probability that two random points lie on the different hemispheres determined by is , and the probability that the geodesic determined by two random points on different hemispheres cross a given arc of length is . Hence, the probability that a geodesic defined by two random points crosses a geodesic of length is
Hence, the probability that two random edges on the sphere cross is, as already derived by Moon (1),
3.3 The ’s and the ’s
Let be an element of type as described in table 1 (see also figure 1). Below we calculate for every . Table 4 summarizes the results on that are derived next analytically and confirms the accuracy of the results with the help of computer simulations. For a better understanding of the explanations below, we refer the reader to table 1 (where we describe the types of products following ), and figure 1 (that illustrates the graphs characterizing each type).
Recall that , , and , with pairwise distinct. The relative position of , and can be given by three independent parameters: the length of the geodesic , the length of the geodesic and the angle of the wedge (figure 4 (a)).
On the one hand, given a random point , the probability that the edge crosses the edge whenever can be derived using (19) for the triangle when , and . Besides, this probability is the same for the opposite angle . On the other hand, by (21), the probability that the edge crosses the edge of length is . Therefore,
Recall that , and , with pairwise distinct. As in the preceding case, the relative position of , and can be given by three independent parameters: the length of the geodesic , the length of the geodesic and the angle of the wedge (figure 4 (a)). Moreover, given a random point (resp. ), the probability that the edge (resp. ) crosses the edge whenever can be derived using (19) for the triangle when , and . Besides, the probability of crossing is the same for the opposite angle . Therefore,
Assume that , , and , with pairwise distinct. Similarly as in the preceding case, the relative position of , and can be given by three independent parameters: the length of the geodesic , the length of the geodesic and the angle of the wedge (Figure 4(b)). Moreover, given a random point , the probability that the edge crosses whenever can be derived using (19) for the triangle when , and . Analogously, given a random point , the probability that the edge crosses can be derived using (19) for the triangle . Therefore,
Recall that , , and , with pairwise distinct. The relative position of points , , and can be given by 5 independent parameters, , , , , and , where , and are the lengths of the geodesics , and , respectively; is the angle of the wedge ; and is the angle of the wedge , with (figure 4(c)).
Let , denote the angles at vertices and , respectively, of the spherical triangle and let , denote the angles at vertices and , respectively, of the spherical triangle . For and , given two random points and , the probability that crosses and the probability that crosses can be calculated using (19) for the triangles and , respectively. Since the probability of crossing is the same for the opposites angles of and , we derive that