-
Notifications
You must be signed in to change notification settings - Fork 231
is_connected() is too slow #398
Copy link
Copy link
Labels
algorithmtype of issue related to algorithmstype of issue related to algorithmsperformancePerformant use of time and space.Performant use of time and space.priority: mediumImportant but not blocking. Should be addressed soon, can wait a release or two.Important but not blocking. Should be addressed soon, can wait a release or two.
Metadata
Metadata
Assignees
Labels
algorithmtype of issue related to algorithmstype of issue related to algorithmsperformancePerformant use of time and space.Performant use of time and space.priority: mediumImportant but not blocking. Should be addressed soon, can wait a release or two.Important but not blocking. Should be addressed soon, can wait a release or two.
Type
Fields
Give feedbackNo fields configured for Bug.
is_connected function is documented as
and achieves this goal by checking if each vertex is reachable from each other one. This is unnecessarily resource-consuming and slow, O(n^3) (or even O(n^4)). You could call this a performance bug.
Please see PR397 (#397) that fixes this to run in O(N) (O(N+E)).
See the attached log_vec.txt for speed evaluation.
log-vec.txt
(please tell if you're interested in the program that generates it)