Added max-degree node utility function.