A more efficient version of active_nodes for when the end node is specified