“…This fact implies the possible discontinuity of the Hamiltonian associated to the value function and/or of the boundary data. Although the discontinuous HJB equations have been studied since the eighties (see e.g., [6,24]), in this paper instead of considering such equations, we will write, as in [3], optimality conditions in terms of the value functions for the exit-time/exit cost problem on each edge. The value functions (15) do not depend on the position θ e of the agents on the edge e ∈ p, because, as we are going to show, the optimal behavior of the agents is, for any traversed edge, to implement a constant control u e p ≥ 0 chosen when they enter the edges.…”