graph min cut unoptimized