dyn.cross: Computation of the number of crossings in the bi-graph in a...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/dyn.cross.R

Description

dyn.cross dynamically computes the number of edge crossings for a given node ordering of both layers of the bi-graph. This ordering is given by the rownames and colnames of the matrix of weights provided as argument. The use of this function is mainly internal.

Usage

1

Arguments

weights

a matrix containing the intersection sizes (edge weights) between clusters (nodes) from the first partitioning (left or top layer of the bi-graph) and the second partitioning (right or bottom layer of the bi-graph). The rownames and colnames of the matrix provide the ordering of the nodes in the first and second layer, respectively.

Details

The number of crossings in the weighted bigraph is computed by considering multiedges between connected nodes. The specific implementation uses a modification, adapted to the case of having multiple edges, of the dynamic programming algorithm developed by Nagamochi and Yamada for counting the number of crossings in non-weighted graphs, which has reduced computational cost.

Value

crossings

the number of weighted crossings in the layout provided as argument.

Author(s)

Aurora Torrente aurora@ebi.ac.uk and Alvis Brazma brazma@ebi.ac.uk

References

Nagamochi H. and Yamada N. (2004) Counting edge crossings in a 2-layered drawing. Information Processing Letters. 91, 221-225.

See Also

barycentre, flatVSflat, flatVShier

Examples

1
2
3
4
5
# simulated data
    clustering1 <- c(rep(1, 5), rep(2, 10), rep(3, 10))
    clustering2 <- c(rep(1, 6), rep(2, 6), rep(3, 4), rep(4, 9))
    dyn.cross(table(clustering1, clustering2)) # no crossings
    dyn.cross(table(clustering1, clustering2)[c(2, 1, 3), ]) 

clustComp documentation built on Nov. 8, 2020, 5:54 p.m.