Topology is an important prior in many image segmentation tasks. In this work, we design and implement a novel graph-based min-cut/max-flow algorithm that incorporates topology priors as global constraints. We show that optimization of the energy function we consider here is NP-hard. However, our algorithm is guaranteed to find a local optimum (in a relaxed dual sense) that conforms to the initia