Made another attempt at the algorithm - still not working correctly. Seeing extra edges popping into graphs.