Cost Effective Multi-Period Spraying for Routing in Delay Tolerant Networks