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

How to handle self-loops? #43

Open
gdalle opened this issue Apr 6, 2023 · 2 comments
Open

How to handle self-loops? #43

gdalle opened this issue Apr 6, 2023 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@gdalle
Copy link
Member

gdalle commented Apr 6, 2023

It is unclear how well self-loops are supported in Graphs.jl, but that should not prevent us from supporting them here. For now, I stated in the documentation that they are not properly handled, because of a few issues that were raised over the years and never closed in the original package:

What do you think?

@gdalle gdalle added bug Something isn't working question Further information is requested labels Apr 6, 2023
@pgrepds
Copy link
Contributor

pgrepds commented Apr 11, 2023

Good question. Is there any particular reason why self-loops are allowed for SimpleGraphs at all in Graphs.jl? It seems to violate the common definition.

@simonschoelly
Copy link
Collaborator

Adding self-loops to graphs it not very difficult from a technical perspective (unlike multi-edges), so while it does not strictly correspond to the mathematical definition of a simple graph, we still allow them. There are many cases where self-loops can be useful, for example in finite state diagrams.

In some cases, self-loops have given us some headaches over the last few years though, as one has to consider some extra cases when writing algorithms. And people often forget to write test cases with self-loops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants