Added two functions for shared edges calculations

Functions allow calculation of shared edges much more rapidly and with reduced memory footprint.