diff --git a/7159CEM-Portfolio-main/ACO.ipynb b/7159CEM-Portfolio-main/ACO.ipynb index 2922284b..8865ed5b 100644 --- a/7159CEM-Portfolio-main/ACO.ipynb +++ b/7159CEM-Portfolio-main/ACO.ipynb @@ -349,14 +349,199 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "github test\n", - "............................................................\n", - "............................................................\n", - "............................................................\n", - "............................................................\n", - "............................................................\n", - "............................................................\n", - "```" + "The Ant Colony optimisation was successfully executed using the Sci-kit package, using the aca.run() function. \n", + "\n", + "## For n = 50 \n", + "\n", + "Results are as follows :- \n", + "\n", + "Cost of travel, Euclidean = 117.30634693659576\n", + "Cost of travel, Euclidean - Greedy= 124.5160306576604\n", + "Cost of travel for asymmetric graph is = 117\n", + "Cost of travel for asymmetric graph Greedy= 71\n", + "Cost of travel for symmetric graph is = 87\n", + "Cost of travel for symmetric graph Greedy= 81\n", + "\n", + "## Images of graphs and plots \n", + "\n", + "\n", + "$$ Euclidean \\space graph $$\n", + "\n", + "![title](ACO/EcuGraphn50.png)\n", + "\n", + "$$ Euclidean \\space Plot $$\n", + " \n", + "![title](ACO/Eucpltn50.png)\n", + "\n", + "\n", + "$$ Asymmetric \\space graph $$\n", + "\n", + "![title](ACO/Asygraph50.png)\n", + "\n", + "$$ Asymmetric \\space Plot $$\n", + " \n", + "![title](ACO/Asyplt50.png)\n", + "\n", + "\n", + "$$ Symmetric \\space graph $$\n", + "\n", + "![title](ACO/symgraph50.png)\n", + "\n", + "$$ Symmetric \\space Plot $$\n", + " \n", + "![title](ACO/symplt50.png)\n", + "\n", + "$$ $$ \n", + "\n", + "## For n = 100\n", + "\n", + "Results are as follows :- \n", + "\n", + "Cost of travel, Euclidean = 178.95818153604972\n", + "Cost of travel, Euclidean - Greedy= 206.00052858467922\n", + "Cost of travel for asymmetric graph is = 182\n", + "Cost of travel for asymmetric graph Greedy= 120\n", + "Cost of travel for symmetric graph is = 211\n", + "Cost of travel for symmetric graph Greedy= 132\n", + "\n", + "\n", + "$$ Euclidean \\space graph $$\n", + "\n", + "![title](ACO/EcuGraphn100.png)\n", + "\n", + "$$ Euclidean \\space Plot $$\n", + " \n", + "![title](ACO/Eucplt100.png)\n", + "\n", + "\n", + "$$ Asymmetric \\space graph $$\n", + "\n", + "![title](ACO/Asygraph100.png)\n", + "\n", + "$$ Asymmetric \\space Plot $$\n", + " \n", + "![title](ACO/Asyplt100.png)\n", + "\n", + "\n", + "$$ symmetric \\space graph $$\n", + "\n", + "![title](ACO/symgraph100.png)\n", + "\n", + "$$ symmetric \\space Plot $$\n", + " \n", + "![title](ACO/symplt100.png)\n", + "\n", + "\n", + "$$ $$ \n", + "\n", + "## For n = 150\n", + "\n", + "Results are as follows :- \n", + "\n", + "Cost of travel, Euclidean = 178.95818153604972\n", + "Cost of travel, Euclidean - Greedy= 206.00052858467922\n", + "Cost of travel for asymmetric graph is = 182\n", + "Cost of travel for asymmetric graph Greedy= 120\n", + "Cost of travel for symmetric graph is = 211\n", + "Cost of travel for symmetric graph Greedy= 132\n", + "\n", + "\n", + "$$ Euclidean \\space graph $$\n", + "\n", + "![title](ACO/Asygraph150.png)\n", + "\n", + "$$ Euclidean \\space Plot $$\n", + " \n", + "![title](ACO/Eucplt150.png)\n", + "\n", + "\n", + "$$ Asymmetric \\space graph $$\n", + "\n", + "![title](ACO/ecu(asy)graph150.png)\n", + "\n", + "$$ Asymmetric \\space Plot $$\n", + " \n", + "![title](ACO/asyplot150.png)\n", + "\n", + "\n", + "$$ Symmetric \\space graph $$\n", + "\n", + "![title](ACO/symgraph150.png)\n", + "\n", + "$$ Symmetric \\space Plot $$\n", + " \n", + "![title](ACO/symplot150.png)\n", + "\n", + "\n", + "## For n = 200\n", + "Results are as follows :- \n", + "Cost of travel, Euclidean = 287.6057902102739\n", + "Cost of travel, Euclidean - Greedy= 301.31792232560036\n", + "Cost of travel for asymmetric graph is = 242\n", + "Cost of travel for asymmetric graph Greedy= 220\n", + "Cost of travel for symmetric graph is = 210\n", + "Cost of travel for symmetric graph Greedy= 221\n", + "\n", + "$$ Euclidean \\space graph $$\n", + "\n", + "![title](ACO/Ecugraph200.png)\n", + "\n", + "$$ Euclidean \\space Plot $$\n", + "\n", + "![title](ACO/ecuplt200.png)\n", + "\n", + "$$ Asymmetric \\space graph $$\n", + "\n", + "![title](ACO/Asygrf200.png)\n", + "\n", + "$$ Asymmetric \\space Plot $$\n", + " \n", + "![title](ACO/Asyplt200.png)\n", + "\n", + "\n", + "$$ Symmetric \\space graph $$\n", + "\n", + "![title](ACO/symgrf200.png)\n", + "\n", + "$$ Symmetric \\space Plot $$\n", + " \n", + "![title](ACO/symplt200.png)\n", + "\n", + "\n", + "## For n = 250\n", + "Results are as follows :- \n", + "Cost of travel, Euclidean = 280.671643559593\n", + "Cost of travel, Euclidean - Greedy= 307.56913052707324\n", + "Cost of travel for asymmetric graph is = 221\n", + "Cost of travel for asymmetric graph Greedy= 225\n", + "Cost of travel for symmetric graph is = 422\n", + "Cost of travel for symmetric graph Greedy= 225\n", + "\n", + "$$ Euclidean \\space graph $$\n", + "\n", + "![title](ACO/Ecugrf250.png)\n", + "\n", + "$$ Euclidean \\space Plot $$\n", + "\n", + "![title](ACO/ecuplt250.png)\n", + "\n", + "$$ Asymmetric \\space graph $$\n", + "\n", + "![title](ACO/Asygrf250.png)\n", + "\n", + "$$ Asymmetric \\space Plot $$\n", + " \n", + "![title](ACO/Asyplt250.png)\n", + "\n", + "\n", + "$$ Symmetric \\space graph $$\n", + "\n", + "![title](ACO/symgrf250.png)\n", + "\n", + "$$ Symmetric \\space Plot $$\n", + " \n", + "![title](ACO/symplt250.png)\n", + "\n" ] }, { diff --git a/7159CEM-Portfolio-main/ACO/ASYGRF350.png b/7159CEM-Portfolio-main/ACO/ASYGRF350.png new file mode 100644 index 00000000..07e214a8 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/ASYGRF350.png differ diff --git a/7159CEM-Portfolio-main/ACO/ASYPLT350.png b/7159CEM-Portfolio-main/ACO/ASYPLT350.png new file mode 100644 index 00000000..add30ae9 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/ASYPLT350.png differ diff --git a/7159CEM-Portfolio-main/ACO/Asygrf.250.png b/7159CEM-Portfolio-main/ACO/Asygrf.250.png new file mode 100644 index 00000000..6348fae1 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Asygrf.250.png differ diff --git a/7159CEM-Portfolio-main/ACO/Asyplt200.png b/7159CEM-Portfolio-main/ACO/Asyplt200.png index 32a853bd..d6be6671 100644 Binary files a/7159CEM-Portfolio-main/ACO/Asyplt200.png and b/7159CEM-Portfolio-main/ACO/Asyplt200.png differ diff --git a/7159CEM-Portfolio-main/ACO/Asyplt250.png b/7159CEM-Portfolio-main/ACO/Asyplt250.png new file mode 100644 index 00000000..c24f0193 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Asyplt250.png differ diff --git a/7159CEM-Portfolio-main/ACO/Asyplt300.png b/7159CEM-Portfolio-main/ACO/Asyplt300.png new file mode 100644 index 00000000..154aad7c Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Asyplt300.png differ diff --git a/7159CEM-Portfolio-main/ACO/Dynamic.txt b/7159CEM-Portfolio-main/ACO/Dynamic.txt new file mode 100644 index 00000000..fa34c463 --- /dev/null +++ b/7159CEM-Portfolio-main/ACO/Dynamic.txt @@ -0,0 +1,81 @@ +def top_down(arr, n): + memo = {} + + # recursive top down memoized solution + def solve(i, j): + if i > j or i >= n or j < 0: + return 0 + + k = (i, j) + if k in memo: + return memo[k] + + # if the user chooses ith number, the opponent can choose from i+1th or jth number. + # if he chooses i+1th number, user is left with [i+2,j] range. + # if opp chooses jth number, then user is left with [i+1,j-1] range to choose from. + # Also opponent tries to choose + # in such a way that the user has minimum value left. + option1 = arr[i] + min(solve(i+2, j), solve(i+1, j-1)) + + # if user chooses jth number, opponent can choose ith number or j-1th number. + # if opp chooses ith number,user can choose in range [i+1,j-1]. + # if opp chooses j-1th number, user can choose in range [i,j-2]. + option2 = arr[j] + min(solve(i+1, j-1), solve(i, j-2)) + + # since the user wants to get maximum money + memo[k] = max(option1, option2) + return memo[k] + + return solve(0, n-1) + +def bot_up(arr, n): + + #Create a table to store + #solutions of subproblems + table = [[0 for i in range(n)] + for i in range(n)] + + # Fill table using above recursive + # formula. Note that the table is + # filled in diagonal fashion + # from diagonal elements to + # table[0][n-1] which is the result. + for gap in range(n): + for j in range(gap, n): + i = j - gap + + # Here x is value of F(i + 2, j), + # y is F(i + 1, j-1) and z is + # F(i, j-2) in above recursive + # formula + x = 0 + if((i + 2) <= j): + x = table[i + 2][j] + y = 0 + if((i + 1) <= (j - 1)): + y = table[i + 1][j - 1] + z = 0 + if(i <= (j - 2)): + z = table[i][j - 2] + table[i][j] = max(arr[i] + min(x, y), + arr[j] + min(y, z)) + return table[0][n - 1] + + + +# Test Code +list1 = [5, 3, 7, 10] +n = len(list1) +print('Maximum Profit of P1 using Top Down approach = ', top_down(list1, n)) + +print('Maximum Profit of P1 using Bottom Up approach = ', bot_up(list1, n)) + +list2 = [8, 15, 3, 7] +n = len(list2) +print('Maximum Profit of P1 using Top Down approach = ',top_down(list2, n)) +print('Maximum Profit of P1 using Bottom Up approach = ', bot_up(list2, n)) + +list3 = [20, 30, 2, 2, 2, 10] +n = len(list3) +print( 'Maximum Profit of P1 using Top Down approach = ',top_down(list3, n)) +print('Maximum Profit of P1 using Bottom Up approach = ', bot_up(list3, n)) \ No newline at end of file diff --git a/7159CEM-Portfolio-main/ACO/ECUGRF350.png b/7159CEM-Portfolio-main/ACO/ECUGRF350.png new file mode 100644 index 00000000..66a49fd4 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/ECUGRF350.png differ diff --git a/7159CEM-Portfolio-main/ACO/ECUPLT350.png b/7159CEM-Portfolio-main/ACO/ECUPLT350.png new file mode 100644 index 00000000..ee02a452 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/ECUPLT350.png differ diff --git a/7159CEM-Portfolio-main/ACO/Ecugrf200.png b/7159CEM-Portfolio-main/ACO/Ecugrf200.png new file mode 100644 index 00000000..3519ac00 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Ecugrf200.png differ diff --git a/7159CEM-Portfolio-main/ACO/Ecugrf250.png b/7159CEM-Portfolio-main/ACO/Ecugrf250.png new file mode 100644 index 00000000..ca98a32a Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Ecugrf250.png differ diff --git a/7159CEM-Portfolio-main/ACO/Ecugrf300.png b/7159CEM-Portfolio-main/ACO/Ecugrf300.png new file mode 100644 index 00000000..aa5b0127 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Ecugrf300.png differ diff --git a/7159CEM-Portfolio-main/ACO/Ecuplt200.png b/7159CEM-Portfolio-main/ACO/Ecuplt200.png index ccd92473..3162b70c 100644 Binary files a/7159CEM-Portfolio-main/ACO/Ecuplt200.png and b/7159CEM-Portfolio-main/ACO/Ecuplt200.png differ diff --git a/7159CEM-Portfolio-main/ACO/Ecuplt250.png b/7159CEM-Portfolio-main/ACO/Ecuplt250.png new file mode 100644 index 00000000..37ce29bd Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Ecuplt250.png differ diff --git a/7159CEM-Portfolio-main/ACO/Ecuplt300.png b/7159CEM-Portfolio-main/ACO/Ecuplt300.png new file mode 100644 index 00000000..7c3ebb90 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Ecuplt300.png differ diff --git a/7159CEM-Portfolio-main/ACO/LP note pad.txt b/7159CEM-Portfolio-main/ACO/LP note pad.txt new file mode 100644 index 00000000..689a28fa --- /dev/null +++ b/7159CEM-Portfolio-main/ACO/LP note pad.txt @@ -0,0 +1,38 @@ +# Import all classes of PuLP module +from pulp import * + +# Create the problem variable to contain the problem data +model = LpProblem("ToolsProblem", LpMaximize) + +# Create 3 variables Steel, Molding_machine, and Assembly_machine + +T1 = LpVariable("Tool1", 0, None, LpInteger) +T2 = LpVariable("Tool2", 0, None, LpInteger) +T3 = LpVariable("Tool3", 0, None, LpInteger) + +# Create maximize objective function +model += 0.13 * T1 + 0.1 * T2 + 0.12 * T3 + +#Constraints: + +model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 10000, "Steel" +model += 1*T1 + 1 * T2 + 1 * T3 <= 20000, "Molding_machine" +model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 9000, "Assembly_machine" + +#Demand limits: + +model += T1 <= 15000, "T1_DemandLimit" +model += T2 <= 16000, "T2_DemandLimit" +model += T3 <= 12000, "T3_DemandLimit" + +model.solve() + +for v in model.variables(): + print(v.name, "=", v.varValue) + +# print("T1 = ", T1.varValue) +# print("T2 = ", T2.varValue) +# print("T3 =" , T3.varValue) + + + diff --git a/7159CEM-Portfolio-main/ACO/SYMGRF350.png b/7159CEM-Portfolio-main/ACO/SYMGRF350.png new file mode 100644 index 00000000..5d92b59f Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/SYMGRF350.png differ diff --git a/7159CEM-Portfolio-main/ACO/SYMPLT350.png b/7159CEM-Portfolio-main/ACO/SYMPLT350.png new file mode 100644 index 00000000..36f786d6 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/SYMPLT350.png differ diff --git a/7159CEM-Portfolio-main/ACO/Symgrf250.png b/7159CEM-Portfolio-main/ACO/Symgrf250.png new file mode 100644 index 00000000..dfc7b437 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Symgrf250.png differ diff --git a/7159CEM-Portfolio-main/ACO/Symgrf300.png b/7159CEM-Portfolio-main/ACO/Symgrf300.png new file mode 100644 index 00000000..f7b02b37 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Symgrf300.png differ diff --git a/7159CEM-Portfolio-main/ACO/Symplt200.png b/7159CEM-Portfolio-main/ACO/Symplt200.png new file mode 100644 index 00000000..4b46e228 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Symplt200.png differ diff --git a/7159CEM-Portfolio-main/ACO/Symplt250.png b/7159CEM-Portfolio-main/ACO/Symplt250.png new file mode 100644 index 00000000..091e17c8 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Symplt250.png differ diff --git a/7159CEM-Portfolio-main/ACO/Symplt300.png b/7159CEM-Portfolio-main/ACO/Symplt300.png new file mode 100644 index 00000000..00a39514 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/Symplt300.png differ diff --git a/7159CEM-Portfolio-main/ACO/Tree's problem.txt b/7159CEM-Portfolio-main/ACO/Tree's problem.txt new file mode 100644 index 00000000..9650ba6f --- /dev/null +++ b/7159CEM-Portfolio-main/ACO/Tree's problem.txt @@ -0,0 +1,60 @@ +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt +import seaborn as sns +from sklearn.model_selection import train_test_split +from sklearn.tree import DecisionTreeClassifier +from sklearn import tree +from sklearn.metrics import accuracy_score +import warnings + +warnings.filterwarnings("ignore") + +data1 = pd.read_csv('datasets/weather.numeric.csv') +data2 = pd.read_csv('datasets/weather.nominal.csv') + + +X= data1.drop(columns=['play'], axis=1) + +y= data1['play'] + +X_train, X_test, y_train, y_test= train_test_split(X,y,test_size= 0.3) + +d1tree= DecisionTreeClassifier() +d1tree.fit(X_train,y_train) +predictions= d1tree.predict(X_test) + +tree.plot_tree(d1tree) +plt.show() + +from sklearn.metrics import classification_report, confusion_matrix +print("Accuracy:",accuracy_score(y_test,predictions)) + +print(confusion_matrix(y_test,predictions)) +print('\n') +print(classification_report(y_test,predictions)) + +from sklearn import preprocessing +string_to_int= preprocessing.LabelEncoder() #encode your data +data2=data2.apply(string_to_int.fit_transform) #fit and transform it + +#To divide our data into attribute set and Label: +feature_cols = ['outlook','temperature','humidity','windy'] +X = data2[feature_cols] #contains the attribute +y = data2.play #contains the label + +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30) + +d2tree =DecisionTreeClassifier(criterion="entropy", random_state=100) # create a classifier object +d2tree.fit(X_train, y_train) + +y_pred= d2tree.predict(X_test) + + +print("Accuracy:",accuracy_score(y_test, y_pred)) + +print(confusion_matrix(y_test, y_pred)) +print(classification_report(y_test, y_pred)) + +tree.plot_tree(d2tree) +plt.show() \ No newline at end of file diff --git a/7159CEM-Portfolio-main/ACO/asygrf200.png b/7159CEM-Portfolio-main/ACO/asygrf200.png new file mode 100644 index 00000000..b1bbbb41 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/asygrf200.png differ diff --git a/7159CEM-Portfolio-main/ACO/asygrf300.png b/7159CEM-Portfolio-main/ACO/asygrf300.png new file mode 100644 index 00000000..c1d331ca Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/asygrf300.png differ diff --git a/7159CEM-Portfolio-main/ACO/sym300.png b/7159CEM-Portfolio-main/ACO/sym300.png new file mode 100644 index 00000000..bbbf9a43 Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/sym300.png differ diff --git a/7159CEM-Portfolio-main/ACO/symgrf200.png b/7159CEM-Portfolio-main/ACO/symgrf200.png new file mode 100644 index 00000000..aa5a044f Binary files /dev/null and b/7159CEM-Portfolio-main/ACO/symgrf200.png differ diff --git a/7159CEM-Portfolio-main/DP.ipynb b/7159CEM-Portfolio-main/DP.ipynb index d7670055..3cf15e7a 100644 --- a/7159CEM-Portfolio-main/DP.ipynb +++ b/7159CEM-Portfolio-main/DP.ipynb @@ -101,15 +101,17 @@ "P2 intends to choose the coin which leaves P1 with minimal value.\n", "So, P1 can later collect the value $v_i + \\min(F(i+2, j), F(i+1, j-1))$. \n", "\n", - "#### 2) P1 chooses $v_j$ leaving $v_{....},\\ldots,v_{....}$ for P2 to choose from.\n", + "#### 2) P1 chooses $v_j$ leaving $v_{i},\\ldots,v_{j-1}$ for P2 to choose from.\n", "\n", "$$\n", - "\\underbrace{v_{....}, \\ldots, v_{....}}_\\text{P2}, v_j.\n", + "\\underbrace{v_{i}, \\ldots, v_{j-1}}_\\text{P2}, v_j.\n", "$$\n", "\n", - "P2 either chooses $v_{........}$, leaving $v_{....},\\ldots,v_{....}$, or $v_{....}$ leaving $v_{....},\\ldots,v_{....}$ for P1 to choose from.\n", + "P2 either chooses $v_{i}$, leaving $v_{i+1},\\ldots,v_{j-1}$, or $v_{vj-1}$ leaving $v_{i},\\ldots,v_{j-2}$ for P1 to choose from.\n", "P2 intends to choose the coin which leaves P1 with minimal value.\n", - "So, P1 can later collect the value $.....................$." + "So, \n", + "\n", + "#### P1 can later collect the value v_j+ (F(i+1,j-1), F(i,j-2)) " ] }, { diff --git a/7159CEM-Portfolio-main/LP.ipynb b/7159CEM-Portfolio-main/LP.ipynb index 73941d14..b9b3b7be 100644 --- a/7159CEM-Portfolio-main/LP.ipynb +++ b/7159CEM-Portfolio-main/LP.ipynb @@ -75,9 +75,9 @@ "\n", "|Variable name| Description |\n", "|-------------|------|\n", - "|||\n", - "|||\n", - "|||" + "|Tool 1 |Variable for T1|\n", + "|Tool 2|Variable for T2|\n", + "|Tool 3|Variable for T3" ] }, { @@ -88,7 +88,7 @@ "\n", "Profit formula (to be optimised):\n", "$$\n", - "....\n", + "Z=0.13T1+0.1T2+120T3\n", "$$" ] }, @@ -101,9 +101,9 @@ "\n", "$$\n", "\\begin{alignat*}{4}\n", - " &.... &\\leq .. \\\\\n", - " &.... &\\leq .. \\\\\n", - " &.... &\\leq .. \\\\\n", + " &1T1+0.7T2+0.6T3 &\\leq 10000 \\\\\n", + " &1T1+1T2+1T3 &\\leq 20000 \\\\\n", + " &0.3T1+0.5T2+0.4T3 &\\leq 9000 \\\\\n", "\\end{alignat*}\n", "$$\n", "\n", @@ -111,16 +111,16 @@ "\n", "$$\n", "\\begin{alignat*}{2}\n", - " &.... &\\leq .. \\\\\n", - " &.... &\\leq .. \\\\\n", - " &.... &\\leq .. \\\\\n", + " & T1 &\\leq 15000 \\\\\n", + " & T2 &\\leq 16000 \\\\\n", + " & T3 &\\leq 12000 \\\\\n", "\\end{alignat*}\n", "$$\n", "\n", "Non-negativity constraints:\n", "\n", "$$\n", - ".... \\geq ....\n", + "T1,T2,T3 \\geq 0\n", "$$" ] }, @@ -134,7 +134,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "1a5ec9b7", "metadata": { "ExecuteTime": { @@ -142,9 +142,55 @@ "start_time": "2022-10-25T11:37:42.007094Z" } }, - "outputs": [], + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with 'Python 3.11.0 64-bit' requires ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '\"c:/Users/Ali Ibrahim/AppData/Local/Programs/Python/Python311/python.exe\" -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], "source": [ - "import pulp" + "# Import all classes of PuLP module\n", + "from pulp import *\n", + "\n", + "# Create the problem variable to contain the problem data\n", + "model = LpProblem(\"ToolsProblem\", LpMaximize)\n", + "\n", + "# Create 3 variables Steel, Molding_machine, and Assembly_machine\n", + "\n", + "T1 = LpVariable(\"Tool1\", 0, None, LpInteger)\n", + "T2 = LpVariable(\"Tool2\", 0, None, LpInteger) \n", + "T3 = LpVariable(\"Tool3\", 0, None, LpInteger)\n", + "\n", + "# Create maximize objective function\n", + "model += 0.13 * T1 + 0.1 * T2 + 0.12 * T3 \n", + "\n", + "#Constraints:\n", + "\n", + "model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 10000, \"Steel\"\n", + "model += 1*T1 + 1 * T2 + 1 * T3 <= 20000, \"Molding_machine\"\n", + "model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 9000, \"Assembly_machine\"\n", + "\n", + "#Demand limits:\n", + "\n", + "model += T1 <= 15000, \"T1_DemandLimit\"\n", + "model += T2 <= 16000, \"T2_DemandLimit\"\n", + "model += T3 <= 12000, \"T3_DemandLimit\"\n", + "\n", + "#Non-Negativity constraints\n", + "model += T1 >= 0 \n", + "model += T2 >= 0 \n", + "model += T3 >= 0 \n", + "\n", + "model.solve()\n", + "\n", + "for v in model.variables():\n", + " print(v.name, \"=\", v.varValue)\n" ] }, { @@ -152,8 +198,35 @@ "execution_count": null, "id": "0a67ab32", "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mRunning cells with 'Python 3.11.0 64-bit' requires ipykernel package.\n", + "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", + "\u001b[1;31mCommand: '\"c:/Users/Ali Ibrahim/AppData/Local/Programs/Python/Python311/python.exe\" -m pip install ipykernel -U --user --force-reinstall'" + ] + } + ], + "source": [ + "Result - Optimal solution found\n", + "\n", + "Objective value: 1840.00000000\n", + "Enumerated nodes: 0\n", + "Total iterations: 0\n", + "Time (CPU seconds): 0.01\n", + "Time (Wallclock seconds): 0.01\n", + "\n", + "Option for printingOptions changed from normal to all\n", + "Total time (CPU seconds): 0.01 (Wallclock seconds): 0.01\n", + "\n", + "Tool1 = 0.0\n", + "Tool2 = 4000.0\n", + "Tool3 = 12000.0\n", + "PS C:\\Users\\Ali Ibrahim\\Downloads\\7159CEM-Portfolio-main>" + ] }, { "cell_type": "markdown", @@ -161,8 +234,34 @@ "metadata": {}, "source": [ "# Conclusion\n", + "By setting up the equations of optimized tools problem we have managed to set a program by usimg the pulp package. We were able to run optimization for the profit formula and the results where as follows: \n", + "\n", + "Maximum Profit : 1840\n", + "Tool1 : 0\n", + "Tool2 : 4000\n", + "Tool3: 12000\n", + "\n", + "The most critical resource in this problem is the steel as in the program it shows if you reduce the amount of steel available the profit reduces by more than it does for molding hours and assembly machine. \n", + "\n", + "As supported by the results below:\n", "\n", - "........" + "Setting steal to 1000 instead of 10000:\n", + "model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 1000, \"Steel\"\n", + "model += 1*T1 + 1 * T2 + 1 * T3 <= 20000, \"Molding_machine\"\n", + "model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 9000, \"Assembly_machine\"\n", + "Objective value: 199.93000000\n", + "\n", + "Setting Molding_machine to 2000 instead of 20000:\n", + "model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 10000, \"Steel\"\n", + "model += 1*T1 + 1 * T2 + 1 * T3 <= 2000, \"Molding_machine\"\n", + "model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 9000, \"Assembly_machine\"\n", + "\n", + "Setting Assembly machine to 900 instead of 9000:\n", + "model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 10000, \"Steel\"\n", + "model += 1*T1 + 1 * T2 + 1 * T3 <= 20000, \"Molding_machine\"\n", + "model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 900, \"Assembly_machine\"\n", + "Objective value: 390.00000000\n", + "\n" ] }, { @@ -172,13 +271,21 @@ "source": [ "# List of references\n", "\n", - "............." + "Tools options for solving optimization problems - Analytics Vidhya. (2021, December 12). Medium. https://medium.com/analytics-vidhya/tools-options-for-solving-optimization-problems-16b6ebde5d72\n", + "\n", + "Labonne, M. (2022, March 2). Introduction to Linear Programming in Python. Maxime Labonne. https://mlabonne.github.io/blog/linearoptimization/" ] + }, + { + "cell_type": "markdown", + "id": "a681afb7", + "metadata": {}, + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.11.0 64-bit", "language": "python", "name": "python3" }, @@ -192,7 +299,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.3" + "version": "3.11.0" }, "toc": { "base_numbering": 1, @@ -209,7 +316,7 @@ }, "vscode": { "interpreter": { - "hash": "6d1e45cadc3597bb8b6600530fbdf8c3eefe919a24ef54d9d32b318795b772e0" + "hash": "7eadeba057ae704edbaf2a5d36e1a3c010b6c58c5e264dda84bd57b2200bd279" } } }, diff --git a/7159CEM-Portfolio-main/RL.ipynb b/7159CEM-Portfolio-main/RL.ipynb index f3ae20ca..3e64e46a 100644 --- a/7159CEM-Portfolio-main/RL.ipynb +++ b/7159CEM-Portfolio-main/RL.ipynb @@ -139,7 +139,7 @@ " # @gradient: if True, use gradient based bandit algorithm\n", " # @gradient_baseline: if True, use average reward as baseline for gradient based bandit algorithm\n", "\n", - " def __init__(self, k_arm=12, epsilon=0.0, initial=0.0, step_size=0.1, sample_averages=False,\n", + " def __init__(self, k_arm=7, epsilon=0.0, initial=0.0, step_size=0.1, sample_averages=False,\n", " UCB_param=None, gradient=False, gradient_baseline=False, true_reward=0.0):\n", " self.k = k_arm\n", " self.step_size = step_size\n", @@ -237,9 +237,12 @@ "\n", "$$\n", "\n", - "Figure \\space 1\n", + "Figure \\space 1 \n", "\n", "$$\n", + "\n", + "For K-armed bandit, this is the 7-armed test bed\n", + "\n", "\n" ] }, @@ -254,7 +257,7 @@ }, "outputs": [], "source": [ - "def figure_2_1(k=12):\n", + "def figure_2_1(k=7):\n", " plt.figure(figsize=(12, 3))\n", " plt.violinplot(dataset=randn(200, k) + randn(k))\n", " plt.xlabel(\"Action\")\n", @@ -263,6 +266,22 @@ "figure_2_1()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Experiment 1\n", + "\n", + "The Aim of this experiment is to understand the K-Arm bandit problem and results of various Re-enforcement Learning Algorithms, in this experiment we study various greedy methods\n", + "\n", + "For K_arm = 7\n", + "\n", + "Max Time = 1000 and Max Runs = 300, Please see figure below. \n", + "\n", + "In the figure we see Average performance of ε-greedy action-value methods on the 10-armed testbed.\n", + "These data are averages over 300 runs with different bandit problems. We see comparisons of greedy method with the ε-greedy methods for ε = 0.10 and ε = 0.01, we see for optimum action the greedy approach took less time to find the optimum strategy." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -323,6 +342,18 @@ "figure_2_2(200, 10000)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Experiment 2\n", + "\n", + "In this experiment, we see The effect of optimistic initial action-value estimates on the 10-armed testbed.\n", + "Both methods used a constant step-size parameter = 0.1. we provide the optimistic initial values as q=5 to the greedy method and for ε=0.1 for ε-greedy method the initial value stays at 0. \n", + "\n", + "As seen in the figure below we see initially greedy method is better but over time of 1000, ε=0.1 method gives a lower % optimal action " + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -371,6 +402,17 @@ "figure_2_3()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Experiment 3\n", + "\n", + "In this experiment we repeat the same method as above, however we keep the step size as 0.1 for both methods with greedy and ε-greedy, on the bandit problem for a 10-armed bed\n", + "\n", + "As seen in the result below, ε-greedy approach reaches an optimum result quicker that the greedy method " + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -418,6 +460,17 @@ "figure_2_4()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Experiment 4\n", + "\n", + "In this experiment, we compare the average performance of UCB action selection on the 10-armed testbed. \n", + "\n", + "As seen in the results below, UCB generally performs better than ε-greedy action selection, except in the first k steps, when it selects randomly among the actions that are not tried before" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -468,6 +521,18 @@ "figure_2_5()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Experiment 5\n", + "\n", + "In this experiment, we see average performance of the gradient bandit algorithm with and without a reward\n", + "baseline on the 10-armed testbed when the q(a) are chosen to be near 4 rather than near zero.\n", + "\n", + "As seen in the figure below , with a gradient baseline present , the optimal action is reached quicker\n" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -533,6 +598,17 @@ "figure_2_6()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Summary \n", + "\n", + "In the below figure we see a summary of the different types bandit algorithms which we tested in the the experiments (K_arm = 7, Max Run = 330, Max time = 1000) above.\n", + "Each point is the average reward obtained over 330 steps with a particular algorithm at a\n", + "particular setting of its parameter." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -562,7 +638,8 @@ "source": [ "# Conclusion\n", "\n", - "........\n" + "The various reinforcement learning application was studied using the bandit algorithms with various experiments \n", + "\n" ] }, { @@ -571,7 +648,7 @@ "source": [ "# List of references\n", "\n", - ".............." + "Reinforcement Learing - An introduction (Sutton and Barto, 2018)\n" ] } ], diff --git a/7159CEM-Portfolio-main/RL.py b/7159CEM-Portfolio-main/RL.py index d95eadf6..9ad65abf 100644 --- a/7159CEM-Portfolio-main/RL.py +++ b/7159CEM-Portfolio-main/RL.py @@ -110,7 +110,7 @@ def simulate(runs, time, bandits): mean_rewards = rewards.mean(axis=1) return mean_best_action_counts, mean_rewards -def figure_2_1(k=12): +def figure_2_1(k=7): plt.figure(figsize=(12, 3)) plt.violinplot(dataset=randn(200, k) + randn(k)) plt.xlabel("Action") @@ -139,7 +139,7 @@ def figure_2_2(runs=MAX_RUNS, time=MAX_TIME): plt.ylabel('% optimal action') plt.legend() plt.show() -figure_2_2(200, 10000) +#figure_2_2(200, 10000) def figure_2_3(runs=MAX_RUNS, time=MAX_TIME): bandits = [] @@ -154,7 +154,7 @@ def figure_2_3(runs=MAX_RUNS, time=MAX_TIME): plt.ylabel('% optimal action') plt.legend() plt.show() -figure_2_3() +#figure_2_3() def figure_2_4(runs=MAX_RUNS, time=MAX_TIME): bandits = [] @@ -169,7 +169,7 @@ def figure_2_4(runs=MAX_RUNS, time=MAX_TIME): plt.ylabel('Average reward') plt.legend() plt.show() -figure_2_4() +#figure_2_4() def figure_2_5(runs=MAX_RUNS, time=MAX_TIME): bandits = [] @@ -187,7 +187,7 @@ def figure_2_5(runs=MAX_RUNS, time=MAX_TIME): plt.ylabel('% Optimal action') plt.legend() plt.show() -figure_2_5() +#figure_2_5() def figure_2_6(runs=MAX_RUNS, time=MAX_TIME): labels = ['epsilon-greedy', 'gradient bandit', @@ -219,4 +219,4 @@ def figure_2_6(runs=MAX_RUNS, time=MAX_TIME): plt.ylabel('Average reward') plt.legend() plt.show() -figure_2_6() \ No newline at end of file +#figure_2_6() \ No newline at end of file diff --git a/7159CEM-Portfolio-main/RLImages/Figure_1.png b/7159CEM-Portfolio-main/RLImages/Figure_1.png index 7bb24b9b..1f2d6612 100644 Binary files a/7159CEM-Portfolio-main/RLImages/Figure_1.png and b/7159CEM-Portfolio-main/RLImages/Figure_1.png differ diff --git a/LP.ipynb b/LP.ipynb deleted file mode 100644 index b9b3b7be..00000000 --- a/LP.ipynb +++ /dev/null @@ -1,325 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "5937b132", - "metadata": {}, - "source": [ - "# Tools making optimisation problem" - ] - }, - { - "cell_type": "markdown", - "id": "cbca808d", - "metadata": {}, - "source": [ - "AAA is a company that produces tools T1, T2 and T3. These are are made from steel, and the process involves molding the tools and then assembling them.\n", - "\n", - "The following table summarises the requirements and constraints:\n", - "\n", - "| | T1 | T2 | T3 | Availability |\n", - "|--------------------------|--------|--------|--------|--------------|\n", - "| Steel (kg) | 1 | 0.7 | 0.6 | 10,000 |\n", - "| Molding machine (hr) | 1 | 1 | 1 | 20,000 |\n", - "| Assembly machine (hr) | 0.3 | 0.5 | 0.4 | 9,000 |\n", - "| Demand limit (tools/day) | 15,000 | 16,000 | 12,000 | |\n", - "| Profit (£/1000 units) | 130 | 100 | 120 | |\n", - "\n", - "AAA would like to plan for the daily production of tools to maximise its profit.\n", - "In particular, we have the following questions:\n", - "\n", - "- How many of each type of the tools should AAA plan to produce per day?\n", - "- What is the expected total profit from this plan?\n", - "- Which resources are expected to be most critical in this plan?" - ] - }, - { - "cell_type": "markdown", - "id": "5f8a3431", - "metadata": {}, - "source": [ - "### Marking scheme\n", - "\n", - "|Item|Mark|\n", - "|:----|---:|\n", - "|**Mathematical formulation**:||\n", - "|Decision variables|/1|\n", - "|Profit formula|/1|\n", - "|Constraints|/2|\n", - "|Demand limits|/2|\n", - "|Non-negativity constraints|/1|\n", - "|**Solution**:||\n", - "|PuLP solution|/4|\n", - "|**Answers to AAA's questions**:||\n", - "|How many of each type of the tools should AAA plan to produce per day?|/3|\n", - "|What is the expected total profit from this plan?|/3|\n", - "|Which resources are expected to be most critical in this plan?|/3|\n", - "|||\n", - "|**Total**: |/20|\n" - ] - }, - { - "cell_type": "markdown", - "id": "0366a3fc", - "metadata": {}, - "source": [ - "## Mathematical formulation" - ] - }, - { - "cell_type": "markdown", - "id": "06aeba09", - "metadata": {}, - "source": [ - "Decision variables:\n", - "\n", - "|Variable name| Description |\n", - "|-------------|------|\n", - "|Tool 1 |Variable for T1|\n", - "|Tool 2|Variable for T2|\n", - "|Tool 3|Variable for T3" - ] - }, - { - "cell_type": "markdown", - "id": "56ab5cbe", - "metadata": {}, - "source": [ - "\n", - "Profit formula (to be optimised):\n", - "$$\n", - "Z=0.13T1+0.1T2+120T3\n", - "$$" - ] - }, - { - "cell_type": "markdown", - "id": "9b2ca564", - "metadata": {}, - "source": [ - "Constraints:\n", - "\n", - "$$\n", - "\\begin{alignat*}{4}\n", - " &1T1+0.7T2+0.6T3 &\\leq 10000 \\\\\n", - " &1T1+1T2+1T3 &\\leq 20000 \\\\\n", - " &0.3T1+0.5T2+0.4T3 &\\leq 9000 \\\\\n", - "\\end{alignat*}\n", - "$$\n", - "\n", - "Demand limits:\n", - "\n", - "$$\n", - "\\begin{alignat*}{2}\n", - " & T1 &\\leq 15000 \\\\\n", - " & T2 &\\leq 16000 \\\\\n", - " & T3 &\\leq 12000 \\\\\n", - "\\end{alignat*}\n", - "$$\n", - "\n", - "Non-negativity constraints:\n", - "\n", - "$$\n", - "T1,T2,T3 \\geq 0\n", - "$$" - ] - }, - { - "cell_type": "markdown", - "id": "94561b9d", - "metadata": {}, - "source": [ - "## Solution" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1a5ec9b7", - "metadata": { - "ExecuteTime": { - "end_time": "2022-10-25T11:37:42.147735Z", - "start_time": "2022-10-25T11:37:42.007094Z" - } - }, - "outputs": [ - { - "ename": "", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[1;31mRunning cells with 'Python 3.11.0 64-bit' requires ipykernel package.\n", - "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", - "\u001b[1;31mCommand: '\"c:/Users/Ali Ibrahim/AppData/Local/Programs/Python/Python311/python.exe\" -m pip install ipykernel -U --user --force-reinstall'" - ] - } - ], - "source": [ - "# Import all classes of PuLP module\n", - "from pulp import *\n", - "\n", - "# Create the problem variable to contain the problem data\n", - "model = LpProblem(\"ToolsProblem\", LpMaximize)\n", - "\n", - "# Create 3 variables Steel, Molding_machine, and Assembly_machine\n", - "\n", - "T1 = LpVariable(\"Tool1\", 0, None, LpInteger)\n", - "T2 = LpVariable(\"Tool2\", 0, None, LpInteger) \n", - "T3 = LpVariable(\"Tool3\", 0, None, LpInteger)\n", - "\n", - "# Create maximize objective function\n", - "model += 0.13 * T1 + 0.1 * T2 + 0.12 * T3 \n", - "\n", - "#Constraints:\n", - "\n", - "model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 10000, \"Steel\"\n", - "model += 1*T1 + 1 * T2 + 1 * T3 <= 20000, \"Molding_machine\"\n", - "model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 9000, \"Assembly_machine\"\n", - "\n", - "#Demand limits:\n", - "\n", - "model += T1 <= 15000, \"T1_DemandLimit\"\n", - "model += T2 <= 16000, \"T2_DemandLimit\"\n", - "model += T3 <= 12000, \"T3_DemandLimit\"\n", - "\n", - "#Non-Negativity constraints\n", - "model += T1 >= 0 \n", - "model += T2 >= 0 \n", - "model += T3 >= 0 \n", - "\n", - "model.solve()\n", - "\n", - "for v in model.variables():\n", - " print(v.name, \"=\", v.varValue)\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0a67ab32", - "metadata": {}, - "outputs": [ - { - "ename": "", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[1;31mRunning cells with 'Python 3.11.0 64-bit' requires ipykernel package.\n", - "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n", - "\u001b[1;31mCommand: '\"c:/Users/Ali Ibrahim/AppData/Local/Programs/Python/Python311/python.exe\" -m pip install ipykernel -U --user --force-reinstall'" - ] - } - ], - "source": [ - "Result - Optimal solution found\n", - "\n", - "Objective value: 1840.00000000\n", - "Enumerated nodes: 0\n", - "Total iterations: 0\n", - "Time (CPU seconds): 0.01\n", - "Time (Wallclock seconds): 0.01\n", - "\n", - "Option for printingOptions changed from normal to all\n", - "Total time (CPU seconds): 0.01 (Wallclock seconds): 0.01\n", - "\n", - "Tool1 = 0.0\n", - "Tool2 = 4000.0\n", - "Tool3 = 12000.0\n", - "PS C:\\Users\\Ali Ibrahim\\Downloads\\7159CEM-Portfolio-main>" - ] - }, - { - "cell_type": "markdown", - "id": "524021a2", - "metadata": {}, - "source": [ - "# Conclusion\n", - "By setting up the equations of optimized tools problem we have managed to set a program by usimg the pulp package. We were able to run optimization for the profit formula and the results where as follows: \n", - "\n", - "Maximum Profit : 1840\n", - "Tool1 : 0\n", - "Tool2 : 4000\n", - "Tool3: 12000\n", - "\n", - "The most critical resource in this problem is the steel as in the program it shows if you reduce the amount of steel available the profit reduces by more than it does for molding hours and assembly machine. \n", - "\n", - "As supported by the results below:\n", - "\n", - "Setting steal to 1000 instead of 10000:\n", - "model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 1000, \"Steel\"\n", - "model += 1*T1 + 1 * T2 + 1 * T3 <= 20000, \"Molding_machine\"\n", - "model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 9000, \"Assembly_machine\"\n", - "Objective value: 199.93000000\n", - "\n", - "Setting Molding_machine to 2000 instead of 20000:\n", - "model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 10000, \"Steel\"\n", - "model += 1*T1 + 1 * T2 + 1 * T3 <= 2000, \"Molding_machine\"\n", - "model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 9000, \"Assembly_machine\"\n", - "\n", - "Setting Assembly machine to 900 instead of 9000:\n", - "model += 1*T1 + 0.7 * T2 + 0.6 * T3 <= 10000, \"Steel\"\n", - "model += 1*T1 + 1 * T2 + 1 * T3 <= 20000, \"Molding_machine\"\n", - "model += 0.3*T1 + 0.5 * T2 + 0.4 * T3 <= 900, \"Assembly_machine\"\n", - "Objective value: 390.00000000\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "id": "57a444ba", - "metadata": {}, - "source": [ - "# List of references\n", - "\n", - "Tools options for solving optimization problems - Analytics Vidhya. (2021, December 12). Medium. https://medium.com/analytics-vidhya/tools-options-for-solving-optimization-problems-16b6ebde5d72\n", - "\n", - "Labonne, M. (2022, March 2). Introduction to Linear Programming in Python. Maxime Labonne. https://mlabonne.github.io/blog/linearoptimization/" - ] - }, - { - "cell_type": "markdown", - "id": "a681afb7", - "metadata": {}, - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.11.0 64-bit", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.0" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": false, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "vscode": { - "interpreter": { - "hash": "7eadeba057ae704edbaf2a5d36e1a3c010b6c58c5e264dda84bd57b2200bd279" - } - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}