When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

kpw29's blog

By kpw29, 4 years ago, In English

Hi! I'd like to do ask the wise men of Codeforces if they know any resources related to SPFA (Shortest Path Finding Algorithm). The short description of the algorithm can be found in PrinceOfPersia's blog:

picture

According to this comment by romanandreev it works on average in $$$O(m log n)$$$, but there are counterexamples. Is anyone aware of any papers trying to tackle SPFA complexity?

  • Vote: I like it
  • +10
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it -8 Vote: I do not like it

It can be made to work in $$$\mathcal O(nm)$$$. One of the ways is to construct a graph which looks like a grid.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yep, one of these is suggested in the mentioned comment.