This paper presents a computational component designed to improve and evaluate emergency handling plans. In real-time, the component operates as the core of an Internet of Things (IoT) infrastructure aimed at crowd monitoring and optimum evacuation paths planning. In this case, a software architecture facilitates achieving the minimum time necessary to evacuate people from a building. In design-time, the component helps discovering the optimal building dimensions for a safe emergency evacuation, even before (re-) construction of a building. The space and time dimension are discretized according to metrics and models in literature. The component formulates and solves a linearized, time-indexed flow problem on a network that represents feasible movements of people at a suitable frequency. The CPU time to solve the model is compliant with real-time use. The application of the model to a real location with real data testifies the model capability to optimize the safety standards by small changes in the building dimensions, and guarantees an optimal emergency evacuation performance.