Optimization of grid design for solar cells