how to select the gateway node closest to the cluster head node using dijkastra algorithm
4 views (last 30 days)
Show older comments
let us suppose there is 'n' cluster head nodes with there respective positions and id's and 10 gateway nodes are present randomly.....i want to search closest gateway node to each cluster head so that CH may sends its data to the nearest gateway........................plz reply me
0 Comments
Answers (2)
KSSV
on 24 Nov 2016
doc knnsearch....with the help of knnsearch you can get the nearest neighbours.
0 Comments
Walter Roberson
on 24 Nov 2016
Dijkstra's algorithm is only for the case where something is to travel from node to node to node, passing through as many nodes as necessary to keep the cost as low as possible.
That is not the situation that you have. You have divided into clusters and each node in the cluster is permitted to send only to the cluster head, and the cluster head is to send directly to nearest gateway node even if sending to a bunch of intermediate hops would be less costly.
With that kind of set up all your cluster heads need to know is their own coordinates, and the coordinates of each of the gateways, and the formula for calculating the cost of transmission given coordinates (which might well come down to standard euclidian formula, but not necessarily. For example in fog, attenuation is faster than just the square of the distance.)
4 Comments
Walter Roberson
on 25 Nov 2016
It depends on how you model transmission costs.
In the ideal free-space (air, no obstacles) case with undirected antennas, power required to transmit a message increases with the square of the distance, so you can use the square of the euclidian distance to estimate the power. For relative comparisons to know which is going to be least costly you can use plain euclidian distance in such a model. When every node can transmit as effectively to every other node, sending directly is never more expensive of total energy compared to using shorter hops.
However, in real sensor networks you do have obstacles and so the cost of sending point to point can be much higher than the cost of using hops.
Also when I say that the total cost will not be higher for going direct (in the no-obstacles model) this does not take into account that if you keep sending by way of the cluster heads directly, that they are going to be depleted of stored energy faster than the other nodes. Either you need to keep redesignating cluster heads so none run out quickly, or else you need to switch transmission strategies.
The argument about the total energy not being higher for sending point to point from cluster heads to the gateway nodes also means that the total energy could potentially be even lower if every node transmitted directly to a gateway node instead of going first to a cluster head.
This argument does imply that each node can directly reach each gateway just by raising transmission power, which is not correct: transmission power is limited by law and by physical limitations. So you have to know which nodes are within effective range of the gateways, and any node that is not in range has to relay through one that is in range. But that applies to cluster heads as well: you cannot guarantee that a cluster head will be within effective range of the closest gateway, so you really should be planning a relay system anyhow. And that relay system might involve dijkstra's algorithm.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!