Added a function to the edge creation process, so
one can execute some logic to choose whether or not
to create the edge