Non-orthogonal multiple access (NOMA)-assisted 5G wireless communication networks in uplink and downlink transmissions can provide high demands of low latency, high data rate, massive connectivity, and high access speed without compromising security. Algorithms to produce minimal coherence (cross-correlation) codebooks are desired in various applications. The authors built an algorithm capable of generating complex NOMA spreading codes based on the equiangular tight frame (ETF) method. Execution time is one of the computer sciences terms that refer to the various stages of running software programs and determining the performance of programs. The created algorithm was reasonably fast to find enough NOMA spreading codes that have the minimum cross-correlation. It modified the initial value with the algorithm to reduce the execution time and generate complex value-spreading codes. This algorithm achieved the optimal cross-correlation for multiple access and implemented the lowest running time compared to the "best complex antipodal spherical code" (BCASC) method, the "approximate nearest neighbors’ best complex antipodal spherical code" (ANN BCASC) method, the method of constructing packing in Grassmannian manifolds via alternating projection, the method of constructing packing in Grassmannian manifolds via sequential smooth optimization, the "coherence-based Grassmannian codebook" (CBGC) method, the “Grassmannian package” method, the “original best complex antipodal spherical code" (ORIG-BCASC) method, and the "Grassmannian package" method. The algorithm achieved optimal coherence (maximum cross-correlation) for matrix dimension (m, n), where m, n denotes the size of the collection set of vectors in the frame. The optimal coherence (maximum cross-correlation) is 0.4472 for (3, 6), 0.4714 for (3, 7), 0.3536 for (4, 7), 0.3780 for (4, 8), 0.4472 for (4, 16), 0.3333 for (5, 10), 0.3464 for (5, 11), 0.4082 for (5, 25), 0.2500 for (6, 9), 0.2887 for (6, 11), 0.3015 for (6, 12), and 0.3333 for (7, 28) with an enhancement the parameters number of iterations and tolerance value in time less than one second. Moreover, superior to the “Grassmannian package” method in execution time, the execution time for the BCASC, CBGC, and ORIG-BCASC methods was more than one second. The simulations verified the uplink spectral efficiency and total capacity rate after applying the spreading codes generated from the suggested algorithm. In conclusion, the proposed algorithm creates complex matrices that achieve minimal coherence (maximum cross-correlation) at the least running time.