<jupyter_start><jupyter_text>PuLP TutorialSource: http://benalexkeen.com/linear-programming-with-python-and-pulp-part-2/<jupyter_code>import pulp
from pulp import solvers
my_lp_problem = pulp.LpProblem("My LP Problem", pulp.LpMaximize)
my_lp_problem.solver = solvers.GLPK()

x = pulp.LpVariable('x', lowBound=0, cat='Continuous')
y = pulp.LpVariable('y', lowBound=2, cat='Continuous')

# Objective function
my_lp_problem += 4 * x + 3 * y, "Z"

# Constraints
my_lp_problem += 2 * y <= 25 - x
my_lp_problem += 4 * y >= 2 * x - 8
my_lp_problem += y <= 2 * x - 5

my_lp_problem
my_lp_problem.solve()
pulp.LpStatus[my_lp_problem.status]
for variable in my_lp_problem.variables():
    print("{} = {}".format(variable.name, variable.varValue))
pulp.value(my_lp_problem.objective)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14962593516209477, 'fraction_numerical': 0.016209476309226933, 'mean_word_length': 5.636363636363637, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '638304', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 343, 'n_tokens_neox': 308, 'n_words': 59, 'path': '00_pulp.ipynb', 'repo_name': 'quatrope/simus', 'size': '802'}