Installing Anaconda/Gurobi: Python - M Pip Install Gurobipy Conda Install - C Gurobi Gurobi 9.5.0
Installing Anaconda/Gurobi: Python - M Pip Install Gurobipy Conda Install - C Gurobi Gurobi 9.5.0
Installing Anaconda/Gurobi: Python - M Pip Install Gurobipy Conda Install - C Gurobi Gurobi 9.5.0
1. Install Anaconda:
Download/Install Anaconda: https://docs.anaconda.com/anaconda/install/
Open Anaconda Navigator
Launch Jupiter Notebook
2. Download/Install Gurobi
https://www.gurobi.com/
Tuples are crucial to providing efficient and convenient access to Gurobi decision variables in
Gurobi Python programs. Lists and tuples are both just ordered collections of Python objects. A
list is created and displayed as a comma-separated list of member objects, enclosed in square
brackets. A tuple is similar, except that the member objects are enclosed in parenthesis. For
example, [1, 2, 3] is a list, while (1, 2, 3) is a tuple.
A tuple is immutable, meaning that you can’t modify it once it has been created. By contrast, you
can add new members to a list, remove members, change existing members, etc. This immutable
property allows you to use tuples as indices for dictionaries.
Sets: A set is an unordered collection with no duplicate elements. Set objects also support
mathematical operations like union, intersection, difference, and symmetric difference.
A Python dictionary allows you to map arbitrary key values to pieces of data. It is best to think of
a dictionary as a set of key: value pairs, with the requirement that the keys are unique (within one
dictionary). A pair of braces creates an empty dictionary: {}. Placing a comma-separated list of
key: value pairs within the braces adds initial key: value pairs to the dictionary; this is also the
way dictionaries are written on output.
Gurobi included a utility routine in the Gurobi Python interface that simplifies dictionary
initialization for a case that arises frequently in mathematical modeling. The multidict function
allows you to initialize one or more dictionaries in a single statement. The function takes a
dictionary as its argument, where the value associated with each key is a list of length n. The
function splits these lists into individual entries, creating n separate dictionaries. The function
returns a list. The first result is the list of shared key values, followed by the n individual
dictionaries: