# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
Name |
---|
While Kleene's algorithm can be used here, it's generally quite impractical. Consider the DFA from the linked article:
The example in the article has nearly 30 steps involving manually simplifying very long expressions such as
One alternative approach to constructing regex from DFA is by solving the linear system:
By expressing variables $$$q_0$$$, $$$q_1$$$ and $$$q_2$$$ through one another, we eventually arrive at the equation $$$x = a|bx$$$, where $$$a$$$ and $$$b$$$ are regex. Then, the minimum solution $$$x$$$ is found by iterating this equation (also known as Arden's rule):
This is similar to how the equation $$$x=a+bx$$$ in real numbers is solved by
So, by substitution we find
from which we get
So, regex for all states are
Of course, it's still exponential growth in the worst case, but at least it's not as fast as with Kleene's method.
Thanks for the comment! It is indeed similar to the approach in one of the papers mentioned in the TL;DR too.
A natural generalization is Gaussian elimination, and algorithms similar to it are mentioned for semirings after transforming these problems into systems of linear equations in those papers.
Could somebody please finally write a blog post about $$$O(n^{3-\varepsilon})$$$ algorithm for APSP...
Are there any? Some googling gives this article, and its best is
Apparently, no $$$O(n^{3-\varepsilon})$$$ was known in 2014 for APSP, and I can't easily find any updates?
In fact it is conjectured that such an algorithm does not exist, leading to the fascinating theory of fine-grained complexity.
Yeah, sorry... I tried to make a joke. There are many reasons to believe that such an algorithm does not exist.
It might be surprising for some people to know that there is an $$$O(n^{2 + o(1)})$$$ (probabilistic) algorithm for all pairs min cut — so APMC is probably easier than APSP. I was planning on writing a blog for it, but haven't gotten the time to complete it — the paper is here.
The most useful thing I know about Floyd-Warshall is described in this blog by bukefala