Skip to content

Rename algorithms by what they return instead of their creator #264

@gdalle

Description

@gdalle

Currently, many algorithms are not discoverable unless you know who created them. We should instead export more explicit function names, and add a type-based mechanism for dispatch with a reasonable default choice.
For instance,

function dijkstra(g, v)
    ...
end

function a_star(g, v)
    ...
end

might become

struct Dijkstra end
struct Astar end

function shortest_path(::Type{Dijkstra}, g, v)
    ...
end

function shortest_path(::Type{Astar}, g, v)
    ...
end

shortest_path(g, v) = shortest_path(Dijkstra(), g, v)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions