multicut implementation