|
|
back to boardShow all messages Hide all messagesI divided given graph into biconnected components, and then worked with created DAG. This solution is O(N^2) and runs in 0.203 seconds. But there are solutions with better time. Is there faster algo for this problem? P.S. sorry for bad english(( The input in this problem requires O(N^2) time, so the better complexity cannot be achieved :) Your solution O(N^2*log(N)) in worst case, because the input in this problem requires O(N^2*log(N)) time, so the better complexity than it cannot be achieved. How to divide graph into connected components in O(N^2)? You can use Tarjan's algorithm to find strongly connected components |
|
|