This paper proves that a class of first order partial differential equations, which include scalar conservation laws with concave (or convex) equations of state as special cases, can be formulated as calculus of variations problems. Every well-posed problem of this type, no matter how complicated, even in multi-dimensions, is reduced to the determination of a tree of shortest paths in a relevant region of space-time where "cost" is predefined. Thus, problems of this type can be practically solved with fast network algorithms. The new formulation automatically identifies the unique, single-...