Dynamic Routing and Resource Allocation in Elastic Optical Networks