this post was submitted on 22 Jun 2024
403 points (97.4% liked)
Programmer Humor
19557 readers
1029 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
How in the hell does anyone f— up so bad they get O(n!²)? 🤯 That's an insanely quickly-growing graph.
Curious what the purpose of that algorithm would have been. 😅
You have two lists of size n. You want to find the permutations of these two lists that minimizes a certain distance function between them.
Surely you could implement this via a sorting algorithm? If you can prove the distance function is a metric and both lists contains elements from the same space under that metric, isn’t the answer to sort both?
It's essentially the traveling salesman problem