我正在研究一个有关车辆路线问题的小型项目,该项目中有一组车辆从车厂向一组客户运送货物。
解决方案如下:
Sub-route 1: Depot Customer4 Customer7
Sub-route 2: Depot Customer1 Customer5 Customer3
Sub-route 3: Depot Customer2 Customer6
其中仓库始终具有x-y坐标(0,0),因此x_all和y_all类似于
x_all = [0,x4,x7,x1,x5,x3,...]
y_all = [0,y4,y7,y1,y5,y3,...]
plt.plot(x_all,y_all)
如何为不同的路线绘制具有不同颜色的图形?换句话说,当(x,y)=(0,0)时,颜色将发生变化。 谢谢