def METHOD_NAME(self):
    mesh = self.mesh
    NN = mesh.number_of_nodes()
    edge = mesh.entity('edge')
    node2node = mesh.ds.node_to_node()
    V = np.asarray(np.sum(node2node, axis=1)).reshape(-1)
    isSmall = self.rho[edge[:, 0]] < self.rho[edge[:, 1]]
    v = np.zeros(NN, dtype=np.int)
    np.add.at(v, edge[isSmall, 0], 1)
    np.add.at(v, edge[~isSmall, 1], 1)
    isExtremeNode = (v == V) | (V == (V - v))
    return isExtremeNode