The Interplanetary Internet is a network that interconnects objects traveling in space and on planets such as satellites, rovers and comets. This network has very different communication conditions than the networks deployed on the surface of Earth. The large delays, intermittent connections and rough environment in space require the adoption of the Delay/Disruption Tolerant Network architecture/techniques. The currently used implementation of DTN interplanetary networks uses the Contact Graph Routing mechanism that we show, using the Interplanetary Overlay Network (ION) based experiments, has some shortcomings leading to less efficient use of the network. In this paper, we propose a novel model to represent such networks based on temporal graphs obtaining a near-real-time representation of these deterministic dynamic networks. This Modified Temporal Graph (MTG) model is then used for the implementation of our proposed routing algorithm, the Earliest Arrival Optimal Delivery Ratio (EAODR) routing algorithm. We provide the proof of correctness of EAODR, and we use our routing simulator to run experiments on a real-world network and also on large networks. We prove that EAODR outperforms the Contact Graph Routing (CGR) in terms of a decrease in delay of up to 12.9%.