-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
The name/ family name of the (di)graph is preserved on addition/ deletion of a vertex/ an edge. #38768
Comments
I'm not in favor of such change. Indeed, it would require extra work in add/delete vertex/edge methods, and we try to make these critical methods as efficient as possible. I know it's only one assignment, but it must be done only if the graph is effectively modified. For instance, |
How about giving names only to immutable graphs? |
Most of our graphs generators |
I actually do think that it would be good to return immutable graphs by default. |
This can certainly be done, but it's a significant amount of work since we have hundreds of generators... |
I would like to suggest the following approach:
For the places where these methods are used, we could do a global search for these methods and implement the necessary updates. While I understand this might require additional effort, I believe it will be worthwhile in the long run :) |
As I said in #38768 (comment), I'm not in favor of such change that may slowdown many methods for a very small benefit. |
Steps To Reproduce
Consider the following example:
Upon deleting a vertex from the Petersen graph, the string representation of the resulting graph still states that the new graph is the Petersen graph.
Upon deleting an edge from a cycle graph, the string representation of the resulting graph still states that the new graph is a cycle graph:
An analogous result can be observed for each instance of a named (di)graph/ (di)graph of a particular family. An example for digraph goes as follows:
Analogous behaviour may be observed in case of addition of a vertex/ an edge:
Expected Behavior
A (possible) expected behaviour can be to remove the prefix substring pertaining to the family name/ name of the (di)graph on the addition/ deletion of a vertex/ an edge. The expected behaviour for the above mentioned examples are listed below:
Actual Behavior
The name/ family name of the (di)graph is preserved on addition/ deletion of a vertex/ an edge. For examples see the section: Steps to reproduce
Additional Information
This problem may be solved by setting self.name() or the output of self.str() to '' on the addition/ deletion of a vertex/ an edge.
This issue shall also be corrected for the addition of cliques, cycles, paths and removable of multiedges.
Environment
Checklist
The text was updated successfully, but these errors were encountered: