This paper addresses the problem of finding a static virtual topology design and flow routing in transparent optical WDM networks under a time-varying (multi-hour) traffic demand. Four variants of the problem are considered, using fixed or dynamically adaptable (i.e., variable) flow routing, which can be splittable or unsplittable. Our main objective is to minimize the number of transceivers needed which make up for the main network cost. We formulate the problem variants as exact ILPs (Integer Linear Programs) and MILPs (Mixed ILPs). For larger problem instances, we also propose a family of heuristics based on the concept of domination between traffic matrices. This concept provides the theoretical foundations for a set of techniques proposed to reduce the problem complexity. We present a lower bound to the network cost for the case in which the virtual topology could be dynamically reconfigured along time. This allows us to assess the limit on the maximum possible benefit that could be achieved by using optical reconfigurable equipment. Extensive tests have been conducted, using both synthetically generated and real-traced traffic demands. In the cases studied, results show that combining variable routing with splittable flows obtains a significant, although moderate, cost reduction. The maximum cost reduction achievable with reconfigurable virtual topologies was shown to be negligible compared to the static case in medium and high loads.