A traveling salesperson has a list of seven cities to visit exactly once during their route. The salesperson wants to take the shortest route possible.
This problem contains two exercises which illustrate the difference between the hybrid and classical solvers.
The program hss_exercise.py
is the first exercise. You will need to:
- Call the hybrid solver
- Call the traveling salesperson QUBO generator from
dwave_networkx
- Fill in the
get-qubo
function - Setup your sampler in the
get_sampler
function to run on the hybrid sampler
Notes:
- Don't forget to import the packages where the sampler and traveling salesperson QUBO generator lives.
- You may find the Ocean documentation useful.
The second exercise is compare_solver_exercise.py
. This file is identical to the hss_exercise.py, except you will call a classical solver instead of a hybrid solver.
There are two things you should modify from what you did in exercise 1:
- Call an alternative sampler (choose
SimulatedAnnealingSampler
) - Set up your sampler in the
get_sampler
function to run the simulated annealing algorithm.
Released under the Apache License 2.0. See LICENSE file.