Skip to content

Convert a Vector{Integer} to Vector{Edge} function #162

Open
@filchristou

Description

@filchristou

Locally I very often use the following function to convert Vectors of Integers to Vector of Edges.

edgeify(p::Vector{T}) where T<:Integer = map(Edge , zip(p, p[2:end]));

As a result it ends up being defined in many local packages.
Do you think it would make sense to have something similar in Graphs.jl ?

Of course it would be nice to probably change the signature to be functional for any E<:AbstractEdge type.

I was also thinking about dispatching the Base.convert function, but maybe we don't want any automatic conversion to take place. What do you think ?

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