A function to order the nodes by a given vector. or by putting nonliving nodes to the end