A Sequential Algorithm for Generating Random Graphs