This paper presents a fully-automatic system for generating an optimized indoor scene populated by a variety of furniture objects. Given positive examples of furnished indoor scenes, our system extracts hierarchical and spatial relationships for different types of furniture objects. This step is done once, in advance. The extracted relationships are encoded into priors which are integrated into a cost function that optimizes ergonomic factors, such as visibility and accessibility. To deal with the prohibitively large search space, the cost function is optimized by simulated annealing with a Metropolis Hastings state-search step. We demonstrate that different furniture layouts can be automatically synthesized to decorate an indoor scene. A perceptual study is performed to validate that there is no significant difference in preference on functionality between our synthesized results and those produced by human designers.