Ad hoc communication among wireless enabled smart devices is increasingly playing an important role in coordinating distributed applications. Existing ad hoc routing algorithms usually assume the existence of end-to-end path connecting communication nodes. However, due to the power limitation, radio coverage and geography distribution of cooperating nodes, in some scenarios this assumption is unlikely to be valid. We address the issue of data routing in partially connected ad hoc networks. In this situation, data propagation is achieved via mainly pair-wise communication between any two nodes when they are in vicinity. We propose a novel routing framework named shortest expected path routing (SEPR). Instead of blindly flooding messages in the network, SEPR builds up a stochastic model of the ad hoc network and maintains it in a distributed way. A new routing metric, called expected path length, is proposed. By guiding messages flow to shortest expected path nodes, our approach dramatically reduces the number of unnecessary message copies as well as increases the message delivering rate. With a simulation, we evaluate the effectiveness and the efficiency of our approach.