  We investigate computational and mechanism design aspects of scarce resource
allocation, where the primary rationing mechanism is through waiting times.
Specifically we consider allocating medical treatments to a population of
patients. Each patient needs exactly one treatment, and can choose from $k$
hospitals. Hospitals have different costs, which are fully paid by a third
party ---the "payer". The payer has a fixed budget $B$, and each hospital will
have its own waiting time. At equilibrium, each patient will choose his most
preferred hospital given his intrinsic preferences and the waiting times. The
payer thus computes the waiting times so that at equilibrium the budget
constraint is satisfied and the social welfare is maximized.
  We first show that the optimization problem is NP-hard, yet if the budget can
be relaxed to $(1+\epsilon)B$ for an arbitrarily small $\epsilon$, then the
optimum under budget $B$ can be approximated efficiently. Next, we study the
endogenous emergence of waiting time from the dynamics between hospitals and
patients, and show that there is no need for the payer to explicitly enforce
the optimal waiting times. Under certain conditions, all he need is to enforce
the amount of money he wants to pay to each hospital. The dynamics will always
converge to the desired waiting times in finite time.
  We then go beyond equilibrium solutions and investigate the optimization
problem over a much larger class of mechanisms containing the equilibrium ones
as special cases. With two hospitals, we show that under a natural assumption
on the patients' preference profiles, optimal welfare is in fact attained by
the randomized assignment mechanism, which allocates patients to hospitals at
random subject to the budget constraint, but avoids waiting times.
  Finally, we discuss potential policy implications of our results, as well as
follow-up directions and open problems.
