Account for sparse vertex lists

Because any vertex may be removed from the graph at any time, the array
that describes the vertex-to-index mapping may be sparse. Generate an
array with nil values in place of removed vertices.