This +1 trick is nice as it allows using the same underlying array (0 until numNodes-1). It would be great to be consistent with the similar logic in directed graph (whichever way) where this could also be used. Alternatively, just create a new array not including lowerNode everytime as is done in the directed graph case.