Graphs.jl icon indicating copy to clipboard operation
Graphs.jl copied to clipboard

Functions for Edge Adjacency

Open narnold0 opened this issue 11 months ago • 1 comments

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?

narnold0 avatar Mar 03 '24 20:03 narnold0

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.

henrik-wolf avatar Mar 03 '24 21:03 henrik-wolf