-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adding nodes can have a complexity of O(V^2) #19
Comments
This problem is also related the model representation of graphs that we have. It is planned to re-think a better model representation (data structure) |
We have two ways of solving this problem -
|
Hello @nikhil061102 Yes, your options are valid ways to solve the problem. However, I think this issue is a smell that show us that we need to change the model representation of the graphs, so probably we need to do more than just changing the data structure |
If we go through the AIGraphAlgorithm class, while adding each node we see that we are searching if the node exists.
The searching is done in O(V) operations, which makes creation of the graph take O(V^2) operations. Hence it is important to analyse improvements on this.
The text was updated successfully, but these errors were encountered: