Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] add a function to return a list of edges connected to a vertex #268

Open
5 tasks done
EnbyMonkey opened this issue Mar 3, 2025 · 1 comment
Open
5 tasks done
Labels
enhancement New feature

Comments

@EnbyMonkey
Copy link

Feature Request

A function get_connected_edges(vertex_id_t) or get_edges(vertex_id_t) or something like that, that returns a list of edge_id_t's for a vertex.

Why is this important?

The edges of my graph store information about the relationship between vertices (as well as a weight). I want to iterate over the edges of a vertex, to look for edges with a certain type of relationship. Roughly the edges are keeping track of relative positions of nodes, so for example if two nodes are one above the other, or one beside the other. So I want to iterate over the edges of a vertex to find all neighbouring vertices that are one above the other, for example.

Describe the solution you'd like

Add a function in graph.h (and other functions wherever else needed) which takes as input a vertex_id_t and returns an edges_t = std::unordered_set<edge_id_t> (like in graph.h line 20).

Describe alternatives you've considered

For now, I am using get_neighbours, then getting the vertex_id_t's of each neighbour, then getting the edge_id for each neighbour, and then getting the edge. This solution works but is a bit goofy imo

Additional context

I'm using this library for a force-directed graph layout, and the graphs in question are planar nearly everywhere.

Are you willing to contribute?

Sure, I could probably write some or most of the necessary code

Checklist

Please check the following before submitting the issue:

  • I have searched for similar feature requests in the issues.
  • This feature is not already implemented in the library.
  • I have provided a clear and concise description of the feature request.
  • I have explained why this feature is important and how it benefits the library and users.
  • I am willing to contribute to the development of this feature (if applicable).

Please note that feature requests are subject to review and may or may not be implemented in the library.

@EnbyMonkey EnbyMonkey added the enhancement New feature label Mar 3, 2025
Copy link
Contributor

github-actions bot commented Mar 3, 2025

Hi there! Thank you for creating your first issue on the Graaf library, we will look into it shortly. In the mean time, please make sure the issue has the correct labels set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

No branches or pull requests

1 participant