I wanna find out the length of shortes cycle in graph , one approach is just do brute force , but time complexity is N2 ,
Question : “Breadth First Search - Eolymp”
After solving above problem , I google but here what i found -
GFG article : “Shortest cycle in an undirected unweighted graph - GeeksforGeeks”
My more optimised solution : “hjaBe1 - Online C++0x Compiler & Debugging Tool - Ideone.com”
But as I said it is still N2 can we do something better , by using concept of LCA or something else ?