graph_to_pairs#
- er_evaluation.data_structures.graph_to_pairs(graph)[source]#
Transform Graph into pairs list.
- Parameters:
graph (Graph) – igraph Graph object.
- Returns:
Membership vector
Examples
>>> from numpy import array >>> pairs = array([[1, 2], [3, 5], [6, 7], [6, 8], [7, 8]]) >>> indices = array([1,2,3,4,5,6,7,8]) >>> graph = pairs_to_graph(pairs, indices) >>> graph_to_pairs(graph) array([['1', '2'], ['3', '5'], ['6', '7'], ['6', '8'], ['7', '8']], dtype='<U1')