parser.add_argument("graph",help="Name of the graph to be used.",choices=['checkins-foursquare','checkins-gowalla','checkins-brightkite','friends-foursquare','friends-gowalla','friends-brightkite'])
parser.add_argument("--k",help="Percentage of nodes to be sampled. Needs to be a float between 0 and 1",default=0)
parser.add_argument("--niter",help="Number of rewiring per edge. Needs to be an integer. Default is 5",default=5)
parser.add_argument("--nrand",help="Number of random graphs. Needs to be an integer. Default is 5",default=5)
parser.add_help=True
args=parser.parse_args()
# the name of the graph is the first part of the input string
name=args.graph.split('-')[1]
if'checkins'inargs.graph:
G=create_graph_from_checkins(name)
elif'friends'inargs.graph:
G=create_friendships_graph(name)
G.name=str(args.graph)+" Checkins Graph"
# sample the graph
G_sample=random_sample(G,float(args.k))# function from utils.py, check it out there