[英]Defining the linear programming constraints in the Traveling Salesman Problem (TSP) for the scipy.optimize.linprog Python function
我正在嘗試使用Python 中的 scipy.optimize.linprog解決旅行商問題 (TSP)的線性規划公式。 This document清楚地定義了問題,雖然我理解這個想法,但我無法弄清楚如何將其轉換為所需的參數。 我已經展平了距離矩陣,所以 function 應該沒問題。 約束矩陣和 ...