During an underground mine fire, the presence of smoke and toxic gasses, low visibility, and changes in the ventilation system will make it extremely difficult to identify evacuation measures and optimum path to safety. This paper presents an algorithm for solving minimum cost flow network problem (MCFNP) for fire evacuations considering the distribution of toxic gasses inside the mine in real-time. The proposed algorithm will identify the optimum evacuation paths requiring minimum decision-making time. The algorithm holds data in nodes and arches accumulating values at each iteration, updating the network depending on the mine conditions. To achieve this, a fire simulation was performed in VentSim software to extract the air quantity, gas concentrations, visibility, and changes in the ventilation system data throughout the incident zone. The presented algorithm finds the evacuation paths improving time-response and comparing the decision-making of miners in a successful evacuation. The prediction of concentration of toxic gases, recommends safety path, avoids exposure to the danger zone despite the presence of shortest-path and road capacity toward surface or refuge chamber.