How can I Position N nodes in WSNs which are distributed uniformly at random in a grid of a certain size?

3 views (last 30 days)
N=number of nodes,
observation field of size=(100*sqrt(N)*100*sqrt(N)),
divide the field into sqrt(N)*sqrt(N) grid of square areas,
put a sensor uniformly at random inside these squares.

Accepted Answer

Walter Roberson
Walter Roberson on 1 Feb 2017
Edited: Walter Roberson on 2 Feb 2017
consider:
P = ceil(sqrt(N));
[X, Y] = ndgrid(0:P-1);
RX = 100*(rand(P,P) + X);
RY = 100*(rand(P,P) + Y);
scatter(RX(:), RY(:))
xticks(100*(0:P))
yticks(100*(0:P))
grid on

More Answers (2)

sn at
sn at on 2 Feb 2017
And I have one more question please, The distance between each two nodes should not be more than d_max, in order to have a connected WSN. How to involve this?
  2 Comments
Walter Roberson
Walter Roberson on 2 Feb 2017
You need to define that more clearly.
The maximum maximum possible distance between nodes in the above is 100*P*sqrt(2), and the minimum maximum possible distance between two nodes in the above is 100*(P-2)*sqrt(2). Those are calculations from the bottom left to top right corner (or top left to bottom right corner). Do all nodes need to be able to transmit directly to each other?
If all nodes do not need to be able to transmit directly to each other, then if d_max >= 100*sqrt(2) then the "pigeon hole principle" guarantees that every node will be within that distance of at least two other nodes and guarantees that you cannot end up with disconnected partitions of the network.
I am still working out what the conditions are that would guarantee that a chain could not be made.
One of the questions that I have is what the rules are if N is not a perfect square?
For example if N = 54 then the area as a whole has to be 100 * sqrt(54) by 100 * sqrt(54), the sides of which are irrational in length. If we suppose that it has to be done as full units, then that would be either 734 or 735 units per side, depending on whether you are required to round down or round up. Supposing we round down, then we would have a square 734 x 734, and we would be required to divide this into a sqrt(54) x sqrt(54) grid of tiles. What does it mean to have 7.348... squares per side? If we assume rounding down again then that would be 7, so that would require that each cell be (734/7) = 104.857... units on a side. If we round that down too to 104, then 7 of those would only get you to 728 wide when you need 734 wide...
It would seem morally that the point is to put N sensors randomly into a square grid, but when you start getting into the reality that you cannot build in terms of irrational units, if you assume unit intervals, you can only get floor(sqrt(N))^2 or ceil(sqrt(N))^2 sensors; for N = 54 that would correspond to either 49 or 64 sensors.
I think the "100" factor is doing the equivalent of saying that you can build out to two decimal places; if so then floor() in various places are justified.
But much easier for calculation purposes would be if we could get a declaration that N will be a perfect square.
sn at
sn at on 2 Feb 2017
Edited: sn at on 2 Feb 2017
The maximum distance between a pair of sensors residing in the vertically or horizontally adjacent grids is d_max. In other words two sensors are able to communicate if the distance between them(d_ij) is less than d_max. How to put this into account? and for N, the values that I will use are N=9, 16, 25 which are perfect squares.

Sign in to comment.


sn at
sn at on 2 Feb 2017
Edited: sn at on 2 Feb 2017
How to label other nodes to be able to calculate the distance between them (d_ij) and compare each pair's distance with d_max?

Categories

Find more on WSNs 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!