new edge type detection: can handle unknown nodes gracefully and simplefies code