Photochemistry of giant planets and their satellites is characterized by numerous reactions involving many chemical species. In the present paper, chemical systems are modeled by signal flow graphs. Such a technique evaluates the transmission of any input into the system (solar flux, electrons...) and gives access to the identification of the most important mechanisms in the chemical system. For a given chemical system, we first evaluate rate coefficients. Then, in order to obtain concentrations of each compound, we integrate the set of continuity equations by Gear's method. Gear's method is chosen rather than another classical method because it is recommended for a system of stiff equations due to the existence of greatly differing time constants. Finally, the technique of signal flow graphs is used. This method is applied to the production of hydrocarbons in the atmospheres of giant planets. In particular, the production of C2H6 in the atmosphere of Neptune from the photodissociation of CH4 is investigated. Different paths of dissociation of CH4 are possible from L alpha radiations. A chemical system containing 14 species and 30 reactions including these different paths of dissociation is integrated. The main mechanism of production of C2H6 is identified and evaluated for each model of dissociation. The importance of various reaction paths as a function of time is discussed.