In the rainbow trout (Oncorhynchus mykiss), we studied the acute toxicity LC(50)-96 h of 274 organic pesticides with a wide variety of molecular structures. Optimization of correlation weights of local and global graph invariants (OCWLGI) gave quantitative structure-activity relationships (QSARs) for predicting toxicity. We used a labeled hydrogen-filled graph (LHFG) to elucidate the molecular structure. We also used the extended connectivity of zero ((0)EC(k)), first ((1)EC(k)), and second ((2)EC(k)) order, numbers of path lengths 2 (P2(k)) and 3 (P3(k)) starting from a given vertex in the LHFG, and valence shells of second order (S2(k)). S2(k) is the sum of the degree of vertices at distance 2 from a given vertex k. The presence of three-, five-, and six-member cycles and hydrogen bond indices suggested they might be used as global LHFG invariants. We applied this method to a broad set of pesticides, to predict toxicity for the trout. The best model used weighted S2(k) and global LHFG invariants. Statistical characteristics of this model are as follows: n=233, r(2)=0.7689, r(2)(pred)=0.7688, s=0.75, F=769 (training set); n=41, r(2)=0.6421, r(2)(pred)=0.4241, s=1.14, F=70 (test set).