Click here to Skip to main content
14,266,194 members
Rate this:
Please Sign up or sign in to vote.
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100