graph icon indicating copy to clipboard operation
graph copied to clipboard

added Vertices() to Graph interface

Open jonbrandenburg opened this issue 2 years ago • 4 comments

This is a proposed solution to #130. Alternatively I could see renaming this to ListVertices() and adding a Vertices() that returns the actual vertices, though that might be more challenging since there is currently no Vertex type so conveying the VertexProperties would not happen as it does with Edges() and their corresponding EdgeProperties.

Building on the earlier idea, it might be beneficial to introduce a Vertex type:

type Vertex[T any] struct {
    Value T
    Properties VertexProperties
}

Then this would enable the ability to create a Vertices() like this:

func Vertices() ([]Vertex[T], error)

jonbrandenburg avatar Jul 17 '23 02:07 jonbrandenburg

Hey @dominikbraun, can this be merged ? I want this method more than ever.

AkashKumar7902 avatar Feb 09 '24 19:02 AkashKumar7902