Abstract-Recently, erasure coding has become widely used to compensate for the low packet delivery ratio of multi-hop wireless networks. Most existing works assume that the number of redundant erasure-coded packets is unlimited for a message. In this paper, we relax this assumption and integrate the packet quantity into a routing problem in order to achieve a good balance between energy cost and reliability (packet delivery ratio). In doing so, we encounter two major challenges in regards to our new routing problem: one is determining the optimal quantity of redundant packets and the other is determining the optimal routing path. We introduce a benefit value to reflect the trade-off between cost and reliability, and design a single metric (expected utility) by integrating benefit value, cost, and reliability. Based on the expected utility metric, we explore the optimality in both path coding and source coding models. In the path coding model, we design an optimal algorithm, and in the source coding model we propose a heuristic solution. Results from extensive simulations on our custom simulator verify our claims.