This study introduces a model to solve a dynamic network optimization model on a heterogeneous graph. We use this model to optimize the collection and consolidation operations on a cross-country multi-modal distribution network. The model’s dynamic objects are trucks, trailers, orders, unvisited collection and customs check points. Information about dynamic objects is extracted from a real-time database. The model’s static objects include objects that are known in advance, such as warehouses. The constraints of the problem include due dates, vehicle capacity, availability of vehicles, and precedence constraints of visiting locations. We propose a mixed-integer programming model and provide a solution using matheuristics. We decompose the master MIP model into subproblems that can be solved to optimality with LP solvers. We also reduce the graph complexity by variable fixing due to optimized subproblems or by bounding the maximum number of paths to be selected due to the solutions of priority-based bin packing algorithms. Finally, we convert the resulting problem into a bipartite matching problem by expanding the graph nodes which can then be solved in polynomial time. We implement our solution method on real-time data retrieved from the tracking system of a third-party logistics company. Experiments show that our solution method significantly outperforms other heuristics in terms of solution quality which is measured with respect to lateness, empty kilometers traveled, travel times, number of required/used vehicles, load factors, and ratio of served orders.