Connected Action

Sociology and the Internet, Social Media, Networks and Mobile Social Software

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:


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.

2013-03-03-NodeXL-Random Network Edges

When you show the graph, you may get a network visualization that looks somewhat like this:2013-03-03-NodeXL-Random Network Edges Visualization

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