finished function to calculate log probability of edge, created an array of lists caching data structure to hold edge information