Partition #
Partition is the set of lists of natural numbers, possibly with repetitions, that split into two
sub-multisets with equal sums [Kar72]. Numbers are encoded in binary (encNat).
Appending the two numbers a.sum + 1 and 2 * t + 1 to the numbers a reduces SubsetSum to
Partition: together these two exceed half of the new total, so they lie on opposite sides of any
partition, and the side holding a.sum + 1 holds numbers of a summing to exactly t. Neither
number needs subtraction, so the reduction is defined for every target, including targets larger
than a.sum.
Main definitions #
Cslib.Complexity.Partition.Cslib.Complexity.Partition.verifier.Cslib.Complexity.SubsetSum.toPartition.
Main results #
Cslib.Complexity.mem_Partition_iff,Cslib.Complexity.mem_Partition_iff_sublist: a partition is a sub-multiset, or a subsequence, with half the total sum.Cslib.Complexity.Partition.mem_NP:Partition ∈ NP (encList encNat).Cslib.Complexity.SubsetSum.toPartition_mem_iff: correctness of the reduction.Cslib.Complexity.polyTimeReducible_SubsetSum_Partition,Cslib.Complexity.Partition_npHard,Cslib.Complexity.Partition_npComplete:PartitionisNP-complete.
References #
The verifier for Partition, a mask verifier (Cslib.Complexity.maskVerifier): the numbers
selected by the certificate mask hold half of the total sum.
Instances For
Partition.verifier verifies Partition with certificates as long as the encoded list.
The Partition verifier is polynomial-time.
Partition belongs to NP.
The reduction from SubsetSum to Partition: append a.sum + 1 and 2 * t + 1.
Instances For
Correctness of the reduction to Partition.
The reduction to Partition is polynomial-time.
SubsetSum reduces to Partition in polynomial time.
Partition is NP-complete, with the numbers in binary [Kar72].