Skip to content

Symmetry Makes Things Slow #21

@r-barnes

Description

@r-barnes

#19 uses cvxpy to abstract the MILP solver and #20 uses PuLP as an abstraction.

In #20, PuLP spends less time preprocessing (0.64s) than cvxpy (83s), but the problem PuLP generates takes CBC 402s to solve versus the 158s CBC takes to solve the problem cvxpy generates.

Both solve times can probably be substantially reduced by breaking symmetry.

Running

python3 setup.py test

on branches #19 and #20 gives the above run times.

The cvxpy branch (#19) passes the test_check_objective test while the PuLP branch (#20) fails this test with the error:

AssertionError: 1603.3299 != 1603.3298534939174 within 6 places (4.6506082526320824e-05 difference)

as we can see, the objective is (probably not) meaningfully different.

Therefore we can say that Gurobi, cvxpy+CBC, and PuLP+CBC all reach the same objective value. However, they disagree on the optimal solution. PuLP+CBC produces a control strategy that differs from Gurobi's in 22 of 359 (6.13%) elements. cvxpy+CBC produces a control strategy that differs from Gurobi's in 16 of 359 (4.46%) elements.

The strategies produced by all three approaches produce the same objective value, but otherwise differ. This implies that test problem, at least, has symmetries. Eliminating symmetries often accelerates time-to-solution. I wonder if we can find a way to do so here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions