how to find nearest node in random wireless sensor network for 100 nodes 100*100 area...plz help

1 view (last 30 days)
in a random sensor network 100 nodes are there.. how to find nearest node for n1, nearest node for n2....provided if n10 is the nearest node of n1 then it never bea again nearest of any other...plz help me

Answers (1)

Walter Roberson
Walter Roberson on 31 Jan 2014
Find the distance from each node to every other node, and sort() the result recording the indices (the two-output version of sort). Be careful about the distance of nodes to themselves.
Yes, there are probably more efficient methods. Or at least methods that use less memory. In particular... http://www.mathworks.com/help/matlab/ref/voronoi.html -- though at the moment I do not see any convenient routine to determine which voronoi cell a particular point is in.

Categories

Find more on Voronoi Diagram in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!