Street sexual harassment is an issue impacting the safety and well-being of citizens. Such a problem is prominent in Medellin, where women repeatedly say they feel unsafe while walking. Despite the negative side effects of street harassment, the lack of algorithms that warm citizens of areas where harassment is likely to occur perpetuates people’s exposure to these situations. In this paper we present an algorithm that calculates routes based on both distance and safety in order to improve security perception, encourage walking and prevent cases of harassment. Specifically, a modified version of Dijkstra’s algorithm was used to calculate a path between two given locations, with either harassment risk or distance as an additional constraint. The algorithm was implemented with a time complexity of O((V + E)logV), and a memory complexity of O(V + E), where E represents the streets and V the intersections of Medellin’s map. The algorithm has an average execution time of 9.4 seconds. Overall, the results obtained revealed that there’s always a compromise to be made between distance or harassment risk when choosing a particular route. Specifically, the variable that is constrained in the algorithm is the one that will be prioritized in the resulting path.