It doesn’t sort, and it runs faster than any algorithm that does.

The finished algorithm slices the graph into layers, moving outward from the source like Dijkstra’s. But rather than deal with the whole frontier at each step, it uses the Bellman-Ford algorithm to pinpoint influential nodes, moves forward from these nodes to find the shortest paths to others, and later comes back to other frontier nodes. It doesn’t always find the nodes within each layer in order of increasing distance, so the sorting barrier doesn’t apply. And if you chop up the graph in the right way, it runs slightly faster than the best version of Dijkstra’s algorithm.

The real magic happens when we use inline SVGs.

The really cool thing is that SVGs are first-class citizens in the DOM. We can use CSS and JavaScript to select and modify SVG nodes, as if they were HTML elements.