[algos] add min cut implementation