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

Get a successor node from source with a specific label #113

Open
kavuri opened this issue Mar 10, 2020 · 0 comments
Open

Get a successor node from source with a specific label #113

kavuri opened this issue Mar 10, 2020 · 0 comments

Comments

@kavuri
Copy link

kavuri commented Mar 10, 2020

I know there is no way to retrieve a node given an edge label, but I am constantly hitting a use case of trying to get a successor node with a given label. Consider a graph representation like:

g.setNode("1", "foo");
g.setNode("2", "bar");
g.setNode("3", "xyz");
g.setNode("4", "pqr");
g.setEdge("1", "2", {label:"time"});
g.setEdge("1", "3", {label: "space"});
g.setEdge("1", "4", {label":"cont"});

I was thinking of something like,
const c = g.getSuccessor("1", {label:"time"}); // returns "2"

The signature would be something like g.getSuccessor(<nodeName>, <edgeLabel>)

I understand that the edges are unique, but maybe leave it to the API user? Is this something that is possible?

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

No branches or pull requests

1 participant