We present some research contributions on the modeling and solution of difficult optimization problems. Specifically, we focus on problems issuing from the fields of air and rail transport. More in details, we consider problems concerning the effective use of infrastructure capacity in the two transport systems. Indeed, allocating the finite and often scarce capacity to satisfy competing demand is a difficult problem, which is tackled in different ways in the different phases of the capacity utilization planning process. In the field of air transport, we focus on problems concerning the tactical phase. Specifically, we work on the so-called airport slot allocation problem. In the field of rail transport, we work on all phases of the capacity utilization planning process. In the strategic phase we study the maximum fitting of train paths to the infrastructure so as to quantify capacity. In the tactical phase we propose algorithms to identify relevant train travel times for timetabling purposes, considering energy consumption. Then, in the pre-operational phase we focus on the problem occurring when the need for unpredicted infrastructure maintenance make the planned timetable infeasible. Finally, in the real-time phase we consider the problem of dealing with traffic perturbations due to the occurrence of unexpected events concretizing in one or more trains suffering a delay. For all these problems, we propose formalized models and optimization algorithms considering a very detailed representation of the infrastructure, which is necessary to fully exploit its capacity as available in reality.