We describe design principles for accurate folding of three-dimensional DNA origami. To evaluate design rules, we reduced the problem of DNA strand routing to the known problem of shortest-path finding in a weighted graph. To score candidate DNA strand routes we used a thermodynamic model that accounts for enthalpic and entropic contributions of initial binding, hybridization, and DNA loop closure. We encoded and analyzed new and previously reported design heuristics. Using design principles emerging from this analysis, we redesigned and fabricated multiple shapes and compared their folding accuracy using electrophoretic mobility analysis and electron microscopy imaging. We demonstrate accurate folding can be achieved by optimizing staple routes using our model, and provide a computational framework for applying our methodology to any design.