# How to solve TSP problem with more than 3 nodes in the tutorial of Max-Cut and Traveling Salesman Problem?

I had to try the example of qiskit’s Traveling Salesman Problem with 3 nodes and executing it at IBM backend called simulator_statevector.Can execute and get the result normally.

But when trying to solve the TSP problem with more than 3 nodes,I changed n = 3 to n = 4.

# Generating a graph of 3 nodes
n = 4
num_qubits = n ** 2
ins = tsp.random_tsp(n, seed=123)
print('distance\n', ins.w)

# Draw the graph
G = nx.Graph()
colors = ['r' for node in G.nodes()]

for i in range(0, ins.dim):
for j in range(i+1, ins.dim):

pos = {k: v for k, v in enumerate(ins.coord)}

draw_graph(G, colors, pos)


And I changed backend from Aer.get_backend ('statevector_simulator') running on my device to provider.backend.simulator_statevector running on the IBM backend.

aqua_globals.random_seed = np.random.default_rng(123)
seed = 10598
backend = provider.backend.simulator_statevector
#backend = Aer.get_backend('statevector_simulator')

quantum_instance = QuantumInstance(backend, seed_simulator=seed, seed_transpiler=seed)


But the result that comes out with an error.

energy: -1303102.65625
time: 5626.549758911133
feasible: False
solution: [1, 0, 2, []]
solution objective: []
Traceback (most recent call last):
File "<ipython-input-10-bc5619b5292f>", line 14, in <module>
draw_tsp_solution(G, z, colors, pos)
File "<ipython-input-4-999185567031>", line 29, in draw_tsp_solution