Deduplicate code
Allow edges to have start and end nodes with no IDs set