Efficient Search Algorithm
I have a database for an extended family tree in the form of an object like this: Members={ "1":{ "id":"1" "name":"Full Name", "dad":"2", "spouses":["3","4"], "kids":{ "3":["5"], "4":["6","7"] } ... } "2":{ ... ... } ... ... over 1200 members in total } I'm trying to make a search algorithm to determine the shortest path between 2 people so then I can identify their relation. I'm using depth-first search by iterating through all the data in Members and saving all possible paths to finally choose the shortest one. It turns out to be painfully slow. I would like to know if you have a more efficient approach to tackle this. https://code.sololearn.com/WyhZnISzBfau/?ref=app