Chinese researchers have developed the best shortest-path algorithm in 41 years!
Dijkstra’s Algorithm has been the undefeated king of the shortest path for over 40 years.
Whether you’re using Google Maps, booking a flight, or routing internet packets, Dijkstra is the engine running in the background.
Since 1984, textbooks have taught that its efficiency was hit by a "sorting barrier."
To find the shortest path, you have to sort the points by distance. And sorting has a mathematical floor you can’t cross.
Until now.
A research team from Tsinghua University just published a paper that shatters the 41-year-old record.
They proved that Dijkstra is not optimal.
By combining the logic of the Bellman-Ford algorithm with a revolutionary "recursive partial ordering" method, they figured out how to find the path without fully sorting the nodes.
The results are a massive shift in theoretical computer science:
- The first deterministic improvement to the Single-Source Shortest Path (SSSP) problem since 1984.
- A new time complexity of $ O(m \log^{2/3} n)$, officially beating the long-standing $ O(m + n \log n)$ limit.
- On massive sparse graphs (like the web or global logistics), this means finding the best route significantly faster than previously thought possible.
For four decades, the greatest minds in algorithms believed this limit was absolute.
Last year, even the legendary Robert Tarjan won an award proving Dijkstra was "optimally efficient" at sorting distances.
Tsinghua’s answer? Stop sorting.
The world’s most settled problem is suddenly wide open again.
If we can break a 40-year-old law in basic graph theory, what other "impossible" speed limits are waiting to be crushed?
Binary Tree Max Path Sum: the recursive function returns node + max(left, right) to the parent, but tracks maxSum with node + left + right. two separate concerns. the path can turn at a node but can’t extend after turning. [-10,9,20,15,7] → 42, not 34. https://t.co/IsbwzXN2Uj
Sort Colors trips most people on one thing: after swapping with blue, don't advance white. that element is unexamined. after swapping with red, advance both. it was already a 1. that's the Dutch National Flag algorithm. Apple, Google, Meta ask this. https://t.co/CogXacs5fk
Longest Palindromic Substring trips people on one thing: odd vs even palindromes. 'cbbd' → 'bb' requires the even-center check (expandAround i, i+1). only checking single chars gives you 'c', which is wrong. two expand calls per index, not one. https://t.co/GAvDWJUe4w
Combination Sum is the problem where backtracking clicks. add, recurse, pop. passing `start = i` not `i + 1` in the recursive call is what makes it combinations not permutations. without it, [2,3] and [3,2] both show up. https://t.co/jtJCOYmcx3
Swap Nodes in Pairs: the pointer update order matters. https://t.co/FFGowxKs6U = second, then https://t.co/KBn6NfVfkB = https://t.co/0oYiuT3YAw, then https://t.co/0oYiuT3YAw = first. Flip any two and you lose the rest of the list. And return https://t.co/yiwnktd47z, not head. head isn’t first anymore. https://t.co/4XwruTB4ed
Most people compare nums[mid] with nums[left] for Find Min in Rotated Sorted Array. Gets messy for the unrotated case. Compare with nums[right]: if mid > right, min is in the right half. Otherwise at mid or left. O(log n), no special cases. https://t.co/4dEDV6WtrP
Word Search is Number of Islands + one thing: reset the cell after DFS. that line IS the backtracking. skip it and dead-end paths permanently block valid ones. ABCB fails exactly because of this. Amazon, Bloomberg, Apple ask it constantly. https://t.co/7ZRekoFYEK
Maximum Product Subarray is Kadane's with a catch. track a running max AND a running min. negative numbers flip signs, so your minimum can become your maximum. [-2, 3, -4]: min at index 1 is -6, multiply by -4 and you get 24. https://t.co/mrkITU89Tu
Phone keypad letter combinations. The complexity is O(4^n) not O(3^n) because digits 7 and 9 have four letters, not three. Easy to get wrong in an interview. Also: return [] for empty input, not a list with an empty string. Apple asks this 24 times in recent data. https://t.co/xnT3sSpHkn
Phone keypad letter combinations. The complexity is O(4^n) not O(3^n) because digits 7 and 9 have four letters, not three. Easy to get wrong in an interview. Also: return [] for empty input, not a list with an empty string. Apple asks this 24 times in recent data. https://t.co/xnT3sSpHkn
Most people think merging two sorted linked lists needs O(n) extra space. it doesn't. you splice existing nodes by redirecting pointers, no new allocations. dummy node, compare heads, attach smaller, advance. Google, Meta, Amazon, Adobe all ask this. https://t.co/g2256oJwP1
Insert Interval is O(n) not O(n log n) because the input is pre-sorted. three cases: before (pass through), overlap (expand), after (output insert, swap current in). that swap is why out.add(insert) always works at the end. https://t.co/wOqkGUc52U
Spiral Matrix clicks once you see it as ring peeling. four pointers (top, bottom, left, right), shrink inward each loop. the bug: no boundary check before the bottom row traversal means double-counting on rectangular matrices. draw it on paper first. https://t.co/61BzyeaxbY
Rotate Image: transpose then reverse each row = 90 degrees clockwise, O(1) space. One trap: in the transpose loop, j starts at i, not 0. Start at 0 and every pair swaps twice, matrix ends up unchanged. Easy to miss. Google, Meta, Amazon ask this. https://t.co/frDghAAvXx
Majority Element II: at most 2 elements can exceed n/3 (pigeonhole). track 2 Boyer-Moore candidates instead of 1. cancellation eliminates triplets. second pass verifies. O(n), O(1). Adobe asks this constantly. https://t.co/Lby8MYFZjZ
Most people dp-table Unique Paths. works fine. but you can also use combinatorics: m+n-2 total moves, exactly m-1 go down. that's C(m+n-2, m-1). O(m+n), no table, no iteration. breaks with obstacles, but clean for the base case. https://t.co/HXY4Y8HjxC
Valid Anagram is where interviewers find out if you know the 26-int array trick. HashMap works but `c - 'a'` to map chars to indices, +1 for s, -1 for t, check all zeros is cleaner. O(1) space. Google, Bloomberg, Adobe all ask this. https://t.co/cfY7xA3iE1