A simple min cut algorithm