Possibility of controlling the creation of edges according to the source and target nodes

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