Substructuring in the finite element method is a technique that reduces computational cost and memory usage for analysis of complex structures. The efficiency of this technique depends on the number of substructures in different problems. Some subdivisions increase computational cost, but require little memory usage and vice versa. In the present study, the cost functions of computations and memory usage are extracted in terms of number of subdivisions and optimized mathematically. The results are presented in the form of tables which recommend the proper substructuring for different number of elements. A combined case is also considered which investigates balanced reduction of computational and memory cost for 2D problems. Several numerical examples are analyzed numerically to demonstrate the abilities and efficiency of the proposed computational algorithm for structured and unstructured mesh.