Let P(A=B) be ignored (we can say that it is evenly divided into <,> and changes them to <=,>= ).
Now let's look at a similar, but intuitively easier problem:
- find the best destination such that
P(arr[0]<arr[1])*...*P(arr[i]<arr[i+1])*...*P(arr[n-2]<arr[n-1]) is maximal. - This is a simpler problem, since now we only consider adjacent elements (and not, for example,
P(arr[0]<arr[n-1]) - we use βlessβ information. [No proof atm].
Now we strive to maximize the probability, which is equivalent to maximizing:
log{P(arr[0]<arr[1])} + ... + log{P(arr[n-2]<arr[n-1])}
Which in turn is equivalent to minimization:
-log{P(arr[0]<arr[1])} - ... - log{P(arr[n-2]<arr[n-1])}
This is a TSP with weights around the edges:
w(v,u) = -log(P(v<u))
However, TSP is NP-Complete, and if the missing evidence-based hypothesis is incorrect (still thinking about it ...) - this means that there is no known polynomial solution to this problem, or at least only elements adjacent to it.
source share