quicksum() and sum()
AnsweredIs there a difference between suing quicksum() and sum()? would it affect the results? or computational time? or intermediate results if a time limit was added?
-
Hi,
Yes, the \(\texttt{quicksum}\) is a gurobipy global function and the \(\texttt{sum}\) is a python function. The \(\texttt{quicksum}\) is a version of the \(\texttt{sum}\) function and it is faster for building large Gurobi expressions (see the documentation of the \(\texttt{quicksum}\) function for mode details)
The difference between the\(\texttt{quicksum}\) and \(\texttt{sum}\) functions affects the time it takes to build the model. It has no impact on the time it takes to optimize the model or the values of feasible/optimal solutions.
Best regards,
Maliheh
1
Please sign in to leave a comment.
Comments
1 comment