changes graph to use a slice for edges instead of a map. should cut down on memory usage