0

I'm working on building a graph for word ladder problem using Python. I try to use union-find data structure to find connected component in the graph, but since I'm new to programming, I feel very confused how to implement it in Python even I have known how the union-find data structure works theoretically. Need help. Providing code would be much appreciated. The following is my data file:

{aaron
 aback
 abaft
 abase
 abash
 abate
 abbey
 abbot
 abeam
 abele
 abets
 abhor
 abide
 abies
 abler
 abode
 abomb
 abort
 about
 above
 abuse
 abuzz
 abyss
 accra
 acers
 ached
 aches
 acids
 acorn
 acres
 acrid
 acted
 actor
 acute
 adage
 adapt
 added
 adder
 addle
 adept
 adhoc
 adieu
 adios
 adlib
 adman
 admen
 admin
 admit
 admix
 adobe
 adopt
 adore
 adorn
 adult
 aegis
 aeons
 aesop
 affix
 afire
 afoot
 afros
 after
 again
 agape
 agave}
  • You should use an existing library implementation of union-find. The only acceptable excuse is that the assignment requires you to implement it yourself. For that I recommend the Algorithms book https://algs4.cs.princeton.edu/15uf/ – Dan D. Feb 12 '20 at 17:38
  • Please try to add the code that you have tried to attempt. – Gambit1614 Feb 18 '20 at 06:15

0 Answers0