HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Finding all additive orders

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
additiveallordersfinding

Problem

Suppose there are $m$ items, and each item has a price. We order the subsets of items according to their price. For example, if the price of $x$ is 1 and the price of $y$ is 2, then the order is:

$$
\emptyset Note: I asked a similar question in math.SE, but the answer is apparently incorrect.

Solution

One approach is to recursively extend prefixes of the order. At each recursive call, we have a prefix $\phi$ of the order. We go over all remaining subsets, and for each subset $S$, we check whether the order $\phi B$ by $A \geq B+1$ (since LPs don't have strict constraints).

There are many optimizations which can be done here. For example, $S$ is always inclusion-minimal among the remaining subsets. Another optimization is to assume that the weights are ordered in a specific way (in your example, $x < y < z$); if you are really interested in all possible orders, you can always go over all permutations later.

Context

StackExchange Computer Science Q#80476, answer score: 4

Revisions (0)

No revisions yet.