Pathway analysis and optimization in metabolic engineering