Optimization and revenue management in complex networks