<jupyter_start><jupyter_text>Solving a linear programming problem with PuLP<jupyter_code>import pulp<jupyter_output><empty_output><jupyter_text>Objective function$$z(max) = 5x_1 + 4x_2$$ Constraints:- $C_1 = x_1 + x_2 \leq 5$- $C_2 = 10*x_1 + 6*x_2 \leq 45$- $x_1,x_2 \geq 0$<jupyter_code>z = pulp.LpProblem('problem x', pulp.LpMaximize)
x1 = pulp.LpVariable('x1', lowBound=0)
x2 = pulp.LpVariable('x2', lowBound=0)
z += 5*x1 + 4*x2
z += 1*x1 + 1*x2 <= 5
z += 10*x1 + 6*x2 <= 45
z
pulp.LpStatus[z.solve()]
pulp.value(x1), pulp.value(x1), pulp.value(z.objective)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18104906937394247, 'fraction_numerical': 0.0727580372250423, 'mean_word_length': 6.132530120481928, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '389858', 'license': 'MIT', 'n_tokens_mistral': 307, 'n_tokens_neox': 277, 'n_words': 50, 'path': 'notebooks/PuLP/LP-Problem01.ipynb', 'repo_name': 'Ingenjoy/Linear-Programming-With-Python', 'size': '591'}