Graph-based modeling and evolutionary analysis of microbial metabolism