hello i m facing problem to find the shortest path from node in 100 * 100 matric where sink node is at center all other nodes find the shortest path from their location to sink node i need code of this problem send code at atifaziz463@yahoo.com

21 views (last 30 days)
atif aziz
atif aziz on 6 Oct 2016
Answered: cesar silva on 29 Nov 2019
i am writing a thesis to find the shortest path. sink node is at center and all other nodes with in 100*100 sq.m will calculate the shortest path from the sink. if any one can find matlab code plz send me at atifaziz463@yahoo.com

Answers (2)

Walter Roberson
Walter Roberson on 6 Oct 2016
If this is a regular grid with no obstacles then just follow the edges towards the target.
If instead you have a set of sources that are scattered at integer coordinates within a 100 x 100 grid, such as if you are working on a wireless sensor network, then you need to define the rules about which nodes are connected and the cost of connecting. If you are working on a wireless sensor network then the best path for any one node to transmit in isolation to reach the sink is not the best approach to take if all of the nodes need to communicate with the sink within a short time, because some of the links would get clogged. Just like with a traffic jam, sometimes you can get somewhere faster by taking a longer route that is in less demand.
  12 Comments

Sign in to comment.


cesar silva
cesar silva on 29 Nov 2019
EVEN ITS AN OLD POST, SOMEONE ELSE MAYBE COMES HERE LOOKING FOR A HELP... HERE IT IS:
DESCRIPTION OF THE CODE AVAILABLE IN GITHUB LINK ABOVE:
1) you can choose node number (nodeNo parameter)
2) you can choose node signal range (range parameter - Its a 1x1 Kilometer area, algo range in meters)
3) once network nodes position randomly formed and all nodes neighbors by radius (range) criteria...
3.1) Shorthestpath nodes discovered between node 1 (sender) and node 2 (receiver) start energy consumption due routing (forward) task...
3.2) As soon 1 node dies, current route becames "useless"
3.3) New shortest path is discovered... (restart 3.1 till no more routes available)
4) I assume that every energy consumption loop is 1 packet transmittion
5) At the end, it "reports":
5.1) All routes discovery events from the begging till the end of network (no more routes)
5.2) hop count of each route iteration
5.3) Nodes involved (In the same order they are met in route)
5.4) Hypothetical packets transmitted
5.5) Dead node number (ID) every iteration
6) It also plots the original WSN
7) ALso plot every routing loop result and report
8) Mark all nodes involved ini each route event
9) Mark all dead nodes
10) Write reports to an external file into same folder the main.m file is
I hope it helps some one....

Products

Community Treasure Hunt

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

Start Hunting!