Lima is a city of 10 million inhabitants, and 60% of its population lives in slums settlements. Due to its location in the Circum Pacific Belt of Fire, this is a high-seismic activity area. Despite this fact, there is a serious lack of urban planning and natural disaster planning. El Progreso sector located in Carabayllo, a Lima district in Peru, was selected as the case study because it is one of the slum settlements with the highest potential risk as it is located in a basin surrounded by hills due to the effects of informal constructions (such as ceilings). Filled with rocks and walls, their slopes have suffered much more deterioration than in other hillsides. In addition, this area is prone to debris avalanches, rock fragments, debris flows, among other geologic hazards. The proposal presents a mathematical model based on analyze a risk function through inhabitants' time evacuation, which may replicate in different urban context in real time in order to guide and ensure the most efficient evacuation.