refactoring edges to store id as source-target and position as position in the array of created edges