The 5G technologies are aimed to support a variety of vertically connected applications with heterogeneous devices and machines with significant improvements in terms of higher quality of service, increased network capacity and improved system throughput. However, 5G systems still face a number of challenges mentioned by researchers and organizations, and among these challenges, we highlight that millimeter wave links are very susceptible to blockage. If the line-of-sight communication path is blocked, reflexive path communication can help maintain communication. The shortest route was to take an alternate route when the first route was blocked. Among the proposed solutions to the blocking problem is an algorithm to distribute the power between different mmWave communication paths in order to overcome the masses of links under randomly distributed obstacles. The problem has been resolved with an exact method. In this article, we have optimized all the results of this exact method by applying a powerful metaheuristic technique called jellyfish search optimizer to maximize the overall capacity of the path between two nodes. The results showed that our approach procures an improvements exceed 100% over the results of the exact method.