gurobipy: Gurobi Optimizer is a mathematical optimization software library for solving mixed-integer linear and quadratic optimization problems
Project description
The Gurobi Optimizer is a mathematical optimization software library for solving mixed-integer linear and quadratic optimization problems.
This package comes with a trial license that allows you to solve problems of limited size. As a student or staff member of an academic institution you qualify for a free, full product license. For more information, see:
https://www.gurobi.com/academia/academic-program-and-licenses/
For a commercial evaluation, you can request an evaluation license.
Other useful resources to get started:
https://www.gurobi.com/documentation/
https://support.gurobi.com/hc/en-us/community/topics
A simple example:
# Solve the following MIP:
# maximize
# x + y + 2 z
# subject to
# x + 2 y + 3 z <= 4
# x + y >= 1
# x, y, z binary
import gurobipy as gp
# Create a new model
m = gp.Model()
# Create variables
x = m.addVar(vtype='B', name="x")
y = m.addVar(vtype='B', name="y")
z = m.addVar(vtype='B', name="z")
# Set objective function
m.setObjective(x + y + 2 * z, gp.GRB.MAXIMIZE)
# Add constraints
m.addConstr(x + 2 * y + 3 * z <= 4)
m.addConstr(x + y >= 1)
# Solve it!
m.optimize()
print(f"Optimal objective value: {m.objVal}")
print(f"Solution values: x={x.X}, y={y.X}, z={z.X}")
...: m.optimize()
Gurobi Optimizer version 11.0.0 build v11.0.0rc2 (linux64 - "Ubuntu 22.04.3 LTS")
CPU model: Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz, instruction set [SSE2|AVX]
Thread count: 2 physical cores, 4 logical processors, using up to 4 threads
Optimize a model with 2 rows, 3 columns and 5 nonzeros
Model fingerprint: 0x98886187
Variable types: 0 continuous, 3 integer (3 binary)
Coefficient statistics:
Matrix range [1e+00, 3e+00]
Objective range [1e+00, 2e+00]
Bounds range [1e+00, 1e+00]
RHS range [1e+00, 4e+00]
Found heuristic solution: objective 2.0000000
Presolve removed 2 rows and 3 columns
Presolve time: 0.02s
Presolve: All rows and columns removed
Explored 0 nodes (0 simplex iterations) in 0.02 seconds (0.00 work units)
Thread count was 1 (of 4 available processors)
Solution count 2: 3 2
Optimal solution found (tolerance 1.00e-04)
Best objective 3.000000000000e+00, best bound 3.000000000000e+00, gap 0.0000%
In [4]: print(f"Optimal objective value: {m.objVal}")
...: print(f"Solution values: x={x.X}, y={y.X}, z={z.X}")
Optimal objective value: 3.0
Solution values: x=1.0, y=0.0, z=1.0
Licensing information
GUROBI OPTIMIZATION, LLC END-USER LICENSE AGREEMENT (Evaluation License) (“Agreement”)
By downloading, installing, copying, accessing, clicking on an “accept” button or otherwise using the Product, You are accepting the terms of this Agreement. The Product will be enabled when You install the license key that is supplied to You by Gurobi or made available by Gurobi via ‘pip’. The “Effective Date” of this Agreement is the date on which the Product is enabled. The Product is copyrighted and licensed by Gurobi Optimization, LLC, a limited liability company, registered in Delaware (“Gurobi”).
THIS AGREEMENT IS A LEGAL CONTRACT BETWEEN YOU AND GUROBI. READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY BEFORE INSTALLING OR OTHERWISE ACCESSING OR USING THE PRODUCT. THE PRODUCT IS COPYRIGHTED AND IT IS LICENSED TO YOU UNDER THIS AGREEMENT, NOT SOLD TO YOU. BY INSTALLING OR OTHERWISE ACCESSING OR USING THE PRODUCT, YOU ACKNOWLEDGE, REPRESENT AND WARRANT THAT YOU HAVE READ THIS AGREEMENT, THAT YOU UNDERSTAND IT, THAT YOU HAVE FULL POWER AND AUTHORITY TO BIND YOURSELF AS AN INDIVIDUAL AND THE BUSINESS ENTITY ON WHOSE BEHALF YOU ARE INSTALLING, ACCESSING OR USING THE PRODUCT, THAT YOU ACCEPT AND AGREE TO BE BOUND BY ITS TERMS, AND THAT, UPON INSTALLING OR OTHERWISE ACCESSING OR USING THE PRODUCT, THIS AGREEMENT WILL BECOME BECOME THE BINDING LEGAL OBLIGATION OF YOU (AS AN INDIVIDUAL AND THE BUSINESS ENTITY ON WHOSE BEHALF YOU ARE INSTALLING, ACCESSING OR USING THE PRODUCT). IF AT ANY TIME YOU ARE NOT WILLING TO BE BOUND BY THE TERMS OF THIS AGREEMENT, YOU SHOULD TERMINATE THE INSTALLATION PROCESS, IMMEDIATELY CEASE AND REFRAIN FROM ACCESSING OR USING THE PRODUCT AND DELETE ANY COPIES OF THE PRODUCT YOU MAY HAVE. TERMS AND CONDITIONS
DEFINITIONS
1.1. “Product” means the limited, evaluation version of Gurobi Optimizer Version 11.0.0 or higher in the form of object code libraries, including all upgrades, new releases, modifications, enhancements, adaptations, copies and translations thereof. “You” and “Your” mean the individual who is installing, accessing or using the Product and the business entity on whose behalf such individual is installing, accessing or using the Product. Additional defined terms have the meaning ascribed to them in the body of this Agreement.
SCOPE OF RIGHTS
2.1. Grant of License. Gurobi grants You a limited, non-exclusive, non-transferrable, non-sublicensable, revocable license during the term of this Agreement to install and operate the Product in machine-readable form solely in a non-production environment for internal evaluation of the suitability of the Product for Your legitimate business needs (“Product License”). You may make a reasonable number of copies of the Product in machine- readable, object code form, for nonproductive backup purposes only.
2.2. Limitations on Use. For the avoidance of doubt, the Product License does not grant You any right to use the Product in a live production environment (i.e. non-test environment). Except as expressly set forth in Section 2.1, You will not use, copy, modify, or distribute the Product, or make any copy, adaptation, transcription, or merge any portion thereof, unless expressly authorized by Gurobi in a separate written agreement signed by an authorized representative of Gurobi. You will not reverse assemble, reverse compile, translate, or reverse engineer the Product. Your Product License may not be sold, transferred, leased, assigned, or sub-licensed without Gurobi’s prior written consent. If You copy or modify the Product in any way not expressly authorized by Gurobi in writing, Your Product License is automatically terminated. You will not use the Product for the benefit of any third party including as part of any service bureau, time sharing or third party training arrangement. You will not publish any benchmark testing results on the Product. You will not use the Product in violation of any law, rules or regulation. The license granted to You in Section 2.1 is conditioned upon Your strict compliance with all restrictions and obligations in this Section 2.2.
WARRANTIES; LIMITATION OF LIABILITY
3.1 Warranty Disclaimer. THE PRODUCT IS PROVIDED “AS IS,” AND GUROBI MAKES NO WARRANTIES, EXPRESS, IMPLIED, ARISING FROM COURSE OF DEALING OR USAGE OF TRADE, OR STATUTORY, AS TO THE PRODUCT, OR ANY MATTER WHATSOEVER. GUROBI DISCLAIMS ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, SATISFACTORY QUALITY, TITLE AND NON-INFRINGEMENT. THE PRODUCT LICENSED HEREUNDER IS AN EVALUATION VERSION OF GUROBI’S STANDARD PRODUCT. ACCORDINGLY, THE PRODUCT WILL HAVE CONSTRAINTS AND LIMITATIONS THAT LIMIT THE SIZE OF THE OPTIMIZATION PROBLEM THE PRODUCT IS ABLE TO SOLVE. FOR THE AVOIDANCE OF DOUBT, GUROBI HAS NO OBLIGATION TO PROVIDE ANY MAINTENANCE AND SUPPORT SERVICES, OR ANY OTHER SERVICES, UNDER THIS AGREEMENT.
3.2 Limitation of Liability. GUROBI SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES (INCLUDING FOR LOSS OF PROFITS, SAVINGS, REVENUE, OR USE, DAMAGED OR LOST FILES OR DATA, OR BUSINESS INTERRUPTION) IN CONNECTION WITH THIS AGREEMENT OR THE PRODUCT, REGARDLESS OF THE CAUSE OF ACTION OR CHARACTERIZATION OF THE DAMAGES, EVEN IF GUROBI HAS BEEN ADVISED OF THE POSSIBILITY OF THESE DAMAGES. GUROBI WILL NOT BE LIABLE FOR ANY DAMAGES FOR THE COST OF PROCUREMENT OF SUBSTITUTE SOFTWARE, GOODS OR SERVICES, OR FOR ANY LIABILITY TO YOU RELATING TO THIS AGREEMENT, REGARDLESS OF THE CAUSE OF ACTION OR CHARACTERIZATION OF THE DAMAGES. YOU ACKNOWLEDGE THAT THE PROVISIONS FOR LIMITATION OF LIABILITY DESCRIBED IN THIS AGREEMENT FORM AN ESSENTIAL BASIS OF THE BARGAIN BETWEEN THE PARTIES AND THAT GUROBI WOULD NOT BE WILLING TO ENTER THIS AGREEMENT WITHOUT THEM. THEREFORE, YOU AGREE TO THIS ALLOCATION OF RISK AND HEREBY WAIVE ANY RIGHT, THROUGH EQUITABLE RELIEF OR OTHERWISE, TO SUBSEQUENTLY SEEK A MODIFICATION OF THESE PROVISIONS OR ALLOCATION OF RISK.
3.3 Disabling Device. THE PRODUCT MAY CONTAIN A DISABLING DEVICE THAT WILL PREVENT IT FROM BEING USED AFTER THE TERM OF THIS AGREEMENT ENDS. YOU AGREE NOT TO TAMPER WITH THE DISABLING DEVICE OR THE PRODUCT. YOU SHOULD TAKE PRECAUTIONS TO AVOID ANY LOSS OF DATA THAT MIGHT RESULT WHEN THE PRODUCT CAN NO LONGER BE USED.
OWNERSHIP
4.1. Ownership. Gurobi shall have sole right, title, and interest in and to the Product and all documentation relating to the Product (including its development or its operation, testing or use, and all reports and copies created), and all intellectual property rights associated with the Product (including, without limitation, rights to copyrights, patents, trade secrets, and know-how). This Agreement does not provide You with title or ownership of the Product, but only a right of limited use pursuant to Section 2.1. If You are deemed to posses any rights in the Product, You hereby assign to Gurobi or all of such rights. To the extent Your rights are inalienable under applicable law, You hereby waive such rights in the Product and, if such waiver is deemed invalid, grant to Gurobi the exclusive, irrevocable, perpetual, worldwide, royalty free right to use, market, modify and grant licenses to the Product without identifying You or seeking Your consent.
TERM AND TERMINATION
5.1. Term. Unless earlier terminated, this Agreement and Your Product License commences on the Effective Date and terminates on the expiration date set forth in the license file that is included with the Product. Either party may immediately terminate Your Product License and this Agreement by delivery of written notice of termination to the other party.
5.2. Effects of Termination. Upon the expiration or termination of this Agreement, (i) You shall immediately cease using the Product; (ii) You shall irretrievably destroy all copies of the Product in Your possession or control or return such copies to Gurobi the other Party, and (iii) You shall certify in writing to Gurobi that You have returned or destroyed such copies of the Product, with no copies retained.
5.3 Survival. Notwithstanding the expiration or termination of this Agreement for any reason, the rights and duties of the parties under Sections 2.2 (Limitations on Use), 3 (Warranties; Limitation of Liability), 4 (Ownership), 5.2 (Effects of Termination), 5.3 (Survival), 6 (Export Controls), and 7 (General) shall survive such expiration or termination and remain in full force and effect.
EXPORT CONTROLS
6.1. Export Restrictions. The Product delivered to You under this Agreement is subject to U.S. export control laws and regulations and may also be subject to import and export laws of the jurisdiction in which it was obtained, if outside the U.S. You shall abide by all applicable export control laws, rules and regulations applicable to the Product and documentation. You agree that You will not export, re-export, or transfer the Product or documentation, in whole or in part, to any country, person, or entity subject to U.S. export restrictions. You specifically agree not to export, re- export, or transfer the Product or documentation (i) to any country to which the U.S. has embargoed or restricted the export of goods or services, or to any national of any such country, wherever located, who intends to transmit or transport the Product back to such country; (ii) to any person or entity who You know or have reason to know will utilize the Product or portion thereof in the design, development, production or use of nuclear, chemical or biological materials, facilities, or weapons; or (iii) to any person or entity who has been prohibited from participating in U.S. export transactions by any federal agency of the U.S. government.
GENERAL
7.1. Assignment. This Agreement shall not be assignable by You without the prior written consent of Gurobi.
7.2. Waiver of Construction Against the Drafter. This Agreement shall be interpreted in accordance with the plain meaning of its terms and not strictly for or against either of the parties to this Agreement.
7.3. Severability. In the event that any provision of this Agreement is found invalid or unenforceable pursuant to judicial decree or decision, the remainder of this Agreement shall remain valid and enforceable according to its terms. WITHOUT LIMITING THE FOREGOING, IT IS EXPRESSLY UNDERSTOOD AND AGREED THAT, IN THE EVENT ANY REMEDY HEREUNDER IS DETERMINED TO HAVE FAILED OF ITS ESSENTIAL PURPOSE, ALL OTHER LIMITATIONS OF LIABILITY AND EXCLUSION OF DAMAGES SET FORTH HEREIN SHALL REMAIN IN FULL FORCE AND EFFECT.
7.4. Notices. All notices or other communications required to be given under this Agreement shall be in writing and delivered either personally, by a reputable overnight courier service (e.g., FedEx or UPS), or by U.S. mail, certified, return receipt requested, postage prepaid, and addressed as provided in this Agreement or as otherwise requested by the receiving party. Notices delivered personally shall be effective upon delivery and notices delivered by courier or U.S, mail shall be effective upon their receipt by the party to whom they are addressed.
7.5. Governing Law.
7.5.1 This Agreement shall be governed by, and construed and enforced in accordance with the laws of the State of California as they apply to a contract made and performed in such state and as if entered into by the residents of such state.
7.5.2 In all cases, the United Nations Convention on the International Sale of Goods shall not apply. The parties also agree that the provisions of the Uniform Computer Information Transactions Act shall not apply.
7.6. Modifications and Waivers. This Agreement may not be modified except by a writing signed by authorized representatives of both parties. A waiver by either party of its rights hereunder shall not be binding unless contained in a writing signed by an authorized representative of the party waiving its rights. The non-enforcement or waiver of any provision on one occasion shall not constitute a waiver of such provision on any other occasion unless expressly agreed in writing. The parties agree that no use of trade or other regular practice or method of dealing between the parties shall be used to modify, interpret, supplement, or alter in any manner the terms of this Agreement.
7.7. Arbitration. Any controversy or claim arising out of or relating to this Agreement, or the breach thereof that fails to settle by mediation, shall be settled by binding arbitration administered by JAMS in accordance with its then current Commercial Arbitration Rules, and judgment on the award rendered by the arbitrator may be entered in any court having jurisdiction thereof. The arbitrator may award monetary damages, injunctive relief, rescission, restitution, costs and attorneys’ fees. The arbitration award shall be final and binding regardless of whether one of the parties fails or refuses to participate in the arbitration. The arbitrator shall not have the power to amend this Agreement in any respect. Notwithstanding the foregoing, the parties agree that this Section 7.7 does not apply to the breach of provisions set forth in Section 2.2 (Limitations on Use) and Section 4 (Ownership), and that either party may petition a court of law for injunctive relief and such other rights and remedies as it may have at law or equity against breaches of these sections.
7.8. Attorneys’ Fees. In the event of any dispute with respect to this Agreement, the prevailing party shall be entitled to reasonable attorneys’ fees and other costs and expenses incurred in resolving such dispute.
Rev. October 2020 4810-9864-2638.2
gurobipy: Gurobi Optimizer is a mathematical optimization software library for solving mixed-integer linear and quadratic optimization problems的更多相关文章
- CVE-2014-0160 Heartbleed Vul Analysis && OpenSSL Cryptographic Software Library Bug
目录 . Heartbleed漏洞简介 . 漏洞造成的风险和影响 . 漏洞的测试.POC . OpenSSL漏洞源代码分析 . 防御.修复方案 . 从漏洞中得到的攻防思考 1. Heartbleed漏 ...
- 学习笔记之Gurobi
Gurobi Optimization - The State-of-the-Art Mathematical Programming Solver http://www.gurobi.com/ind ...
- [转]BLAS简介
BLAS(Basic Linear Algebra Subprograms)是一组线性代数计算中通用的基本运算操作函数集合[1] .BLAS Technical (BLAST) Forum负责规范BL ...
- SCIP | 数学规划求解器SCIP超详细的使用教程
前言 小伙伴们大家好呀!继上次lp_solve规划求解器的推文出来以后,大家都期待着更多求解器的具体介绍和用法.小编哪敢偷懒,这不,赶在考试周之际,又在忙里偷闲中给大家送上一篇SCIP规划求解的推文教 ...
- yalmip + lpsolve + matlab 求解混合整数线性规划问题(MIP/MILP)
最近建立了一个网络流模型,是一个混合整数线性规划问题(模型中既有连续变量,又有整型变量).当要求解此模型的时候,发现matlab优化工具箱竟没有自带的可以求解这类问题的算法(只有bintprog求解器 ...
- [转]awsome c++
原文链接 Awesome C++ A curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny th ...
- Windows Python Extension Packages
备注: 1.先要安装wheel库:pip install wheel 2.下载wheel,切换至下载路径,然后安装:pip install wheel库名.whl Windows Python Ext ...
- 2016CVPR论文集
http://www.cv-foundation.org/openaccess/CVPR2016.py ORAL SESSION Image Captioning and Question Answe ...
- 数学规划求解器lp_solve超详细教程
前言 最近小编学了运筹学中的单纯形法.于是,很快便按奈不住跳动的心.这不得不让我拿起纸和笔思考着,一个至关重要的问题:如何用单纯形法装一个完备的13? 恰巧,在我坐在图书馆陷入沉思的时候,一位漂亮的小 ...
- CVPR2016 Paper list
CVPR2016 Paper list ORAL SESSIONImage Captioning and Question Answering Monday, June 27th, 9:00AM - ...
随机推荐
- base的含义及使用及与this的区别
C#中base关键字的几种用法 - bobob - 博客园 (cnblogs.com) C#构造函数里的base和this的区别 - 傲世狂枫 - 博客园 (cnblogs.com) 我的理解 1.在 ...
- 亚马逊aws_access_key_id和aws_secret_access_key利用
00X01 信息泄露 敏感信息泄露,例如环境变量.例如,为了配置AWS CLI,需要设置以下环境变量: $ export AWS_ACCESS_KEY_ID=AKISIOSFODNN7EXAMPLE ...
- 1.6K star!这个开源文本提取神器,5分钟搞定PDF/图片/Office文档!
嗨,大家好,我是小华同学,关注我们获得"最新.最全.最优质"开源项目和高效工作学习方法 Kreuzberg 是一个基于 Python 的文本提取库,支持从 PDF.图像.Offic ...
- 基于Kubernetes可扩展的Selenium 并行自动化测试部署及搭建(3)——基于k8s的selenium grid集群搭建
本篇主要讲解如何使用k8s搭建selenium grid集群 Selenium Grid集群部署 1. 首先我们将通过 Kubernetes 服务进行通信以到达hub和nodes.Kubernete ...
- 深入浅出了解生成模型-1:GAN模型原理以及代码实战
更加好排版:https://www.big-yellow-j.top/posts/2025/05/08/GAN.html 日常使用比较多的生成模型比如GPT/Qwen等这些大多都是"文生文& ...
- C#中扩展方法无法获得多态性的行为
在C#中,扩展方法(Extension Methods)是一种用于给现有类型添加新方法的技术.但是,扩展方法无法实现多态性的行为,因为它们是静态方法,它们的行为是在编译时确定的,而不是在运行时. 多态 ...
- 来个好玩的,用手机随时随地指挥你的 Cursor!
告别束缚,用手机随时随地指挥你的 Cursor! 嘿,各位 Cursor 的忠实用户和效率达人们! 你是否曾经遇到过这样的场景:人不在Mac旁边,却突然灵感迸发,想要让 Cursor 帮你写点代码.整 ...
- ArkUI-X添加到现有Android项目中
本教程主要讲述如何利用ArkUI-X SDK完成Android AAR开发,实现基于ArkTS的声明式开发范式在android平台显示.包括: 1.跨平台Library工程开发介绍 2.AAR在And ...
- 【拥抱鸿蒙】Flutter+Cursor轻松打造HarmonyOS应用(二)
这是[Flutter+Cursor轻松打造HarmonyOS应用]系列的第二篇.前一篇已经介绍了如何搭建Flutter鸿蒙应用开发环境,就让我们一起来看看如何借助Cursor让鸿蒙App开发更快更简单 ...
- 安全漏洞修复导致SpringBoot2.7与Springfox不兼容,问题排查与处理
开心一刻 2021,朋友某一次核酸检测,跟我聊天朋友:今天我们小区做核算,队长死了我:卧槽,过劳死吗朋友:?????我:啊?朋友:队 长死了,队伍很长!我:哈哈哈,我以为做核算的队长死了呢 背景介绍 ...