A fast reconstruction algorithm for gene networks