Draw random graph from adjacency matrix

92 Views Asked by At

In a circular area of radius $25$ miles, $32$ nodes are randomly placed. The distance $d$ between each pair of nodes can be the following:

  1. $R_1 ~: 0 < d \leq 5$ miles
  2. $R_2 ~: 5$ miles $< d \leq 10$ miles
  3. $R_3 ~: 10$ miles $< d \leq 15$ miles
  4. $R_4 ~: 15$ miles $< d$

Adjacency matrix $A$ is a $32\times32$ symmetric matrix with elements $a_{i,j}$ quantifies the relative distance between node $i$ and node $j$ and can take the following values:

  1. if $d \in R_1 ~: a_{i,j}=1$
  2. if $d \in R_2 ~: a_{i,j}=2$
  3. if $d \in R_3 ~: a_{i,j}=3$
  4. if $d \in R_4 ~: a_{i,j}=0$
  5. and $a_{i,j}=0$ for $i=j$

An example of this adjacency matrix is as follows:

image1

Given such a matrix is there a simple algorithm to get random coordinates of all the $32$ nodes? I want to place all the nodes inside the circular region shown in the figure:

image2

Thanks in advance for the help!