qiskit.optimization.applications.ising.tsp¶
Convert symmetric TSP instances into Pauli list Deal with TSPLIB format. It supports only EUC_2D edge weight type. See https://wwwproxy.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95/ and http://elib.zib.de/pub/mp-testdata/tsp/tsplib/tsp/index.html Design the tsp object w as a two-dimensional np.array e.g., w[i, j] = x means that the length of a edge between i and j is x Note that the weights are symmetric, i.e., w[j, i] = x always holds.
Functions
|
calculate distance |
|
Generate Hamiltonian for TSP of a graph. |
|
Get graph solution from binary string. |
|
Read graph in TSPLIB format from file. |
|
Generate a random instance for TSP. |
|
Check whether a solution is feasible or not. |
|
Compute the TSP value of a solution. |
Classes
|
Create new instance of TspData(name, dim, coord, w) |