I have a list of edges, given by a pair of coordinates (x, y) of the incident vertices, and I want to check, if these edges form connected undirected graph. what is the most efficient algorithm for this task?
Example with 'NO' answer:
[((607.0, 250.0), (606.0, 270.0)),
((543.0, 167.0), (470.0, 173.0)),
((172.0, 319.0), (173.0, 329.0)),
((648.0, 652.0), (692.0, 688.0)),
((558.0, 488.0), (579.0, 469.0)),
((579.0, 469.0), (558.0, 488.0)),
((357.0, 699.0), (347.0, 650.0)),
((173.0, 329.0), (172.0, 319.0)),
((606.0, 270.0), (607.0, 250.0)),
((910.0, 452.0), (830.0, 473.0)),
((347.0, 650.0), (357.0, 699.0)),
((830.0, 473.0), (910.0, 452.0)),
((692.0, 688.0), (648.0, 652.0)),
((470.0, 173.0), (543.0, 167.0))]