Product-form distributions and network algorithms