What is shortest distance between 2 nodes in a matrix?

I believe what you need is the L1 distance, also called the Manhattan distance So if your two nodes have matrix indices (i1,j1) and (i2,j2) then the shortest distance between them is i1-i2|+|j1-j2 This is of course, assuming you can't move diagonally.

I believe what you need is the L1 distance, also called the Manhattan distance. So if your two nodes have matrix indices (i1,j1) and (i2,j2), then the shortest distance between them is |i1-i2|+|j1-j2|. This is of course, assuming you can't move diagonally.

I would think that the normal Pythagorean theorem would work just fine. Get the X,Y difference between where you are and where you want to go; this will give you a negative or positive value. From this you should be able to move up/down left/right as needed until you are in the same row/column.

Couldn't figure out how to get superscript; but this will work. A^2 + b^2 = c^2.

This is usually termed euclidean distance – Mitch Wheat Mar 27 at 0:26 I did not realize that the distance had a name; I merely know about the formula used to find it. Thanks for the information! – Suroot Mar 27 at 0:32.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions