network with edge weights