Considering the limited energy and transmission range of sensor nodes in sensor networks, a tree-based energy-efficient routing algorithm is discussed. According to maximum residual energy of nodes, a tree whose root is the sink node was set up in the covered field in which nodes with maximum residual energy less than ɛ are leaves. And a reliable routing algorithm is used when there have nodes death in the transmitting process. To optimize the algorithm, we use the β-constraint, which puts a soft limit on the maximum number of children a node can have in a tree. It can achieve lower latency and more energy-efficient, and the lifetime of the network is prolonged.