Python code for Identifying engineering symbols connected to same line

Job ID: 30806598

Budget: ₹4,000 – ₹8,000 INR

As shown in red box in below attached image, symbols (circles) TT-5005, TT-5003, FT-5001, PT-5003, TI-5002, PI-5001 are connected to same bold line. In same way we need to identify all the symbols connected to same line.