Traditional mobile ad-hoc network (MANET) and delay tolerant network (DTN) routing schemes work properly only under the limited assumptions. MANET routing schemes are designed for densely populated networks while DTN routing schemes were developed for dealing with intermittently connected topologies. However, in a real environment, the assumption cannot be hold: the density of nodes constantly changes and a network can be separated due to node mobility even when it is composed of large number of nodes. We propose a routing scheme for maximizing the delivery rate in a network with varying density. In the proposed scheme, data packets are used to search an available path while they are delivered by DTN-based routing. If a path exists, subsequent packets are relayed along the path. Otherwise, packets are delivered continuously using DTN-based routing. Using simulation we show that the proposed scheme achieves high throughput and a low overhead in a dense part of the network, while it outperforms existing DTN routing schemes in an intermittently connected situation.