Breast cancer is one of the most mediated malignant diseases, because of its high incidence and prevalence, but principally due to its physical and psychological invasiveness. The study of this disease using computer science tools resorts often to the image segmentation operation. Image segmentation, although having been extensively studied, is still an open problem. Shortest path algorithms are extensively used to tackle this problem. There are, however, applications where the starting and ending positions of the shortest path need to be constrained, defining a closed contour enclosing a previously detected seed. Mass and calcification segmentation in mammograms and areola segmentation in digital images are two particular examples of interest within the field of breast cancer research. Usually the closed contour computation is addressed by transforming the image into polar coordinates, where the closed contour is transformed into an open contour between two opposite margins. In this work, after illustrating some of the limitations of this approach, we show how to compute the closed contour in the original coordinate space. After defining a directed acyclic graph appropriate for this task, we address the main difficulty in operating in the original coordinate space. Since small paths collapsing in the seed point are naturally favored, we modulate the cost of the edges to counterbalance this bias. A thorough evaluation is conducted with datasets from the breast cancer field. The algorithm is shown to be fast and reliable and suffers no loss in resolution.