Let's say I have two sets: (n_1, n_2, ...) and (m_1, m_2, ...) and a matching match (n, m) function that returns a value from 0 to 1. I want to find a match between two sets so that the following restrictions are met:
- Each element must have at most 1 matched element in the opposite set.
- Unmatched items will be connected to the dummy item at a cost of 1
- The sum of the matching function when applied to all elements as much as possible
- I am having trouble expressing this formally, but if you built each set parallel to each other with their original order and drew a line between the matched elements, none of the lines would cross. Ex [n_1 ↔ m_2, n_2 ↔ m_3] is a valid map, but [n_1 ↔ m_2, n_2 ↔ m_1] is not.
(I believe the first three are standard weighted bipartisan ties, but I indicated them if I misunderstood the weighted bipartite correspondence)
This is relatively straightforward to do with an exhaustive search in exponential time (by the size of the sets), but I hope for polynomial time (ideally O ((| n | * | m |) ^ 3) or better).
I searched for a fair amount for the "assignment problem" / "weighted bipartisan correspondence" and saw variations with different constraints, but did not find what corresponded or what I could reduce to one with this added ordering constraint. Do you have any ideas on how I can solve this? Or maybe rough evidence that it is not solvable in polynomial time (reduction to NP-complete will also work for my purposes)?
source
share