[add] degree for graphs and digraphs