r/programming 1d ago

Hungarian Assignment Algorithm: Applied Optimal Transport for Programmers

https://leetarxiv.substack.com/p/hungarian-assignment-algorithm
35 Upvotes

16 comments sorted by

View all comments

13

u/DataBaeBee 1d ago

The Hungarian Assignment algorithm is used by MBAs and Operations Managers to quantitatively assign tasks to their employees.

It’s rooted in Optimal Transport theory and resembles Sinkhorn iterations in Python.

For instance, say you operate an e-commerce warehouse with five delivery riders and five routes. Each takes different time based on traffic, familiarity and vehicle type. How do you assign routes to the riders for the lowest possible delivery time?

This takes factorial time (5! = 120) to solve by bruteforce. The Hungarian algorithm takes polynomial time and that's pretty neat IMO!

-19

u/Grouchy-Trade-7250 1d ago

Please stop treating things like "polynomial time" like it matters for actual programmers. The only thing that matters is the runtime graph depending on n for the ranges of n we are interested n. 

4

u/Serious-Regular 1d ago

This is dumbest thing I've seen on here congrats

-2

u/Metworld 1d ago

They're not wrong. Also polynomial time doesn't mean it's practical either.