greenelab / connectivity-search-analyses

hetnet connectivity search research notebooks (previously hetmech)
BSD 3-Clause "New" or "Revised" License
8 stars 5 forks source link

Hetnet permutation via adjacency matrices #46

Closed dhimmel closed 7 years ago

dhimmel commented 7 years ago

In, the past, we've permuted hetnets via the hetio package. We have also explored a Cypher implementation. The method we use is called XSwap as described in:

Randomization Techniques for Graphs Sami Hanhijärvi, Gemma C. Garriga, Kai Puolamäki (2009) Proceedings of the 2009 SIAM International Conference on Data Mining. doi:10.1137/1.9781611972795.67

XSwap randomly selects pairs of edges and attempts to switch the endpoints. The result is a network with degree preserved but relationships randomized. To extend this concept to hetnets, we separately permute each relationship. So I think we could implement hetnet permutation on the adjacency matrices. This may be a bit faster than the hetio implementation.

I believe this paper describes the edge swap technique for matrices:

A Ramachandra R, Rabindranath S (1996) A Markov Chain Monte Carlo Method for Generating Random (0, 1)-Matrices with Given Marginals. Sankhya Indian J Stat Ser A 58: 225–242. https://www.jstor.org/stable/25051102

Anyways, @kkloste do you think there's an easy matrix implementation of XSwap?

See also (related literature):

kkloste commented 7 years ago

Recording here our recent discussion online: there is no benefit to be gained from converting a graph to a matrix for the purposes of this edge swapping operation

dhimmel commented 7 years ago

there is no benefit to be gained from converting a graph to a matrix for the purposes of this edge swapping operation

Good to know. Will close this issue.