We generalize the well-known odd-even merge sorting algorithm, originally due to Batcher (1968), and show how this generalized algorithm can be applied to sorting on product networks. If G is an arbitrary factor graph with N nodes, its r-dimensional product contains N/sup r/ nodes. Our algorithm sorts N/sup r/ keys stored in the r-dimensional product of G in O(r/sup r/F(N)) time, where F(N) depends on G. We show that, for any factor graph G, F(N) is, at most, O(N), establishing an upper bound of O(r/sup 2/ N) for the time complexity of sorting N/sup r/ keys on any product network. For product networks with bounded r(e.g. for grids), this leads to the asymptotic complexity of O(N) to sort N/sup r/ keys, which is optimal for several instances of product networks. There are factor graphs for which F(N)=O(log/sup 2/ N), which leads to the asymptotic running time of O(log/sup 2/ N) to sort N/sup r/ keys. For networks with bounded N (e.g. in the hypercube N=2, fixed), the asymptotic complexity becomes O(r/sup 2/). We show how to apply the algorithm to several cases of well-known product networks, as well as others introduced recently. We compare the performance of our algorithm to well-known algorithms developed specifically for these networks, as well as others. The result of these comparisons led us to conjecture that the proposed algorithm is probably the best deterministic algorithm that can be found in terms of the low asymptotic complexity with a small constant.