An implementation of graph cut algorithm (Ford-Fulkerson)