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?
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
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
Post is closed for comments.
Comments
2 comments