Skip to content

Bad stop condition in Lua dijkstra #542

@xopxe

Description

@xopxe

In https://github.com/kennyledet/Algorithm-Implementations/blob/master/Dijkstra%27s_Shortest_Path/Lua/Yonaba/dijkstra.lua lines 84 and 85 seems to be reversed.

    if u == target then return backtrace(u) end
    if u.distance == math.huge then break end

As it is, you can detect a target arrival through a non-existing link.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions