The growth of small communication devices has pushed designers to design compact-size antennas. These antennas must be low cost, lightweight, needed for mechanically robust construction, and ease of installation. In this paper, we use a novel genetic algorithm (GA) to produce an ensemble of compact self-avoiding (SA) antennas such that the voltage standing wave ratio (VSWR) is less than 2 at the desired frequencies (as a measure of efficiency); an optimization criterion to get a desirable multiband antenna in the ultra high frequency (UHF) band. First, the electromagnetic properties of these antennas are simulated using the method of moments in MATLAB. SA antennas form a particular set of dipoles introduced here by applying a novel backtracking algorithm. We also use a Lindenmayer system that generates the geometries by a Turtle graphics render to reach our goal. Next, we simulate the VSWR for 150,000 SA antennas with lengths L from 0.1 to 0.4 m; 10 different frequencies are chosen randomly within the UHF band to obtain our results. All the VSWR ≤ 2 are clustered using density-based spatial clustering of applications with noise algorithm (DBSCAN), so our method provides the frequency ranges where this condition is fulfilled. From this, we obtain the VSWR minimums used for the antenna design. Finally, as an instance, we use our results to select the appropriate size of a multiband antenna and, through genetic algorithms, modify the geometry to satisfy the design requirements.