Dinitz'a algorithm