The interest in spatial networks where vertices are embedded in a one-dimensional space is growing. Remarkable examples of these networks are syntactic dependency trees and RNA structures. In this setup, the vertices of the network are arranged linearly and then edges may cross when drawn above the sequence of vertices. Recently, two aspects of the distribution of the number of crossings in uniformly randomlinear arrangements have been investigated: the expectation and the variance. While the computation of the expectation is straightforward, that of the variance is not. Here we present fast algorithms to calculate that variance in arbitrary graphs and forests. As for the latter, the algorithm calculates variance in linear time with respect to the number of vertices. This paves the way for many applications that rely on an exact but fast calculation of that variance. These algorithms are based on novel arithmetic expressions for the calculation of the variance that we develop from previous theoretical work  .
The crossing number, i.e. the minimum number of edge crossings arising when drawing a graph on a certain surface, is a very important problem of graph theory. The opposite problem, i.e. the maximum crossing number, is receiving growing attention. Here we consider a complementary problem of the distribution of the number of edge crossings, namely the variance of the number of crossings , when embedding the vertices of an arbitrary graph in some space at random. In his pioneering research, Moon derived that variance on random linear arrangements of complete unipartite and bipartite graphs. Given the need of efficient algorithms to support this sort of research and given also the growing interest of the number of edge crossings in spatial networks, networks where vertices are embedded in some space, here we derive algorithms to calculate the variance in arbitrary graphs in o(nm^2)-time, and in forests in O(n)-time. These algorithms work on a wide range of random layouts (not only on Moon's) and are based on novel arithmetic expressions for the calculation of the variance that we develop from previous theoretical work . This paves the way for many applications that rely on a fast but exact calculation of the variance .
R
interest in spatial networks where vertices are embedded in a one-dimensional space is growing. Remarkable examples of these networks are syntactic dependency trees and RNA structures. In this setup, the vertices of the network are arranged linearly and then edges may cross when drawn above the sequence of vertices. Recently, two aspects of the distribution
crossing number, i.e. the minimum number of edge crossings arising when drawing a graph on a certain surface, is a very important problem of graph theory. The opposite problem, i.e. the maximum crossing number, is receiving growing attention. Here we consider a complementary problem of the distribution of the number of edge crossings, namely the variance
R
in uniformly randomlinear arrangements have been investigated: the expectation and the variance. While the computation of the expectation is straightforward, that of the variance is not. Here we present fast
, when embedding the vertices of an arbitrary graph in some space at random. In his pioneering research, Moon derived that variance on random linear arrangements of complete unipartite and bipartite graphs. Given the need of efficient algorithms to support this sort of research and given also the growing interest of the number of edge crossings in spatial networks, networks where vertices are embedded in some space, here we derive
R
that
the
R
and forests. As for the latter, the algorithm calculates variance in linear time with respect to the number of vertices. This paves the way for many applications that rely on an exact but fast calculation of that variance. These algorithms
in o(nm^2)-time, and in forests in O(n)-time. These algorithms work on a wide range of random layouts (not only on Moon's) and
A
. This paves the way for many applications that rely on a fast but exact calculation of the variance