  We adapt ideas and concepts developed in optimal transport (and its
martingale variant) to give a geometric description of optimal stopping times
of Brownian motion subject to the constraint that the distribution of the
stopping time is a given probability. The methods work for a large class of
cost processes. (At a minimum we need the cost process to be measurable and
adapted. Continuity assumptions can be used to guarantee existence of
solutions.) We find that for many of the cost processes one can come up with,
the solution is given by the first hitting time of a barrier in a suitable
phase space. As a by-product we recover classical solutions of the inverse
first passage time problem / Shiryaev's problem.
