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

Add to edges with no node check #47

Open
andrea-cassioli-maersk opened this issue Nov 29, 2021 · 4 comments
Open

Add to edges with no node check #47

andrea-cassioli-maersk opened this issue Nov 29, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@andrea-cassioli-maersk
Copy link

Is your feature request related to a problem? Please describe.
Running some profiling on our application, it seems that adding edges to a bidirectional graph is quite expensive, and in particular quite an amount of time is spent in looking up if origin and destination nodes are valid, i.e. they exists.

Describe the solution you'd like
I was thinking about a flag to disable node existence checking. It could be enable by default, without breaking current interface.

@KeRNeLith
Copy link
Owner

KeRNeLith commented Dec 1, 2021

Hello @andrea-cassioli-maersk!

Thank you for showing interest to QuikGraph :-)

Oh I see, that's mainly the integrity contrainst that is responsible of this. Do you have some profiling data to share on that topic?
This may impact other graph implementation I imagine, but maybe you're focusing on bidirectional one.

Hum something that can be indeed implemented, it would be like an unsafe mode I imagine. Like disable checking producing better performance but user is responsible of maintaining the integrity. Note that this may produce unexpected behaviors in case the constraint is not met, since the whole design of those structures was to ensure logic is not broken at any point.

@andrea-cassioli-maersk
Copy link
Author

Hi @KeRNeLith ,
this cost is no more that relevant for us as we progress, but still not negligible. I do not have a profiling right now. In general I can imagine that for performance sake one may want to switch off checking nodes every time...

@KeRNeLith
Copy link
Owner

In this case we can consider what I was talking about an unsafe mode.
BTW such mode would require a check at each insertion. Considering that insert most of the time use map container for checks, I'm not sure we will gain a lot.

@KeRNeLith
Copy link
Owner

KeRNeLith commented Mar 28, 2022

@andrea-cassioli-maersk did you find time to have some profiling data?
I was wondering if for such scenario it would be better to go with a dedicated method not doing the check or adding a flag to it which in the later case add the cost of the flag to verify.
Any thoughts on that?

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

No branches or pull requests

2 participants