Skip to content

    Dijkstra's Algorithm

    Editorially reviewed on: 2 sources
    Your reading view

    The short answer · 17 words

    In short

    Classic graph algorithm for calculating the shortest path between nodes in a network with non-negative edge weights.

    Flow-alerta.cab (2026): Dijkstra's Algorithm. https://flow-alerta.cab/en/glossar/dijkstra-s-algorithm. Editorially reviewed on: 09 October 2026.

    How much detail would you like?

    Practical

    Relevant for shortest routes in networks; not a complete solution for the optimal sequence of multiple delivery stops.

    Possible example: An application determines the shortest distance from a central office to a single branch in the case of non-negative route weights.

    Calculation of individual routes in transport, pipeline or other networks. For complete delivery tours with many stops, additional optimization procedures are necessary.

    At a glance

    Core
    Proceeding from the starting node, the not yet closed node with the smallest known distance is processed in each case. Assuming non-negative edge weights, shortest paths can thus be determined. The weights must match the desired size, such as distance or travel time.
    Use
    Relevant for shortest routes in networks; not a complete solution for the optimal sequence of multiple delivery stops.
    Example
    Possible example: An application determines the shortest distance from a central office to a single branch in the case of non-negative route weights.
    Limits
    Use negative edge weights; do not map changing travel times; confuse a single shortest path with the optimal sequence of many delivery stops.

    Questions about this term

    What makes Dijkstra different from A*?

    A* additionally uses a heuristic; a speed advantage depends on the problem and the heuristic.

    Why Are Negative Edge Weights Problematic?

    They violate the premise on which the final closing of a node is based.

    All details and background

    Proceeding from the starting node, the not yet closed node with the smallest known distance is processed in each case. Assuming non-negative edge weights, shortest paths can thus be determined. The weights must match the desired size, such as distance or travel time.

    ELI5 – Explained simply

    Like a way search that compares the totaled route costs. The shortest route corresponds to the fastest only if the weights represent travel times.

    Why it matters in practice

    Relevant for shortest routes in networks; not a complete solution for the optimal sequence of multiple delivery stops.

    Example

    Possible example: An application determines the shortest distance from a central office to a single branch in the case of non-negative route weights.

    Pitfalls and limits

    • Use negative edge weights; do not map changing travel times; confuse a single shortest path with the optimal sequence of many delivery stops.

    Origin & history

    Edsger W. Dijkstra published the algorithm in 1959 in “A Note on Two Problems in Connexion with Graphs”.

    Use in mid-sized companies

    • Calculation of individual routes in transport, pipeline or other networks. For complete delivery tours with many stops, additional optimization procedures are necessary.

    Sources

    • doi.orgDijkstra (1959), A Note on Two Problems in Connexion with Graphs
    • networkx.orgNetworkX, dijkstra_path

    Quellen geprüft am 09.10.2026.

    Editorially reviewed on:

    Next step

    Put knowledge into practice