Optimal flexibility for conformational transitions in macromolecules.