Dynamic positron emission tomography (PET) is a powerful tool of measuring biological activities in vivo. Due to the inherent high noise level, there are always concerns about how to increase the signal-to-noise ratio. One possible approach is to optimize the experimental design. In this paper, we propose a discretized representation of the experimental design and transform it to a combinatorial problem. This combinatorial optimization problem then can be solved using simulated annealing with component-wise Metropolis Monte Carlo simulation. We showed that using this novel approach one can design an optimal input function as well as an optimal sampling schedule efficiently. Our results show that the current dynamic scanning of approximately 20 frames does not give us much more information than an optimized four-frame schedule, and needlessly increases storage requirements. This is consistent with the conclusion given by Li et al. (1996). We also reproduced the optimal sampling schedule for the fluorodeoxy-glucose (FDG) study proposed. Moreover, we show that the single bolus injection is almost optimal in the sense of D-optimal design, as well as many other measures.