This paper presents a computational componentdesigned to improve and evaluate emergency handlingplans.In real-time, the component operates as thecore of an Internet of Things (IoT) infrastructureaimed at crowd monitoring and optimum evacuationpaths planning. In this case, a software architecturefacilitates achieving the minimum time necessary toevacuate people from a building.In design-time,the component helps discovering the optimal buildingdimensions for a safe emergency evacuation, evenbefore (re-) construction of a building. The space andtime dimension are discretized according to metrics andmodels in literature. The component formulates andsolves a linearized, time-indexed flow problem on anetwork that represents feasible movements of people ata suitable frequency. The CPU time to solve the modelis compliant with real-time use. The application of themodel to a real location with real data testifies the modelcapability to optimize the safety standards by smallchanges in the building dimensions, and guarantees anoptimal emergency evacuation performance.