If I have a graph looking something like this
0 - 1 - 2
........|......|
.......3.....4
...............|
...............5
Note: dots have no function, and line represent edges
and I have an adjacency matrix for that graph,how do I know only from using that matrix if there is a node,for example right from node 4?
What I have tried:
If there is a conection between nodes where their number difference is more then 1,I should know that a the node is above or below the given node.In the example I have given, 2 is connected to 4,and their number difference is 2,soo 4 has to be below 2.But node 4 and 5 are a problem I don't know how to solve.