## How to create a random network in NodeXL

#### March 3rd, 2013 by Marc Smith · 2 Comments

It can be useful to create networks randomly to use as training data sets. A simple way to create a random network is to use the Excel RAND() function. To create a random network of ten nodes use the following formula in a ten by two array:

**=INT(RAND()*10)**

the “**INT**” part removes the decimal places, leaving an “*Integer*” whole number value.

Then copy the grid of Random Value 1 and Random Value 2 to the Vertex1 and Vertex 2 columns (starting in A3) (use Paste Values to just get the current values of the random number generator!). You can control the number of edges by copying the formula to as many rows as you want. You can control the number of nodes by changing the value the random result is multiplied by. The current formula multiplies by ten, creating up to 10 vertex values (after being reduced to an integer). Increase this value to 100 for that many different nodes. You could get much more sophisticated, creating weighted probabilities for each vertex to appear, but this is a first, simple way to “just get a network data set” fast.

When you show the graph, you may get a network visualization that looks somewhat like this:

**Tags:** Network data providers (spigots) · NodeXL · Social Network Analysis · Social Theories and concepts · User interface · Visualization

## 2 responses so far ↓

1

James Cook// Mar 3, 2013 at 8:34 amJames Cook liked this on Facebook.

2

sherryemery// Mar 3, 2013 at 8:49 amSo much to learn about! RT “@marc_smith: How to create a random network in NodeXL using an Excel formula – http://t.co/cBetQei5bn”

## Leave a Comment