We consider massively dense ad hoc networks and study their continuum limits as the node density increases and as the graph providing the available routes becomes a continuous area with location and congestion dependent costs. We study both the global optimal solution as well as the non-cooperative routing problem among a large population of users where each user seeks a path from its origin to its destination so as to minimize its individual cost. Finally, we seek for a (continuum version of the) Wardrop equilibrium. We first show how to derive meaningful cost models as a function of the scaling properties of the capacity of the network and of the density of nodes. We present various solution methodologies for the problem: (1) the viscosity solution of the Hamilton-Jacobi-Bellman equation, for the global optimization problem, (2) a method based on Green’s Theorem for the least cost problem of an individual, and (3) a solution of the Wardrop equilibrium problem using a transformation into an equivalent global optimization problem.