A modified version of the double_edge_swap function in NetworkX to preserve the bipartite structure of the graph.
For more details on this function, please see the original NetworkX function that I shamelessly used to make this one. The only major change here is that I ensure that u,v and x,y are of the same type (i.e. genes or patients).
Parameters: |
|
---|---|
Returns: | Bipartite graph G (modified in place). |
See also: permute_mutation_data().