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 - ...
随机推荐
- 银河麒麟系统 jenkins docker 部署 自动化打包部署git 项目
Jenkins 是一个开源的自动化服务器,主要用于实现 持续集成(CI) 和 持续交付/部署(CD),其核心作用在于通过自动化流程提升软件开发和交付的效率与质量 一.环境准备 1. 安装 Docker ...
- AI 在软件测试中的应用:2025 年趋势、工具及入门指南
引言 人工智能 (AI) 正在深刻地重塑软件开发和质量保证 (QA) 的各个方面.尤其是在软件测试领域,AI 不再仅仅是未来愿景,而是当下正在发生的变革.据世界质量报告(2023-24)指出,高达 7 ...
- MySQL中create_time 和 update_time实现自动更新时间
也是最近在捣鼓前后端分离项目, 在写后端接口的时候便设计到数据库表建设, 这里规范显得很重要. 通常的建表规范, 必备三字段:id,create_time,update_time. id 必为主键,类 ...
- Django Formsets总结
formset是将多个表单用在同一个页面上的抽象层. 我们有: from django import forms class ArticleForm(forms.Form): title=forms. ...
- 无列名注入_2 [GYCTF2020]Ezsqli 1
无列名注入_2 在之前,我们使用了select `1` from (select 1,2 union select * from tableX)a这样一个形式来进行无列名注入,原理可以看我之前写的(抄 ...
- Mysql数据类型TINYINT(1)与布尔型的坑
需求背景:从MySQL数据库读取1.2.3.4等阿拉伯数字定义的状态,并转换成Java中Integer类型的数据,但是转换失败了. 问题分析:布尔型 bool 或者 boolean 在My ...
- 转-Spring Data JPA中对象属性自动更新数据库
摘要:使用Spring Data JPA获取的对象,其属性变更后自动更新数据库问题排查与解决方案. §问题描述 使用继承了JpaRepository的Dao从数据库中获取到某个对象,然后操作这个对 ...
- 代码随想录第11天 | 二叉树part01
理论基础 需要了解 二叉树的种类,存储方式,遍历方式 以及二叉树的定义 文章讲解:https://programmercarl.com/%E4%BA%8C%E5%8F%89%E6%A0%91%E7 ...
- [CRCI2008-2009] CVJETICI
[CRCI2008-2009] CVJETICI 观察图片及样例一: 注:下文中的被占领,指的是在这一个区间内,才有交叉开花的可能. 第一张小图发现 $2 \sim 3$ 被占领. 第二张小图发现 $ ...
- cpp的lambda表达式
在C++中,lambda表达式提供了一种方便的方式来定义匿名函数.Lambda可以用来创建简单的函数对象,常用于算法库中的函数参数,特别是在STL(Standard Template Library) ...