Creates graph adj list and dumps to json on ctrl-c