Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cvxpy baseline #2

Merged
merged 4 commits into from
Aug 6, 2020
Merged

cvxpy baseline #2

merged 4 commits into from
Aug 6, 2020

Conversation

mlubin
Copy link
Member

@mlubin mlubin commented Jul 22, 2020

SCS small problem
Generation time (sec): 0.034108638763427734
Solve time (sec): 0.12061452865600586
Obj: 8.005443740647975

GLPK small problem
Generation time (sec): 0.01749873161315918
Solve time (sec): 0.022617578506469727
Obj: 8.005822076272054

SCS large problem
Generation time (sec): 26.563064336776733
Solve time (sec): 7.128708362579346
Obj: 84501.40218042108

GLPK large problem
Solve didn't finish (possibly hit the limit)
Generation time (sec): 28.236417055130005
Solve time (sec): 9.7221519947052
Obj: None

Compared with the numbers in #1, the MOI code is comfortably ahead. This is using the hard-to-read version of the assignment constraints (see the code for the three different versions).

The only anomaly is that with the same settings for the large problem, SCS solves in ~7 seconds under cvxpy, 17 seconds using the direct Julia API and 56 seconds under MOI.

@odow
Copy link
Member

odow commented Aug 6, 2020

Running (I modified the GLPK time limit)

customer_locations = np.random.rand(100) * 1000
for l in [1_000, 5_000, 10_000]:
    print("GLPK %s" % l)
    solve(cp.GLPK, num_facilities=100, num_customers=100, num_locations=l,
        customer_locations=customer_locations, glpk_tm_lim = 1)
    print("SCS %s" % l)
    solve(cp.SCS, num_facilities=100, num_customers=100, num_locations=l,
        customer_locations=customer_locations, scs_max_iters=1)
    print()

yields

GLPK 1000
Solve didn't finish (possibly hit the limit)
Generation time (sec): 1.4647347927093506
Solve time (sec): 0.2544288635253906
Obj: None
SCS 1000
Generation time (sec): 1.3463382720947266
Solve time (sec): 0.10071969032287598
Obj: -8372898.770989422

GLPK 5000
Solve didn't finish (possibly hit the limit)
Generation time (sec): 11.295827865600586
Solve time (sec): 1.35282564163208
Obj: None
SCS 5000
Generation time (sec): 10.679898023605347
Solve time (sec): 0.7139055728912354
Obj: None

GLPK 10000
Solve didn't finish (possibly hit the limit)
Generation time (sec): 30.249317407608032
Solve time (sec): 2.734602689743042
Obj: None
SCS 10000
Generation time (sec): 29.166401386260986
Solve time (sec): 1.4213383197784424
Obj: None

So we're comfortably beating CVXPY, even without the queued updates to MOI, GLPK, and SCS.

@odow odow merged commit fce2143 into master Aug 6, 2020
@odow odow deleted the cvxpy branch August 6, 2020 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants