メインコンテンツへスキップ

How to show model equation from .mps file to Jupyter notebook?

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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.
  • Eli Towle
    • Gurobi Staff

    Gurobi's read() function reads the model file into a Model object. To print the content of a model file, use Python's built-in open() function:

    with open("Outputs/model_v1.mps", "r") as f:
    contents = f.read()

    print(contents)

    Write the model to the LP (or RLP) format if you want it to be human-readable.

    1
  • Tanmoy Das
    • Gurobi-versary
    • Investigator
    • Collaborator

    thanks so much. It works. 

    0

投稿コメントは受け付けていません。