Jan-18-2020, 12:04 AM
Greetings Community,
I have a dictionary and an adjacency matrix looking as follows:
dict: {0: (171,331, 1: (168,358), ...} (a list of vertices with coordinates)
adjacency matrix: 2d array which only contains zeros and ones for connected (1) or unconnected (0)
The two structures are connected in a way that the order of the adjacency matrix is equal to the enumeration of the dictionary.
Now I would like to be able to remove all isolated vertices (where row/column only contains zeros) from the adjacency matrix and also from the dictionary.
Is there a way to do this properly in python? Would you recommend a different data structure in python?
I have a dictionary and an adjacency matrix looking as follows:
dict: {0: (171,331, 1: (168,358), ...} (a list of vertices with coordinates)
adjacency matrix: 2d array which only contains zeros and ones for connected (1) or unconnected (0)
The two structures are connected in a way that the order of the adjacency matrix is equal to the enumeration of the dictionary.
Now I would like to be able to remove all isolated vertices (where row/column only contains zeros) from the adjacency matrix and also from the dictionary.
Is there a way to do this properly in python? Would you recommend a different data structure in python?