-
Notifications
You must be signed in to change notification settings - Fork 21
Make the custom vertex index optional #3
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
Comments
I agree this is potentially confusing. The reason I decided to require labels is because vertex codes get reassigned after |
As a minimal step, I could add a warning to the docstring saying that using |
|
Hopefully the clarification in e65a1bf should help. Feel free to reopen if not. |
Currently one has to define a custom vertex index in order to use MetaGraphsNext. But I don't always need a custom vertex index. For example, suppose I want to use MetaGraphsNext to make a simple weighted graph. Here's what I would have to do:
Side note: Currently the only
add_vertex!
constructor is theadd_vertex!(g::MetaGraph, label, val)
constructor, hence the need for the third argument withnothing
in it in the above example.So far it looks like I've been using a normal integer index, but it's actually a custom index that happens to be equal to the underlying integer index:
Maybe that's ok, but it seems a little wasteful to me. It could also lead to bugs if the programmer thinks they are using the normal integer index. For example, the following should throw an error if the normal integer index is being used:
But it doesn't throw an error because it is actually creating a custom index:
The text was updated successfully, but these errors were encountered: