In this paper, two automatic mesh generation algorithms are presented. The methods seek to optimize mesh density with regard to geometries exhibiting both fine and coarse physical structures. When generating meshes, the algorithms attempt to satisfy the conditions on the maximum mesh spacing and the maximum grading ratio simultaneously. Both algorithms successfully produce non-uniform meshes that satisfy the requirements for finite-difference time-domain simulations of microwave components. Additionally, an algorithm successfully generates a minimum number of grid points while maintaining the simulation accuracy.