It is run as follows:
java RandomGraphGenerator NUMBER_OF_VERTICES AVERAGE_OUTDEGREE
When called like this, it assumes a graph with vertices numbered from 0 to (NUMBER_OF_VERTICES - 1). It then generates floor((NUMBER_OF_VERTICES * AVERAGE_OUTDEGREE)) random edges, by randomly selecting a source vertex, then a target vertex, and repeating that process if that given edge already exists in the graph.
Here's the source: RandomGraphGenerator.java
Please feel free to use this in any way you see fit.
No comments:
Post a Comment