PLC ADD find loops in graph