Minimum length cycle for each node in a directed graph

Правка en2, от Aritra741, 2019-04-04 16:48:26

I recently came across a problem in SPOJ that asks the minimum length of the cycles starting at each node of the graph. For details: Link .

I solved it by considering each node as the root and found the minimum length cycle with BFS. You can find my code Here .

Now I'm wondering how it could be solved if there were 10^5 nodes instead of 2000. Any kind of help is appreciated.

Теги #graph, bfs

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Aritra741 2019-04-04 16:48:26 4
en1 Английский Aritra741 2019-04-04 16:46:53 516 Initial revision (published)