LP symbol returns incorrect value
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Run the attached lp.zip reproduction with Python, comparing scipy.optimize.linprog against dwave.optimization.linprog and their res.x/res.fun state values. Trace the LP result from that entry point and verify the reported objective and solution agree with SciPy for the supplied data; done means the reproduction no longer reports 47779.29074832177 versus 33603159.675.
Written by the indexing model from the issue text.
Description
import numpy as np
import scipy.optimize
import dwave.optimization
arrays = np.load("lp.npz")
c = arrays["c"]
A_ub = arrays["A_ub"]
b_ub = arrays["b_ub"]
A_eq = arrays["A_eq"]
b_eq = arrays["b_eq"]
lb = arrays["lb"]
ub = arrays["ub"]
# Solve it with scipy
res = scipy.optimize.linprog(
c=c,
A_ub=A_ub,
b_ub=b_ub,
A_eq=A_eq,
b_eq=b_eq,
bounds=list(zip(lb, ub)),
)
scipy_x = res.x
scipy_fun = res.fun
# Solve it with dwave-optimization
model = dwave.optimization.Model()
res = dwave.optimization.linprog(
c=model.constant(c),
A_ub=model.constant(A_ub),
b_ub=model.constant(b_ub),
A_eq=model.constant(A_eq),
b_eq=model.constant(b_eq),
lb=model.constant(lb),
ub=model.constant(ub),
)
_ = res.x
__ = res.fun
model.states.resize(1)
with model.lock():
dwopt_x = res.x.state()
dwopt_fun = res.fun.state()
print(scipy_fun, dwopt_fun)
47779.29074832177 33603159.675
- Dominant language
- C++
- Stars
- 31
- Forks
- 36
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dwavesystems/dwave-optimization
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dwavesystems/dwave-optimization#505 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in dwavesystems/dwave-optimization
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·