Optimal transport on complex networks