1- Use juypter and networkx to create n nodes (i.e. 200 nodes). Then deployed them randomly in x * y feet area (i.e 1000 * 1000 feet area, customizable). Figure 1 in the attachment.
2- Fix the position of the nodes, then a node is connected via links/edges to its neighbors based on a given radius R (i.e. the node is connected to its neighbors within a radius of 100 feet). The color of the links/edges should be black in this step.
3- Generate a pool p that holds values from [1,p] (i.e. p is an array that holds values from 1 to 10000, the values in p must be randomly distributed such that p(1,643,2,44,5,6,438,…) )
Then each node should random pick values v from p (i.e. if v = 150, then each nodes should randomly pick 150 values from p, v(2,66,522,…) )
4- The node checks its neighbor that it is connected to in step 2. if the node found a shared value with its neighbor, then it should change the link/edge color from black to green. if there is no shared value the link/edge should become red
5- Create a function that take random number of nodes to remove, but keep other nodes in their positions, then do step 4 to see the new links/edges.
Please use python3 and document the code. Thank you