Coulomb glass or electron glass refers to a system of localized electrons interacting via unscreened Coulomb interactions. The electrons are localized on a square lattice site, and the site's energies are random. This model was mainly used to represent amorphous and compensated semiconductors at high disorders and low temperatures. Recently, the model has been used to model granular systems, an array of nanocrystals, and graphene. In this work, we have obtained the ground state of an electron glass model in two dimensions using a modified extremal optimization. The work is done for disorders less than the critical disorder and at half-filling. For this case, the ground state has anti-ferromagnetic ordering, unlike the high disorder case. This allows us to check the efficiency of our new algorithm.The results are compared with quenching using Monte Carlo simulation. In the electron glass model, the number of electrons is conserved, and the interaction is long-ranged. Extremal optimization was developed to obtain the ground state of short-ranged spin systems with a non-conserved magnetization. The algorithm was extended to find the ground state of a long ranged anti-ferromagnet with conserved magnetization. We show that the efficiency of extremal optimization is comparable to the quenching method. The efficiency for both ways decreases as the disorder is increased. The minimum energy states obtained consist of mainly two large domains when the ground state was not achieved. These meta-stable states are stable, and increasing the run time increases the efficiency only by a small amount. The stability of the domains is analyzed using an activity graph. A comparison of the activity graphs for the same disorder configuration for the two algorithms shows that the formation of a meta-stable state is a general feature independent of the algorithm used. The formation of domain states is more prevalent for specific disorder configurations. These results can be explained in terms of domain formation theory.