Skip to main content

Runtime / Work vs Presolve

Answered

Comments

2 comments

  • David Torres Sanchez
    • Gurobi Staff

    Hi Dimi,

    The Runtime attribute does incorporate time spent in presolve (so does the Work attribute).
    You can see the time spent in the log. I don't think there is an easy way of extracting this otherwise.

    You could just compute the presolved model and time it using model.presolve():

    # populate model
    start = time.time()
    with model.presolve() as p:
    pass
    print(f"Presolve has taken {time.time()-start}s")

    Cheers, 
    David

    0
  • Dimi Defillet
    • Gurobi-versary
    • First Question
    • First Comment

    Ok, I see

    Thank you David!

    0

Please sign in to leave a comment.