Skip to content

Commit 0e0d515

Browse files
committed
update doc
1 parent 67a3ff7 commit 0e0d515

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

python/cuopt/cuopt/linear_programming/problem.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,23 @@ class Problem:
527527
Variable can be be created by calling addVariable()
528528
Constraints can be added by calling addConstraint()
529529
The objective can be set by calling setObjective()
530-
The problem data is formed when calling solve()
530+
The problem data is formed when calling solve().
531+
532+
Parameters
533+
----------
534+
model_name : str, optional
535+
Name of the model. Default is an empty string.
536+
537+
Examples
538+
--------
539+
>>> problem = problem.Problem("MIP_model")
540+
>>> x = problem.addVariable(lb=-2.0, ub=8.0, vtype=VType.INTEGER)
541+
>>> y = problem.addVariable(name="Var2")
542+
>>> problem.addConstraint(2*x - 3*y <= 10, name="Constr1")
543+
>>> expr = 3*x + y
544+
>>> problem.addConstraint(expr + x == 20, name="Constr2")
545+
>>> problem.setObjective(x + y, sense=sense.MAXIMIZE)
546+
>>> problem.solve()
531547
"""
532548

533549
def __init__(self, model_name=""):

0 commit comments

Comments
 (0)