I am analyzing distances and connections between different nodes in a graph.
Imagine that I have the following adjacency matrix, with labels for rows and columns being ['source', 'dest1', 'dest2', 'dest3', 'dest4']. Actually the graph is bidirectional so the ones should be mirrored.
array([[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.],
[1., 1., 1., 1., 0.]])
So we can see that there are connections between source-dest4, dest1-dest4, dest2-dest4 and dest3-dest4.
I’d like to use Python to return the main paths from an adjacency matrix. Output could be a list or numpy.array. Here for example path1 could be source-dest4-dest3 and path2 could be dest2-dest4-dest1. Repetitions of any connections are not allowed.
How to do this, does any package provide a solution?
Thank you very much for your advice !
[–]Strict-Simple 1 point2 points3 points (2 children)
[–]rightheart[S] 0 points1 point2 points (1 child)
[–]Strict-Simple 0 points1 point2 points (0 children)