import time
from dwave.system import DWaveCliqueSampler, LeapHybridSampler

from qiskit.optimization.algorithms import CplexOptimizer

from random_lp.lp_random_gen import create_models
from utilities.helpers import create_dwave_meo

DIR = 'TEST_DATA' + "/" + "14_03_2021" + "/DENSE/"

# select linear program to solve
qps = create_models(DIR)
qp = qps['test_10']

# init Optimizers
cplex = CplexOptimizer()
leap = create_dwave_meo(LeapHybridSampler())
clique = create_dwave_meo(DWaveCliqueSampler())

# solve classically
cplex.solve(qp)

# solve hybrid
res_leap = leap.solve(qp)
res_leap

# solve quantum
res_clique = clique.solve(qp)
res_clique

qp.to_docplex().prettyprint()

