Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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

Description

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(, )

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions