Simpler implementation of sparse graphs