Before revision:  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.
After revision:  Recently, two aspects of the distribution 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 that variance in arbitrary graphs and forests.