sort node/edge strings by length