this post was submitted on 02 Aug 2024
229 points (96.4% liked)
Programmer Humor
19503 readers
1408 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
Yeah, in fact, I somehow calculated in assumption of
n
being the amount of elements in matrix, notn²
(assuming square matrix)But I am impressed to know that there are serial algorithms that approach
O(n²)
, thank you for sharing that infoYeah, they work by turning the problem into some crazy kind of group theory and attacking it that way. Every once in a while someone shaves the decimal down slightly, just by implementing the deep math in a more efficient way. A new approach will be needed if it is in fact possible to get down to O(n^2^), though. Strassen's is a divide and conquer algorithm, and each step of the iteration looks like this:
In my copy of Introduction to Algorithms, it says something like "this is the most bullshit algorithm in the book and it's not close" underneath. You can make it a bit neater by representing the multiplication operation as a 3-dimensional tensor, but at the end of the day it's still just a stupid arithmetic trick. One that's built into your GPU.