We have developed an inversion approach based on particle swarm optimization (PSO) for 2D direct current resistivity data. Once the PSO algorithm is implemented, cost-function changes on constraints and misfit criteria can be easily performed and an approximate invariance of the Lagrange multipliers is obtained if each term of the cost function is properly normalized. More importantly, the interpreter can divide the mesh into partitions and apply a different constraint or combination of constraints in each partition. We explore several restrictions on the log-resistivity variation, either in single or in joint versions, including spatial continuity constraints in the -and -norms, total variation, sparsity constraints using the discrete cosine transform and Daubechies bases, and minimum moment of inertia constraints to impose concentration of resistive or conductive materials along target axes. In the latter case, the earth surface might be used also as a target axis. In addition, the final state of the PSO algorithm, once a stopping condition has been reached, contains not only the best solution but also a cluster of good suboptimal solutions that can be used for uncertainty analysis. As a result, the interpreter has the flexibility to perform an interpretation process based on a feedback trial-and-error inversion approach, in a similar manner that he/she has when using a friendly forward modeling software. The interpreter can then drive the tentative solutions obtained along the inversion process to incorporate their conceptions about the geologic environment, besides appraising misfit and stability of the solutions. We evaluate synthetic and field data examples. In the first case, we determine how the interpreter can drive the inversion process in a karst environment to image dissolution features. In the second case, we explore a similar situation aiming to optimize borehole locations in fracture zones in crystalline rocks.