How to judge if the graph is cyclic when add a new edge?



How to judge if the graph is cyclic when add a new edge? How to do it
quickly.


.