Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Hungarian algorithm

From Simple English Wikipedia, the free encyclopedia

The Hungarianalgorithm produces the best distribution, with for example: lowest price or shortest time.

Best distribution

[change |change source]

Example:

DriverElectricianGardenerManager
Alex$8$9$98$23
Ben$11$69$5$86
Chris$20$21$7$30
Dave$47$7$19$62

Lowest price:

  • $23: Alex - manager
  • $11: Ben - driver
  • $7: Chris - gardener.
  • $7: Dave - electrician.

$48: Total

Steps

[change |change source]

The Hungarian Matrix plays with values until the best distribution has only zeroes.

Step 1, zero in every line left to right

[change |change source]

Decrease each left to right line with its lowest value.

  • first line: - 8
  • second line: -5
  • third line: -7
  • fourth line: -7.
0 1 9015
6 64 0 81
13 140 23
400 12 55

Step 2, zero in every top down line

[change |change source]

Decrease each top down line with its lowest value, - 15 for last one only.

0 1 900
6 64 0 66
13 140 8
400 12 40

Step 3, mark zeroes to keep

[change |change source]

Cover all zeroes with the lowest possible number of lines.

01900
664066
131408
4001240

Find the lowest unmarked value: 6.

Step 4, make more zeroes

[change |change source]

Increase all values in marked lines with the value from step 3.

671026
664666
131468
4662446

Decrease all values with the value from step 3.

01960
058060
7802
4001840

Do steps 3 and 4 again and again,until you have enough zeroes.

Other websites

[change |change source]
Retrieved from "https://simple.wikipedia.org/w/index.php?title=Hungarian_algorithm&oldid=9478796"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp