This function builds one-step neighbor update for penalized K nearest neighbor graphs with rank The output is a list containing the graph and the degree distribution
optimalwithrank_curnode(k, cur_neis, neighbor, degree, lambda, rowrank)A list with two elements:
Integer vector of length k giving the updated
neighbors of the node.
Updated numeric degree vector for all nodes.
Integer; desired number of neighbors (out-degree) for the current node
Integer vector of current neighbors of the node
Integer vector of candidate neighbor indices for this node,
Numeric vector of current degrees for all nodes
A numeric representing the penalty parameter
Numeric vector of rank-based penalties for this node
Zhu, Y., & Chen, H. (2023). A new robust graph for graph-based methods. arXiv preprint arXiv:2307.15205.