In bacteria functionally related genes comprising metabolic pathways and protein complexes are frequently encoded in operons and are widely conserved across phylogenetically diverse species. The evolution of these operon-encoded processes is affected by diverse mechanisms such as gene duplication, loss, rearrangement, and horizontal transfer. These mechanisms can result in functional diversification, increasing the potential evolution of novel biological pathways, and enabling pre-existing pathways to adapt to the requirements of particular environments. Despite the fundamental importance that these mechanisms play in bacterial environmental adaptation, a systematic approach for studying the evolution of operon organization is lacking. Herein, we present a novel method to study the evolution of operons based on phylogenetic clustering of operon-encoded protein families and genomic-proximity network visualizations of operon architectures. We applied this approach to study the evolution of the synthase dependent exopolysaccharide (EPS) biosynthetic systems: cellulose, acetylated cellulose, poly-β-1,6-N-acetyl-D-glucosamine (PNAG), Pel, and alginate. These polymers have important roles in biofilm formation, antibiotic tolerance, and as virulence factors in opportunistic pathogens. Our approach revealed the complex evolutionary landscape of EPS machineries, and enabled operons to be classified into evolutionarily distinct lineages. Cellulose operons show phyla-specific operon lineages resulting from gene loss, rearrangement, and the acquisition of accessory loci, and the occurrence of whole-operon duplications arising through horizonal gene transfer. Our evolution-based classification also distinguishes between PNAG production from Gram-negative and Gram-positive bacteria on the basis of structural and functional evolution of the acetylation modification domains shared by PgaB and IcaB loci, respectively. We also predict several pel-like operon lineages in Gram-positive bacteria and demonstrate in our companion paper (Whitfield et al PLoS Pathogens, in press) that Bacillus cereus produces a Pel-dependent biofilm that is regulated by cyclic-3',5'-dimeric guanosine monophosphate (c-di-GMP). Author summary: In bacterial genomes, biological processes are frequently encoded by neighbouring co-transcribed genes, termed operons. In addition, operon-associated genes often belong to distinct evolutionary families with diverse biological functions. Studying the evolution of bacterial operons provides valuable insight into understanding the biological significance of genes involved in environmental adaptation. To date, no systematic approach has been devised to examine both the complex evolutionary relationships of operon encoded genes and the evolution of operon organization as a whole. To address this challenge, we developed an integrative method to study operon evolution by combining phylogenetic tree based clustering and genomic-context networks. We applied this method to perform the first systematic survey of all known synthase-dependent exopolysaccharide biosynthetic machineries, demonstrating the generalizability of our approach for operons of diverse size, protein family composition, and species distribution. Our method identified distinct biofilm operon clades across phylogenetically diverse bacteria, that result from gene rearrangement, duplication, loss, fusion, and horizontal gene transfer. We found different evolutionary trajectories for Gram-negative and Gram-positive PNAG biofilm production machineries, and in a companion paper (Whitfield et al PLoS Pathogens, in press) present experimental validation that the Pel polysaccharide is produced by a Gram-positive bacterium. [ABSTRACT FROM AUTHOR]