JuliaGraphs / JuliaGraphs/Graphs.jl

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

Open
#162 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Julia
Stars
538
Forks
128
Avg merge
10h 25m
Merged PRs (30d)
2

Description

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 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Graphs.jl's existing edge types and public API to determine where a vector-to-edge conversion belongs. Compare a dedicated function with dispatching Base.convert, including the proposed AbstractEdge generalization. Done means the project has a decided API and an agreed implementation and test scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.