select_nodes_by_degree function

Select nodes in the graph based on their degree values