SUMMARYWe study the problem of routing vehicles with energy constraints through a network where there are at least some charging nodes. We seek to minimize the total elapsed time for vehicles to reach their destinations by determining routes, as well as recharging amounts when the vehicles do not have adequate energy for the entire journey. For a single vehicle, we formulate a mixed-integer nonlinear programming problem and derive properties of the optimal solution allowing it to be decomposed into two simpler problems. For a multi-vehicle problem, where traffic congestion effects are included, we seek to optimize a system-wide objective and formulate the problem by grouping vehicles into 'subflows'. We also provide an alternative flow optimization formulation leading to a computationally simpler problem solution with minimal loss in accuracy. Because the problem size increases with the number of subflows, a proper selection of this number is essential to render the problem computationally manageable and reflects a trade-off between proximity to optimality and computational effort needed to solve the problem. We propose a criterion and procedure leading to an appropriate choice of the number of subflows. We also quantify the 'price of anarchy' for this problem and compare user-optimal to system-optimal performance. Finally, when the system consists of both electric vehicles (EVs) and non-electric vehicles, we formulate a system-centric optimization problem for optimal routing of both non-electric vehicles and EVs along with an optimal policy for charging EVs along the way if needed. Numerical results are included to illustrate these approaches.