Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900