Hungarian algorithm matching one set

I am looking for a variant of the Hungarian algorithm (I think) that will unite N people with itself, excluding pairs-pairs and pairs of the return trip, where N is equal.

eg. Given N 0 - N 6 and the cost matrix C for each pair, how can I get a set of 3 pairs with a low cost?

C = [ [ - 5 6 1 9 4 ]
      [ 5 - 4 8 6 2 ]
      [ 6 4 - 3 7 6 ]
      [ 1 8 3 - 8 9 ]
      [ 9 6 7 8 - 5 ]
      [ 4 2 6 9 5 - ] ]

In this example, the resulting pairs will be:

N 0 , N 3
N 1 , N 4
N 2 , N 5

With this, I’m now wondering if I can simply increase the value in the "lower half" of the matrix ... or even better, delete them.

Is there a Hungarian version that works on a non-square matrix?

, , ?

+4
2

@Niklas B, , this

, Primal-dual enter image description here

, , .

0

. , ( 0,1 5,6) X, X - .

X

, (6 ^ 2 ) - , .

1) , , , , . .

.

2) , , . , / /, , , ( /), .

3) , , , - , ., / . , .

4) , k. k , ( , / ).
, ( ).

2 2-4, 3 , .

( - , ) - .

, R, R , 3 R. .

0

Source: https://habr.com/ru/post/1532866/


All Articles