Added code that allows a graph to be randomized.