JuliaGraphs / Graphs.jl

An optimized graphs package for the Julia programming language
http://juliagraphs.org/Graphs.jl/
Other
459 stars 91 forks source link

Functions for Edge Adjacency #349

Open narnold0 opened 7 months ago

narnold0 commented 7 months ago

The functions for vertex adjacency are quite useful, but there isn't a similar functionality for edges. Would graphs benefit from similar edge versions of these? I.e. A function similar to has_edge but which takes two edges and returns true they share a vertex in the graph. Also, an edge function counterpart to neighbors/all_neighbors that returns all the edges adj. to a provided edge?

henrik-wolf commented 7 months ago

The edge version of neighbours is planned to be part of interface for Graphs 2.0 (I raised a similar Idea before in #255). Since each graph can have its own edge-type, this function would need to be implemented by each graph as part of the interface, rather than just returning a SimpleEdge. (Otherwise, edges could return a different type than inedges, which will probably lead to confusion...)

Checking if two edges are connected feels like a reasonable addition to me.