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

UnsupportedOperationException when using SimpleGraph #1

Open
ErrorxCode opened this issue Jun 7, 2022 · 0 comments
Open

UnsupportedOperationException when using SimpleGraph #1

ErrorxCode opened this issue Jun 7, 2022 · 0 comments
Labels
good first issue Good for newcomers

Comments

@ErrorxCode
Copy link
Collaborator

Problem

This is because SimpleGraph does not have explicit relation. So you cannot tell the name of the relationship while adding in the edge, it uses a nameless relation by default.

Solution

Just change ,

Graph<String> graph = new SimpleGraph<>(3);
graph.addEdge("A", "B", "C");

to,

SimpleGraph<String> graph = new SimpleGraph<>(3);
graph.addEdge("A", "B");
@ErrorxCode ErrorxCode added the good first issue Good for newcomers label Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant