Searching For The Optimal Control Strategy Of Epidemics Spreading On Different Types Of Networks