# Java Job by zweil81

Budget $80 USD

This is a small project. I think it should take upto 15 hrs.. Please go through the project description below. You can feel free to ask questions you have. I want this project by October 13 th.

Programming Project Description:

Network Model. The sensor network is represented as a graph G(V,E), where V = {1, 2,

..., N} is the set of N nodes, and E is the set of edges. The sensor nodes are randomly

generated in an x by y area. All the sensor nodes have the same transmission range Tr,

that is, if the distance between two nodes are less than or equal to Tr, then they can

communicate directly and are connected by an edge.

Out of N nodes p of them are ramdomly selected as storage-depleted data generating

nodes, called data geneators, DG = {DG1, DG2, ..., DGp}, where DGi has si data items to

offload. Each data is of 400 bytes. We assume that each DG has zero storage capacity,

while sensor node i has storage capacity mi bytes. All the data items at the DGs must be

offloaded to other sensor node with storage space.

Energy Model and Network Lifetime. Each sensor node i has an initial energy Ei

Joule (J). We adopt the first order radio model: for k -bit data transmitted over distance

l, the transmission energy (on the transmitter side) is ET (k, l ) = Eelec k +Eamp k l2 , and

the receiving energy (on the receiver side) ER (k ) = Eelec k . Here Eamp = 100 pJ/bit/m2

caculates the energy consumpation on the transmit amplifier for one bit. Eelec =

100nJ/bit is the energy consumpation per bit on the transmitter circuit and receiver

circuit.

Programming Project Objective:

Objective 1: Genearate the sensor network and test if it is connected. If it is connected,

find the energy consumption to send a data from one node u to another node v, using a

shortest path (in terms of energy consumption) between them.

Objective 2: Obviously, with the increase of Tr, the minimum number of nodes that

need to be generated to ensure the network is connected is decreasing. Denote this

minimum number of nodes to be Nmin, draw a plot to show the relationship between Nmin

and Tr.

Also --> Can you mathematically represent this relationship using an

equation (with some help from your statistics knowedge)?

Format required for testing:

When executed the program should prompt to ask

1. the width x and length y of the network (lets use 50m x 50m by default)

2. number of sensor nodes: N

3. transmission range Tr

4. number of DGs: p, number of data items each DG has: q

5. storage capacity of each non-DG: m; obviously, pq <= (N-p)m

6. the range of the initial energy of all the sensor nodes: [a, b], which means the

initial energy of each sensor node is a random number between a and b (for

simplicity, initially you can assign the same eneryg level to all nodes)

The output of the program should

1. Plot the sensor network field, with all the sensor nodes (including the Dgs)

2. Output whether the network is connected or not

3. If it is connected, ask for input of two nodes u and v, output the energy

consumption of sending a data from u to v using the shortes path between them.

4. For a pair of (N, Tr), the program should show whether the generated sensor

network is connected or not. Obviously, with the increase of Tr, the minimum

number of nodes that need to be generated to ensure the network is connected is

decreasing. Denote this minimum number of nodes to be Nmin, draw a plot to

show the relationship between Nmin and Tr. Can you mathematically represent it

using an equation (with some help from your statistics knowedge)?

5. When selecting Tr, you should use BFS/DFS to make sure your network is

connected

Handling Instructions:

"Objective 1: find the energy consumption to send a data from one node u to another node v, using a shortest path (in terms of energy consumption) between them". A little clarification here: this shotest path has to start from a DG node and end with a non-DG node (or the destination node), because only DG has data to send, which incurs energy. Besides finding the shortest path in terms of energy consumption, you need to find two more kinds of shortest path: 1) for _any_ two nodes u and v, the shortest path between them in terms of number of edges; 2) for _any_ two nodes u and v, the shortest path between them in terms of sum of length of the edges. Then answer the following question: for any DG node u and non-DG node v, are these three shorest paths between u and v always the same path?

b: For Objective 2, keep network size as 50x50 (we can change this in later projects), increase Tr from 1, 3, 5, 7, 9, 10, 15, 20, 30, 40, 50, and find the minimum number of nodes N_{min} that ensures the network to be connected, and draw a plot between N_{min} and Tr. Here, please show a visual plot for each Tr.

c." For storage capacity of each non-DG: m; obviously, pq <= (N-p)m". Here, please set m as 512K bytes, which is the typical flash memory size for a real sensor. Since each data is of 400 bytes, and network size is 50x50=2500, above becomes pqx400 <= (2500-p)x512x1000, and the values of p, q you test should satisfy this inequality.

d. For the output of your program, therefore it should prompts which kinds of shortest path (one of those three above) the user wants to use: if user choose to find energy consumption one, your program should tell the user who are those DG nodes, so the user knows to select a DG to finds its shortest path (in terms of energy consumption) to others

e. Handing, besides what's been asked, for each N_{min}, please accompany a visual plot of the sensor network

f. I put the question 'Can you mathematically represent the relationship between N_{min} and Tr using an equation',