rust-or/rust-lp-modeler

lp_sum creates a linked list instead of a balanced tree

Closed this issue · 0 comments

lp_sum returns a deeply imbalanced expression tree of the form AddExpr(a, AddExpr(b, AddExpr(c, AddExpr(d)))), which then causes stack overflows when being processed by simplify (see #37).

lp_sum could return a balanced tree of depth log2(n) (instead of n), which would be less likely to cause stack overflows during processing.