master-thesis/Evaluation/ManualRecipes.ipynb
2020-01-18 22:20:50 +01:00

3418 lines
210 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Manual Recipe Creation based on Popular Yummly Recipes"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"sys.path.append(\"../\")\n",
"sys.path.append(\"../EvolutionaryAlgorithm/\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" <script type=\"text/javascript\">\n",
" window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
" if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
" if (typeof require !== 'undefined') {\n",
" require.undef(\"plotly\");\n",
" requirejs.config({\n",
" paths: {\n",
" 'plotly': ['https://cdn.plot.ly/plotly-latest.min']\n",
" }\n",
" });\n",
" require(['plotly'], function(Plotly) {\n",
" window._Plotly = Plotly;\n",
" });\n",
" }\n",
" </script>\n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
" <script type=\"text/javascript\">\n",
" window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
" if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
" if (typeof require !== 'undefined') {\n",
" require.undef(\"plotly\");\n",
" requirejs.config({\n",
" paths: {\n",
" 'plotly': ['https://cdn.plot.ly/plotly-latest.min']\n",
" }\n",
" });\n",
" require(['plotly'], function(Plotly) {\n",
" window._Plotly = Plotly;\n",
" });\n",
" }\n",
" </script>\n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"../EvolutionaryAlgorithm/EvolutionaryAlgorithm.py:60: TqdmExperimentalWarning:\n",
"\n",
"Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n",
"\n"
]
}
],
"source": [
"import EvolutionaryAlgorithm as EA"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"def ingredient_nodes(ing_list):\n",
" d = {}\n",
" for ing in ing_list:\n",
" d[ing] = EA.IngredientNode(ing)\n",
" return d"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {},
"outputs": [],
"source": [
"def act(d, act, ing):\n",
" a = EA.ActionNode(act)\n",
" \n",
" p_a = d[ing]\n",
" \n",
" while p_a.parent() is not None:\n",
" p_a = p_a.parent()\n",
" \n",
" a.add_child(p_a)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"def mix(d, ing_a, ing_b):\n",
" p_a = d[ing_a]\n",
" p_b = d[ing_b]\n",
" \n",
" while p_a.parent() is not None:\n",
" p_a = p_a.parent()\n",
" while p_b.parent() is not None:\n",
" p_b = p_b.parent()\n",
" \n",
" m = EA.MixNode()\n",
" m.add_child(p_a)\n",
" m.add_child(p_b)\n",
" \n",
" "
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"def get_root(d):\n",
" parents = set()\n",
" for n in d:\n",
" p = d[n]\n",
" while p.parent() is not None:\n",
" p = p.parent()\n",
" parents.add(p)\n",
" \n",
" pp = list(parents)\n",
" if len(pp) == 1:\n",
" pp[0].simplify()\n",
" return pp[0]\n",
" \n",
" m = EA.MixNode()\n",
" for p in pp:\n",
" m.add_child(p)\n",
" m.simplify()\n",
" return m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Easy Fried Rice\n",
"https://www.yummly.com/recipe/Easy-Fried-Rice-2306391#directions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Ingredients"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"1050pt\" height=\"629pt\"\n",
" viewBox=\"0.00 0.00 1049.71 628.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 624.7351)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-624.7351 1045.7056,-624.7351 1045.7056,4 -4,4\"/>\n",
"<!-- 260 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>260</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"607.8528,-620.7351 487.8528,-584.7351 607.8528,-548.7351 727.8528,-584.7351 607.8528,-620.7351\"/>\n",
"<text text-anchor=\"start\" x=\"594.3528\" y=\"-588.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"598.3528\" y=\"-588.5351\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"555.8528\" y=\"-574.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.8947</text>\n",
"</g>\n",
"<!-- 246 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>246</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"285.8528\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"266.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"270.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">whisk</text>\n",
"<text text-anchor=\"start\" x=\"233.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 260&#45;&gt;246 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>260&#45;&gt;246</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M548.0417,-566.6328C493.4544,-550.1115 412.7682,-525.6912 355.3399,-508.31\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"356.2013,-504.914 345.6161,-505.3671 354.1734,-511.6139 356.2013,-504.914\"/>\n",
"</g>\n",
"<!-- 244 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>244</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"504.8528,-505.2792 388.8528,-505.2792 388.8528,-469.2792 504.8528,-469.2792 504.8528,-505.2792\"/>\n",
"<text text-anchor=\"start\" x=\"414.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"418.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">sesame oil</text>\n",
"<text text-anchor=\"start\" x=\"396.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 260&#45;&gt;244 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>260&#45;&gt;244</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M568.0551,-560.6449C542.8432,-545.3837 510.403,-525.7472 485.4295,-510.6303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"486.9611,-507.4661 476.5938,-505.2819 483.3362,-513.4545 486.9611,-507.4661\"/>\n",
"</g>\n",
"<!-- 259 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>259</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"607.8528\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"596.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"600.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">fry</text>\n",
"<text text-anchor=\"start\" x=\"555.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3750</text>\n",
"</g>\n",
"<!-- 260&#45;&gt;259 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>260&#45;&gt;259</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M607.8528,-548.723C607.8528,-540.3356 607.8528,-531.4077 607.8528,-523.0316\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"611.3529,-522.799 607.8528,-512.799 604.3529,-522.7991 611.3529,-522.799\"/>\n",
"</g>\n",
"<!-- 238 -->\n",
"<g id=\"node20\" class=\"node\">\n",
"<title>238</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"826.8528,-505.2792 710.8528,-505.2792 710.8528,-469.2792 826.8528,-469.2792 826.8528,-505.2792\"/>\n",
"<text text-anchor=\"start\" x=\"756.3528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"760.3528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"718.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 260&#45;&gt;238 -->\n",
"<g id=\"edge19\" class=\"edge\">\n",
"<title>260&#45;&gt;238</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M647.6506,-560.6449C672.8624,-545.3837 705.3026,-525.7472 730.2761,-510.6303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"732.3695,-513.4545 739.1118,-505.2819 728.7446,-507.4661 732.3695,-513.4545\"/>\n",
"</g>\n",
"<!-- 239 -->\n",
"<g id=\"node21\" class=\"node\">\n",
"<title>239</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"960.8528,-505.2792 844.8528,-505.2792 844.8528,-469.2792 960.8528,-469.2792 960.8528,-505.2792\"/>\n",
"<text text-anchor=\"start\" x=\"880.3528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"884.3528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"852.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 260&#45;&gt;239 -->\n",
"<g id=\"edge20\" class=\"edge\">\n",
"<title>260&#45;&gt;239</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M668.1677,-566.7178C714.3081,-552.6864 779.391,-532.3581 835.8528,-512.7351 839.5166,-511.4617 843.2816,-510.1211 847.0687,-508.7483\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"848.3033,-512.0236 856.4833,-505.2902 845.8897,-505.4528 848.3033,-512.0236\"/>\n",
"</g>\n",
"<!-- 234 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>234</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"343.8528,-407.8234 227.8528,-407.8234 227.8528,-371.8234 343.8528,-371.8234 343.8528,-407.8234\"/>\n",
"<text text-anchor=\"start\" x=\"273.8528\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"277.8528\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">egg</text>\n",
"<text text-anchor=\"start\" x=\"235.8528\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 246&#45;&gt;234 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>246&#45;&gt;234</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M285.8528,-461.6738C285.8528,-448.324 285.8528,-431.9598 285.8528,-418.2222\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"289.3529,-417.8758 285.8528,-407.8758 282.3529,-417.8759 289.3529,-417.8758\"/>\n",
"</g>\n",
"<!-- 258 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>258</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"607.8528,-425.8234 487.8528,-389.8234 607.8528,-353.8234 727.8528,-389.8234 607.8528,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"594.3528\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"598.3528\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"555.8528\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.9545</text>\n",
"</g>\n",
"<!-- 259&#45;&gt;258 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>259&#45;&gt;258</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M607.8528,-461.6738C607.8528,-453.8102 607.8528,-444.9007 607.8528,-436.0982\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"611.3529,-435.883 607.8528,-425.883 604.3529,-435.883 611.3529,-435.883\"/>\n",
"</g>\n",
"<!-- 254 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>254</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"312.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"295.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"299.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">saute</text>\n",
"<text text-anchor=\"start\" x=\"260.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 258&#45;&gt;254 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>258&#45;&gt;254</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M550.6241,-370.9174C501.6698,-354.7449 431.1599,-331.4513 379.6367,-314.4302\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"380.5155,-311.0345 369.9223,-311.2209 378.3197,-317.6812 380.5155,-311.0345\"/>\n",
"</g>\n",
"<!-- 242 -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>242</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"531.8528,-310.3675 415.8528,-310.3675 415.8528,-274.3675 531.8528,-274.3675 531.8528,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"444.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"448.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">soy sauce</text>\n",
"<text text-anchor=\"start\" x=\"423.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 258&#45;&gt;242 -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>258&#45;&gt;242</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M572.6459,-364.218C552.2909,-349.4142 526.8393,-330.9037 506.8676,-316.3786\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"508.8206,-313.4712 498.6746,-310.42 504.7033,-319.1324 508.8206,-313.4712\"/>\n",
"</g>\n",
"<!-- 243 -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>243</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"665.8528,-310.3675 549.8528,-310.3675 549.8528,-274.3675 665.8528,-274.3675 665.8528,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"570.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"574.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">oyster sauce</text>\n",
"<text text-anchor=\"start\" x=\"557.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 258&#45;&gt;243 -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>258&#45;&gt;243</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M607.8528,-353.8113C607.8528,-342.8653 607.8528,-330.9988 607.8528,-320.6395\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"611.3529,-320.4912 607.8528,-310.4912 604.3529,-320.4912 611.3529,-320.4912\"/>\n",
"</g>\n",
"<!-- 248 -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>248</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"768.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"754.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"758.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">slice</text>\n",
"<text text-anchor=\"start\" x=\"716.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 258&#45;&gt;248 -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>258&#45;&gt;248</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M647.6506,-365.7332C670.2748,-352.0384 698.7196,-334.8203 722.3664,-320.5065\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"724.4298,-323.3488 731.1722,-315.1762 720.8049,-317.3604 724.4298,-323.3488\"/>\n",
"</g>\n",
"<!-- 247 -->\n",
"<g id=\"node18\" class=\"node\">\n",
"<title>247</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"956.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"940.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"944.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"904.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 258&#45;&gt;247 -->\n",
"<g id=\"edge17\" class=\"edge\">\n",
"<title>258&#45;&gt;247</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M670.247,-372.4002C730.4528,-355.5882 821.534,-330.1544 884.7995,-312.4879\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"886.0152,-315.7824 894.7053,-309.7218 884.1325,-309.0404 886.0152,-315.7824\"/>\n",
"</g>\n",
"<!-- 253 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>253</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"312.8528,-230.9117 192.8528,-194.9117 312.8528,-158.9117 432.8528,-194.9117 312.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"299.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"303.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"260.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 254&#45;&gt;253 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>254&#45;&gt;253</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M312.8528,-266.7622C312.8528,-258.8985 312.8528,-249.989 312.8528,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"316.3529,-240.9713 312.8528,-230.9713 309.3529,-240.9714 316.3529,-240.9713\"/>\n",
"</g>\n",
"<!-- 245 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>245</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"69.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"73.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">melt</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 253&#45;&gt;245 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>253&#45;&gt;245</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M263.099,-173.645C227.707,-158.5171 180.0487,-138.1462 142.9167,-122.2745\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"144.2879,-119.0544 133.717,-118.3422 141.5365,-125.491 144.2879,-119.0544\"/>\n",
"</g>\n",
"<!-- 235 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>235</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"303.8528,-115.4558 187.8528,-115.4558 187.8528,-79.4558 303.8528,-79.4558 303.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"233.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"237.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pea</text>\n",
"<text text-anchor=\"start\" x=\"195.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 253&#45;&gt;235 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>253&#45;&gt;235</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M292.2039,-164.8765C283.2067,-151.7895 272.7518,-136.5822 264.0509,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"266.8964,-121.887 258.347,-115.6294 261.1281,-125.8527 266.8964,-121.887\"/>\n",
"</g>\n",
"<!-- 236 -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>236</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"437.8528,-115.4558 321.8528,-115.4558 321.8528,-79.4558 437.8528,-79.4558 437.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"359.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"363.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">carrot</text>\n",
"<text text-anchor=\"start\" x=\"329.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.5000</text>\n",
"</g>\n",
"<!-- 253&#45;&gt;236 -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>253&#45;&gt;236</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M333.5017,-164.8765C342.4989,-151.7895 352.9538,-136.5822 361.6547,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"364.5775,-125.8527 367.3587,-115.6294 358.8092,-121.887 364.5775,-125.8527\"/>\n",
"</g>\n",
"<!-- 237 -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>237</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"571.8528,-115.4558 455.8528,-115.4558 455.8528,-79.4558 571.8528,-79.4558 571.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"478.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"482.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">garlic clove</text>\n",
"<text text-anchor=\"start\" x=\"463.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.5000</text>\n",
"</g>\n",
"<!-- 253&#45;&gt;237 -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>253&#45;&gt;237</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M358.9663,-172.5533C391.457,-156.8001 434.8002,-135.7849 467.3723,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"469.2113,-122.9903 476.6824,-115.4781 466.1573,-116.6916 469.2113,-122.9903\"/>\n",
"</g>\n",
"<!-- 233 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>233</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"142.8528,-36 26.8528,-36 26.8528,0 142.8528,0 142.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"64.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"68.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">butter</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.7778</text>\n",
"</g>\n",
"<!-- 245&#45;&gt;233 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>245&#45;&gt;233</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M84.8528,-71.8782C84.8528,-63.7122 84.8528,-54.6289 84.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"88.3529,-46.2287 84.8528,-36.2288 81.3529,-46.2288 88.3529,-46.2287\"/>\n",
"</g>\n",
"<!-- 241 -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>241</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"826.8528,-212.9117 710.8528,-212.9117 710.8528,-176.9117 826.8528,-176.9117 826.8528,-212.9117\"/>\n",
"<text text-anchor=\"start\" x=\"750.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"754.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"718.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 248&#45;&gt;241 -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>248&#45;&gt;241</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M768.8528,-266.7622C768.8528,-253.4123 768.8528,-237.0481 768.8528,-223.3105\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"772.3529,-222.9641 768.8528,-212.9642 765.3529,-222.9642 772.3529,-222.9641\"/>\n",
"</g>\n",
"<!-- 240 -->\n",
"<g id=\"node19\" class=\"node\">\n",
"<title>240</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"1014.8528,-212.9117 898.8528,-212.9117 898.8528,-176.9117 1014.8528,-176.9117 1014.8528,-212.9117\"/>\n",
"<text text-anchor=\"start\" x=\"943.8528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"947.8528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">rice</text>\n",
"<text text-anchor=\"start\" x=\"906.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 247&#45;&gt;240 -->\n",
"<g id=\"edge18\" class=\"edge\">\n",
"<title>247&#45;&gt;240</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M956.8528,-266.7622C956.8528,-253.4123 956.8528,-237.0481 956.8528,-223.3105\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"960.3529,-222.9641 956.8528,-212.9642 953.3529,-222.9642 960.3529,-222.9641\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bd3729850>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * onion\n",
" * salt\n",
" * garlic clove\n",
" * oyster sauce\n",
" * egg\n",
" * soy sauce\n",
" * carrot\n",
" * rice\n",
" * sesame oil\n",
" * butter\n",
" * pea\n",
" * pepper\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | melt butter and mix it with pea, carrot and garlic clove. Then saute it. |\n",
"| 2 | slice onion, cook rice and mix it with soy sauce and oyster sauce and mix it together with the results of step 1. Then fry it. |\n",
"| 3 | whisk egg and mix it with sesame oil, salt and pepper and mix it together with the results of step 2. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# ingredients:\n",
"\n",
"d = ingredient_nodes([\n",
" \"butter\",\n",
" \"egg\",\n",
" \"pea\",\n",
" \"carrot\",\n",
" \"garlic clove\",\n",
" \"salt\",\n",
" \"pepper\",\n",
" \"rice\",\n",
" \"onion\",\n",
" \"soy sauce\",\n",
" \"oyster sauce\",\n",
" \"sesame oil\"\n",
"])\n",
"\n",
"# actions\n",
"\n",
"act(d, \"melt\", \"butter\")\n",
"act(d, \"whisk\", \"egg\")\n",
"act(d, \"cook\", \"rice\")\n",
"act(d, \"slice\", \"onion\")\n",
"mix(d, \"salt\", \"egg\")\n",
"mix(d, \"pepper\", \"egg\")\n",
"mix(d, \"butter\", \"garlic clove\")\n",
"mix (d, \"pea\", \"butter\")\n",
"mix (d, \"carrot\", \"butter\")\n",
"act(d, \"saute\", \"butter\")\n",
"mix (d, \"butter\", \"rice\")\n",
"mix (d, \"butter\", \"onion\")\n",
"mix (d, \"soy sauce\", \"butter\")\n",
"mix (d, \"oyster sauce\", \"butter\")\n",
"act(d, \"fry\", \"rice\")\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Easy Lazy Day Lasagna\n",
"https://www.momontimeout.com/lazy-day-lasagna/?utm_campaign=yummly"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"723pt\" height=\"521pt\"\n",
" viewBox=\"0.00 0.00 723.00 520.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 516.7351)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-516.7351 719,-516.7351 719,4 -4,4\"/>\n",
"<!-- 274 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>274</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"362\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"346\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"350\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bake</text>\n",
"<text text-anchor=\"start\" x=\"310\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 273 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>273</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"362,-425.8234 242,-389.8234 362,-353.8234 482,-389.8234 362,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"348.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"352.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"310\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.9286</text>\n",
"</g>\n",
"<!-- 274&#45;&gt;273 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>274&#45;&gt;273</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M362,-461.6738C362,-453.8102 362,-444.9007 362,-436.0982\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"365.5001,-435.883 362,-425.883 358.5001,-435.883 365.5001,-435.883\"/>\n",
"</g>\n",
"<!-- 261 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>261</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-310.3675 0,-310.3675 0,-274.3675 116,-274.3675 116,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"36.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"40.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 273&#45;&gt;261 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>273&#45;&gt;261</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M300.2505,-372.3163C252.2055,-358.3935 184.0093,-337.9706 125,-317.8234 121.3293,-316.5701 117.5591,-315.2446 113.7681,-313.8831\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"114.9405,-310.5852 104.3466,-310.445 112.5408,-317.1611 114.9405,-310.5852\"/>\n",
"</g>\n",
"<!-- 266 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>266</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"259.5,-310.3675 134.5,-310.3675 134.5,-274.3675 259.5,-274.3675 259.5,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"142.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"146.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"147\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 273&#45;&gt;266 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>273&#45;&gt;266</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M321.2135,-365.7332C295.2619,-350.4051 261.8373,-330.6631 236.1988,-315.52\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"237.8702,-312.4423 227.4799,-310.3702 234.3102,-318.4695 237.8702,-312.4423\"/>\n",
"</g>\n",
"<!-- 270 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>270</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"362\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"337\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">simmer</text>\n",
"<text text-anchor=\"start\" x=\"310\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 273&#45;&gt;270 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>273&#45;&gt;270</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M362,-353.8113C362,-345.4239 362,-336.496 362,-328.1199\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"365.5001,-327.8873 362,-317.8874 358.5001,-327.8874 365.5001,-327.8873\"/>\n",
"</g>\n",
"<!-- 265 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>265</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"581,-310.3675 465,-310.3675 465,-274.3675 581,-274.3675 581,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"481.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"485.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">ricotta cheese</text>\n",
"<text text-anchor=\"start\" x=\"473\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 273&#45;&gt;265 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>273&#45;&gt;265</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M401.7978,-365.7332C427.0096,-350.472 459.4498,-330.8355 484.4233,-315.7186\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"486.5166,-318.5428 493.259,-310.3702 482.8918,-312.5544 486.5166,-318.5428\"/>\n",
"</g>\n",
"<!-- 263 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>263</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"715,-310.3675 599,-310.3675 599,-274.3675 715,-274.3675 715,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"621.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"625.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pasta sauce</text>\n",
"<text text-anchor=\"start\" x=\"607\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 273&#45;&gt;263 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>273&#45;&gt;263</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M422.3149,-371.8061C468.4553,-357.7748 533.5382,-337.4464 590,-317.8234 593.6638,-316.55 597.4288,-315.2094 601.2159,-313.8366\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"602.4505,-317.1119 610.6305,-310.3785 600.0369,-310.5411 602.4505,-317.1119\"/>\n",
"</g>\n",
"<!-- 269 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>269</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"362,-230.9117 242,-194.9117 362,-158.9117 482,-194.9117 362,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"348.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"352.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"310\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 270&#45;&gt;269 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>270&#45;&gt;269</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M362,-266.7622C362,-258.8985 362,-249.989 362,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"365.5001,-240.9713 362,-230.9713 358.5001,-240.9714 365.5001,-240.9713\"/>\n",
"</g>\n",
"<!-- 264 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>264</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"340,-115.4558 224,-115.4558 224,-79.4558 340,-79.4558 340,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"263\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"267\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">water</text>\n",
"<text text-anchor=\"start\" x=\"232\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 269&#45;&gt;264 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>269&#45;&gt;264</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M338.214,-165.9356C327.1528,-152.4609 314.1004,-136.5605 303.3584,-123.4746\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"306.0572,-121.246 297.007,-115.7374 300.6467,-125.6875 306.0572,-121.246\"/>\n",
"</g>\n",
"<!-- 268 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>268</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"443\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"422\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"426\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">brown</text>\n",
"<text text-anchor=\"start\" x=\"391\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 269&#45;&gt;268 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>269&#45;&gt;268</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M386.0834,-165.9356C395.4801,-154.6298 406.2961,-141.6164 415.9589,-129.9906\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"418.7324,-132.1293 422.4326,-122.2016 413.349,-127.655 418.7324,-132.1293\"/>\n",
"</g>\n",
"<!-- 262 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>262</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"501,-36 385,-36 385,0 501,0 501,-36\"/>\n",
"<text text-anchor=\"start\" x=\"406\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"410\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">ground beef</text>\n",
"<text text-anchor=\"start\" x=\"393\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.7778</text>\n",
"</g>\n",
"<!-- 268&#45;&gt;262 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>268&#45;&gt;262</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M443,-71.8782C443,-63.7122 443,-54.6289 443,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"446.5001,-46.2287 443,-36.2288 439.5001,-46.2288 446.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bd3237750>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * pasta sauce\n",
" * noodle\n",
" * ricotta cheese\n",
" * mozzarella cheese\n",
" * water\n",
" * ground beef\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | brown ground beef and mix it with water. Then simmer it. |\n",
"| 2 | Mix noodle, mozzarella cheese, ricotta cheese and pasta sauce and mix it together with the results of step 1. Then bake it. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"noodle\",\n",
" \"ground beef\",\n",
" \"pasta sauce\",\n",
" \"water\",\n",
" \"ricotta cheese\",\n",
" \"mozzarella cheese\"\n",
"])\n",
"\n",
"# actions\n",
"\n",
"mix (d, \"noodle\", \"pasta sauce\")\n",
"act(d, \"brown\", \"ground beef\")\n",
"mix (d, \"water\", \"ground beef\")\n",
"act(d, \"simmer\", \"ground beef\")\n",
"mix (d, \"noodle\", \"ricotta cheese\")\n",
"mix (d, \"noodle\", \"mozzarella cheese\")\n",
"mix (d, \"noodle\", \"ground beef\")\n",
"act(d, \"bake\", \"noodle\")\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Firecracker Chicken\n",
"https://www.melskitchencafe.com/firecracker-chicken/?utm_campaign=yummly"
]
},
{
"cell_type": "code",
"execution_count": 127,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"1067pt\" height=\"716pt\"\n",
" viewBox=\"0.00 0.00 1067.00 715.65\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 711.6468)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-711.6468 1063,-711.6468 1063,4 -4,4\"/>\n",
"<!-- 654 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>654</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"746,-707.6468 626,-671.6468 746,-635.6468 866,-671.6468 746,-707.6468\"/>\n",
"<text text-anchor=\"start\" x=\"732.5\" y=\"-675.4468\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"736.5\" y=\"-675.4468\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"694\" y=\"-661.4468\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.7778</text>\n",
"</g>\n",
"<!-- 629 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>629</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"549,-592.1909 433,-592.1909 433,-556.1909 549,-556.1909 549,-592.1909\"/>\n",
"<text text-anchor=\"start\" x=\"472\" y=\"-577.9909\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"476\" y=\"-577.9909\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">water</text>\n",
"<text text-anchor=\"start\" x=\"441\" y=\"-563.9909\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 654&#45;&gt;629 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>654&#45;&gt;629</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M693.1638,-651.4538C650.7136,-635.2302 591.2141,-612.4907 547.7571,-595.8823\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"548.7773,-592.5254 538.1867,-592.2247 546.2782,-599.0641 548.7773,-592.5254\"/>\n",
"</g>\n",
"<!-- 651 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>651</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"652\" cy=\"-574.1909\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"636\" y=\"-577.9909\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"640\" y=\"-577.9909\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bake</text>\n",
"<text text-anchor=\"start\" x=\"600\" y=\"-563.9909\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.5000</text>\n",
"</g>\n",
"<!-- 654&#45;&gt;651 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>654&#45;&gt;651</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M719.0634,-643.7198C707.7417,-631.982 694.508,-618.2617 682.8017,-606.125\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"685.2025,-603.5725 675.741,-598.8048 680.1642,-608.4321 685.2025,-603.5725\"/>\n",
"</g>\n",
"<!-- 652 -->\n",
"<g id=\"node19\" class=\"node\">\n",
"<title>652</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"840\" cy=\"-574.1909\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"820.5\" y=\"-577.9909\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"824.5\" y=\"-577.9909\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">steam</text>\n",
"<text text-anchor=\"start\" x=\"788\" y=\"-563.9909\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 654&#45;&gt;652 -->\n",
"<g id=\"edge18\" class=\"edge\">\n",
"<title>654&#45;&gt;652</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M772.9366,-643.7198C784.2583,-631.982 797.492,-618.2617 809.1983,-606.125\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"811.8358,-608.4321 816.259,-598.8048 806.7975,-603.5725 811.8358,-608.4321\"/>\n",
"</g>\n",
"<!-- 630 -->\n",
"<g id=\"node21\" class=\"node\">\n",
"<title>630</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"1059,-592.1909 943,-592.1909 943,-556.1909 1059,-556.1909 1059,-592.1909\"/>\n",
"<text text-anchor=\"start\" x=\"960.5\" y=\"-577.9909\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"964.5\" y=\"-577.9909\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cider vinegar</text>\n",
"<text text-anchor=\"start\" x=\"951\" y=\"-563.9909\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 654&#45;&gt;630 -->\n",
"<g id=\"edge20\" class=\"edge\">\n",
"<title>654&#45;&gt;630</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M798.8362,-651.4538C841.2864,-635.2302 900.7859,-612.4907 944.2429,-595.8823\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"945.7218,-599.0641 953.8133,-592.2247 943.2227,-592.5254 945.7218,-599.0641\"/>\n",
"</g>\n",
"<!-- 650 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>650</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"648,-512.7351 528,-476.7351 648,-440.7351 768,-476.7351 648,-512.7351\"/>\n",
"<text text-anchor=\"start\" x=\"634.5\" y=\"-480.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"638.5\" y=\"-480.5351\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"596\" y=\"-466.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6923</text>\n",
"</g>\n",
"<!-- 651&#45;&gt;650 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>651&#45;&gt;650</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M650.949,-548.5855C650.6194,-540.5545 650.245,-531.4325 649.8762,-522.4478\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"653.3722,-522.2755 649.465,-512.4275 646.3781,-522.5626 653.3722,-522.2755\"/>\n",
"</g>\n",
"<!-- 648 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>648</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"487\" cy=\"-379.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"471\" y=\"-383.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"475\" y=\"-383.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"435\" y=\"-369.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 650&#45;&gt;648 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>650&#45;&gt;648</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M608.2022,-452.6449C585.5781,-438.9501 557.1332,-421.732 533.4864,-407.4182\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"535.0479,-404.2721 524.6806,-402.0879 531.423,-410.2605 535.0479,-404.2721\"/>\n",
"</g>\n",
"<!-- 627 -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>627</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"706,-397.2792 590,-397.2792 590,-361.2792 706,-361.2792 706,-397.2792\"/>\n",
"<text text-anchor=\"start\" x=\"618.5\" y=\"-383.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"622.5\" y=\"-383.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">hot sauce</text>\n",
"<text text-anchor=\"start\" x=\"598\" y=\"-369.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 650&#45;&gt;627 -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>650&#45;&gt;627</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M648,-440.723C648,-429.777 648,-417.9105 648,-407.5511\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"651.5001,-407.4029 648,-397.4029 644.5001,-407.4029 651.5001,-407.4029\"/>\n",
"</g>\n",
"<!-- 628 -->\n",
"<g id=\"node18\" class=\"node\">\n",
"<title>628</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"840,-397.2792 724,-397.2792 724,-361.2792 840,-361.2792 840,-397.2792\"/>\n",
"<text text-anchor=\"start\" x=\"763.5\" y=\"-383.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"767.5\" y=\"-383.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">sugar</text>\n",
"<text text-anchor=\"start\" x=\"732\" y=\"-369.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 650&#45;&gt;628 -->\n",
"<g id=\"edge17\" class=\"edge\">\n",
"<title>650&#45;&gt;628</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M683.2069,-451.1297C703.5619,-436.3259 729.0135,-417.8154 748.9852,-403.2903\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"751.1495,-406.0441 757.1782,-397.3317 747.0322,-400.3829 751.1495,-406.0441\"/>\n",
"</g>\n",
"<!-- 647 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>647</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"487,-317.8234 367,-281.8234 487,-245.8234 607,-281.8234 487,-317.8234\"/>\n",
"<text text-anchor=\"start\" x=\"473.5\" y=\"-285.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"477.5\" y=\"-285.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"435\" y=\"-271.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.7333</text>\n",
"</g>\n",
"<!-- 648&#45;&gt;647 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>648&#45;&gt;647</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M487,-353.6738C487,-345.8102 487,-336.9007 487,-328.0982\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"490.5001,-327.883 487,-317.883 483.5001,-327.883 490.5001,-327.883\"/>\n",
"</g>\n",
"<!-- 636 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>636</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-202.3675 0,-202.3675 0,-166.3675 116,-166.3675 116,-202.3675\"/>\n",
"<text text-anchor=\"start\" x=\"27.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"31.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cornstach</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-174.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 647&#45;&gt;636 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>647&#45;&gt;636</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M406.6389,-269.7914C332.6682,-257.7881 220.3072,-237.1997 125,-209.8234 120.7132,-208.592 116.3134,-207.2065 111.9162,-205.734\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"112.934,-202.3823 102.3392,-202.3978 110.6312,-208.9927 112.934,-202.3823\"/>\n",
"</g>\n",
"<!-- 646 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>646</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"219\" cy=\"-184.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"204.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"208.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">heat</text>\n",
"<text text-anchor=\"start\" x=\"167\" y=\"-174.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 647&#45;&gt;646 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>647&#45;&gt;646</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M432.4432,-261.9843C389.007,-246.1891 328.1409,-224.0556 282.5151,-207.4642\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"283.6162,-204.1405 273.0222,-204.0122 281.2239,-210.719 283.6162,-204.1405\"/>\n",
"</g>\n",
"<!-- 641 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>641</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"407\" cy=\"-184.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"395.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"399.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cut</text>\n",
"<text text-anchor=\"start\" x=\"355\" y=\"-174.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 647&#45;&gt;641 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>647&#45;&gt;641</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M463.214,-252.8473C453.9332,-241.5415 443.2507,-228.5281 433.7073,-216.9023\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"436.3636,-214.622 427.3134,-209.1133 430.9531,-219.0634 436.3636,-214.622\"/>\n",
"</g>\n",
"<!-- 635 -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>635</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"626,-202.3675 510,-202.3675 510,-166.3675 626,-166.3675 626,-202.3675\"/>\n",
"<text text-anchor=\"start\" x=\"545.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"549.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"518\" y=\"-174.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 647&#45;&gt;635 -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>647&#45;&gt;635</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M511.0834,-252.8473C522.2828,-239.3726 535.4983,-223.4722 546.3746,-210.3863\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"549.1051,-212.5768 552.8054,-202.6491 543.7218,-208.1024 549.1051,-212.5768\"/>\n",
"</g>\n",
"<!-- 634 -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>634</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"760,-202.3675 644,-202.3675 644,-166.3675 760,-166.3675 760,-202.3675\"/>\n",
"<text text-anchor=\"start\" x=\"689.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"693.5\" y=\"-188.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"652\" y=\"-174.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 647&#45;&gt;634 -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>647&#45;&gt;634</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M534.9826,-260.0737C570.0876,-244.1612 617.5575,-222.6439 652.9172,-206.6159\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"654.4261,-209.7748 662.0891,-202.4585 651.5361,-203.3992 654.4261,-209.7748\"/>\n",
"</g>\n",
"<!-- 640 -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>640</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"863\" cy=\"-184.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"844\" y=\"-188.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"848\" y=\"-188.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">whisk</text>\n",
"<text text-anchor=\"start\" x=\"811\" y=\"-174.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 647&#45;&gt;640 -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>647&#45;&gt;640</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M552.598,-265.361C609.7961,-250.9383 694.9672,-229.2976 769,-209.8234 775.9134,-208.0048 783.1073,-206.0926 790.3005,-204.1672\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"791.332,-207.5143 800.0825,-201.5411 789.517,-200.7537 791.332,-207.5143\"/>\n",
"</g>\n",
"<!-- 632 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>632</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"277,-115.4558 161,-115.4558 161,-79.4558 277,-79.4558 277,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"189\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"193\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">canola oil</text>\n",
"<text text-anchor=\"start\" x=\"169\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.7778</text>\n",
"</g>\n",
"<!-- 646&#45;&gt;632 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>646&#45;&gt;632</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M219,-158.7612C219,-148.3964 219,-136.3917 219,-125.7674\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"222.5001,-125.7151 219,-115.7151 215.5001,-125.7151 222.5001,-125.7151\"/>\n",
"</g>\n",
"<!-- 633 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>633</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"465,-115.4558 349,-115.4558 349,-79.4558 465,-79.4558 465,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"362.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"366.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chicken breast</text>\n",
"<text text-anchor=\"start\" x=\"357\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8889</text>\n",
"</g>\n",
"<!-- 641&#45;&gt;633 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>641&#45;&gt;633</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M407,-158.7612C407,-148.3964 407,-136.3917 407,-125.7674\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"410.5001,-125.7151 407,-115.7151 403.5001,-125.7151 410.5001,-125.7151\"/>\n",
"</g>\n",
"<!-- 639 -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>639</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"863\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"848.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"852.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">beat</text>\n",
"<text text-anchor=\"start\" x=\"811\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 640&#45;&gt;639 -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>640&#45;&gt;639</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M863,-158.7612C863,-150.7873 863,-141.8428 863,-133.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"866.5001,-133.1794 863,-123.1795 859.5001,-133.1795 866.5001,-133.1794\"/>\n",
"</g>\n",
"<!-- 637 -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>637</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"921,-36 805,-36 805,0 921,0 921,-36\"/>\n",
"<text text-anchor=\"start\" x=\"851\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"855\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">egg</text>\n",
"<text text-anchor=\"start\" x=\"813\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.5833</text>\n",
"</g>\n",
"<!-- 639&#45;&gt;637 -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>639&#45;&gt;637</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M863,-71.8782C863,-63.7122 863,-54.6289 863,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"866.5001,-46.2287 863,-36.2288 859.5001,-46.2288 866.5001,-46.2287\"/>\n",
"</g>\n",
"<!-- 638 -->\n",
"<g id=\"node20\" class=\"node\">\n",
"<title>638</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"902,-494.7351 786,-494.7351 786,-458.7351 902,-458.7351 902,-494.7351\"/>\n",
"<text text-anchor=\"start\" x=\"831\" y=\"-480.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"835\" y=\"-480.5351\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">rice</text>\n",
"<text text-anchor=\"start\" x=\"794\" y=\"-466.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 652&#45;&gt;638 -->\n",
"<g id=\"edge19\" class=\"edge\">\n",
"<title>652&#45;&gt;638</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M841.051,-548.5855C841.5989,-535.2357 842.2705,-518.8715 842.8344,-505.1339\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"846.3459,-504.9227 843.2591,-494.7875 839.3518,-504.6356 846.3459,-504.9227\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bd3338150>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * hot sauce\n",
" * cornstach\n",
" * salt\n",
" * sugar\n",
" * canola oil\n",
" * cider vinegar\n",
" * egg\n",
" * rice\n",
" * water\n",
" * pepper\n",
" * chicken breast\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | beat and whisk egg |\n",
"| 2 | heat canola oil, cut chicken breast and mix it with cornstach, pepper and salt and mix it together with the results of step 1. Then cook it. |\n",
"| 3 | Mix hot sauce and sugar and mix it together with the results of step 2. Then bake it. |\n",
"| 4 | steam rice and mix it with water and cider vinegar and mix it together with the results of step 3. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"hot sauce\",\n",
" \"sugar\",\n",
" \"water\",\n",
" \"cider vinegar\",\n",
" \"salt\",\n",
" \"canola oil\",\n",
" \"chicken breast\",\n",
" \"salt\",\n",
" \"pepper\",\n",
" \"cornstach\",\n",
" \"egg\",\n",
" \"rice\"\n",
" \n",
"])\n",
"\n",
"# actions\n",
"\n",
"act(d, \"beat\", \"egg\")\n",
"act(d, \"whisk\", \"egg\")\n",
"act(d, \"cut\", \"chicken breast\")\n",
"mix(d, \"chicken breast\", \"salt\")\n",
"mix(d, \"chicken breast\", \"pepper\")\n",
"mix(d, \"cornstach\", \"chicken breast\")\n",
"\n",
"mix(d, \"chicken breast\", \"egg\")\n",
"\n",
"act(d, \"heat\", \"canola oil\")\n",
"\n",
"mix(d, \"chicken breast\", \"canola oil\")\n",
"\n",
"act(d, \"cook\", \"chicken breast\")\n",
"\n",
"mix(d, \"sugar\", \"hot sauce\")\n",
"mix(d, \"hot sauce\", \"chicken breast\")\n",
"act(d, \"bake\", \"chicken breast\")\n",
"\n",
"act(d, \"steam\", \"rice\")\n",
"mix(d, \"chicken breast\", \"rice\")\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Italian Drunken Noodles\n",
"https://www.yummly.com/recipe/Italian-Drunken-Noodles-1835835#directions"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"970pt\" height=\"629pt\"\n",
" viewBox=\"0.00 0.00 969.85 628.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 624.7351)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-624.7351 965.8528,-624.7351 965.8528,4 -4,4\"/>\n",
"<!-- 300 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>300</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"322.8528,-620.7351 202.8528,-584.7351 322.8528,-548.7351 442.8528,-584.7351 322.8528,-620.7351\"/>\n",
"<text text-anchor=\"start\" x=\"309.3528\" y=\"-588.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"313.3528\" y=\"-588.5351\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"270.8528\" y=\"-574.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 299 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>299</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"91.8528\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"73.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"77.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">drain</text>\n",
"<text text-anchor=\"start\" x=\"39.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 300&#45;&gt;299 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>300&#45;&gt;299</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M272.7293,-563.5886C236.7652,-548.4159 188.1917,-527.9233 150.4364,-511.9949\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"151.6591,-508.712 141.085,-508.0496 148.9381,-515.1615 151.6591,-508.712\"/>\n",
"</g>\n",
"<!-- 282 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>282</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"313.8528,-505.2792 197.8528,-505.2792 197.8528,-469.2792 313.8528,-469.2792 313.8528,-505.2792\"/>\n",
"<text text-anchor=\"start\" x=\"239.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"243.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">basil</text>\n",
"<text text-anchor=\"start\" x=\"205.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 300&#45;&gt;282 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>300&#45;&gt;282</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M302.2039,-554.6999C293.2067,-541.6129 282.7518,-526.4055 274.0509,-513.7496\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"276.8964,-511.7104 268.347,-505.4528 271.1281,-515.6761 276.8964,-511.7104\"/>\n",
"</g>\n",
"<!-- 281 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>281</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"447.8528,-505.2792 331.8528,-505.2792 331.8528,-469.2792 447.8528,-469.2792 447.8528,-505.2792\"/>\n",
"<text text-anchor=\"start\" x=\"366.3528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"370.3528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">parsley</text>\n",
"<text text-anchor=\"start\" x=\"339.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 300&#45;&gt;281 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>300&#45;&gt;281</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M343.5017,-554.6999C352.4989,-541.6129 362.9538,-526.4055 371.6547,-513.7496\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"374.5775,-515.6761 377.3587,-505.4528 368.8092,-511.7104 374.5775,-515.6761\"/>\n",
"</g>\n",
"<!-- 295 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>295</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"552.8528\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"527.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"531.8528\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">simmer</text>\n",
"<text text-anchor=\"start\" x=\"500.8528\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.8571</text>\n",
"</g>\n",
"<!-- 300&#45;&gt;295 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>300&#45;&gt;295</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M372.7594,-563.5886C408.4459,-548.4675 456.6021,-528.0627 494.1388,-512.1576\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"495.5972,-515.3409 503.4392,-508.2168 492.8662,-508.8956 495.5972,-515.3409\"/>\n",
"</g>\n",
"<!-- 298 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>298</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-389.8234\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"68.8528\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"72.8528\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 299&#45;&gt;298 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>299&#45;&gt;298</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M90.0136,-461.6738C89.2241,-450.682 88.2878,-437.6467 87.4309,-425.7165\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"90.9115,-425.3196 86.704,-415.5961 83.9295,-425.8212 90.9115,-425.3196\"/>\n",
"</g>\n",
"<!-- 283 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>283</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"129.8528,-310.3675 13.8528,-310.3675 13.8528,-274.3675 129.8528,-274.3675 129.8528,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"38.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"42.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">egg noodle</text>\n",
"<text text-anchor=\"start\" x=\"21.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 298&#45;&gt;283 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>298&#45;&gt;283</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M81.4372,-364.218C79.6388,-350.736 77.4303,-334.1796 75.5867,-320.3591\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"79.0525,-319.8694 74.2609,-310.42 72.1139,-320.795 79.0525,-319.8694\"/>\n",
"</g>\n",
"<!-- 294 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>294</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"553.8528,-425.8234 433.8528,-389.8234 553.8528,-353.8234 673.8528,-389.8234 553.8528,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"540.3528\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"544.3528\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"501.8528\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.8947</text>\n",
"</g>\n",
"<!-- 295&#45;&gt;294 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>295&#45;&gt;294</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M553.1156,-461.6738C553.1962,-453.8102 553.2877,-444.9007 553.378,-436.0982\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"556.8799,-435.9184 553.4828,-425.883 549.8803,-435.8465 556.8799,-435.9184\"/>\n",
"</g>\n",
"<!-- 279 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>279</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"263.8528,-310.3675 147.8528,-310.3675 147.8528,-274.3675 263.8528,-274.3675 263.8528,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"172.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"176.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">white wine</text>\n",
"<text text-anchor=\"start\" x=\"155.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 294&#45;&gt;279 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>294&#45;&gt;279</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M484.8186,-374.4193C427.559,-361.0985 344.2627,-340.459 272.8528,-317.8234 268.9163,-316.5756 264.8743,-315.2235 260.8206,-313.8151\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"261.9788,-310.5123 251.3841,-310.4493 259.6271,-317.1055 261.9788,-310.5123\"/>\n",
"</g>\n",
"<!-- 289 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>289</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"366.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"349.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"353.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">saute</text>\n",
"<text text-anchor=\"start\" x=\"314.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 294&#45;&gt;289 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>294&#45;&gt;289</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M510.0096,-366.9743C482.6374,-352.7092 447.2665,-334.2755 418.5325,-319.3006\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"419.9406,-316.0877 409.4551,-314.5699 416.7055,-322.2953 419.9406,-316.0877\"/>\n",
"</g>\n",
"<!-- 292 -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>292</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"554.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"540.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"544.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">dice</text>\n",
"<text text-anchor=\"start\" x=\"502.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 294&#45;&gt;292 -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>294&#45;&gt;292</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M554.2223,-353.8113C554.3084,-345.4239 554.4,-336.496 554.486,-328.1199\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"557.9881,-327.9228 554.591,-317.8874 550.9884,-327.8509 557.9881,-327.9228\"/>\n",
"</g>\n",
"<!-- 286 -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>286</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"742.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"728.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"732.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">heat</text>\n",
"<text text-anchor=\"start\" x=\"690.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 294&#45;&gt;286 -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>294&#45;&gt;286</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M598.1649,-366.9743C625.9284,-352.6584 661.8336,-334.1442 690.9302,-319.1409\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"692.835,-322.0967 700.1189,-314.4028 689.6269,-315.8751 692.835,-322.0967\"/>\n",
"</g>\n",
"<!-- 278 -->\n",
"<g id=\"node21\" class=\"node\">\n",
"<title>278</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"961.8528,-310.3675 845.8528,-310.3675 845.8528,-274.3675 961.8528,-274.3675 961.8528,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"868.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"872.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">garlic clove</text>\n",
"<text text-anchor=\"start\" x=\"853.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 294&#45;&gt;278 -->\n",
"<g id=\"edge20\" class=\"edge\">\n",
"<title>294&#45;&gt;278</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M623.094,-374.5337C680.7735,-361.2433 764.8257,-340.5873 836.8528,-317.8234 840.7904,-316.5789 844.8331,-315.2293 848.8875,-313.8227\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"850.0798,-317.1135 858.3248,-310.4599 847.7302,-310.5196 850.0798,-317.1135\"/>\n",
"</g>\n",
"<!-- 288 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>288</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"358.8528,-230.9117 238.8528,-194.9117 358.8528,-158.9117 478.8528,-194.9117 358.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"345.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"349.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"306.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 289&#45;&gt;288 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>289&#45;&gt;288</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M364.7509,-266.7622C364.0849,-258.6491 363.3276,-249.4228 362.5827,-240.3494\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"366.0592,-239.9177 361.7527,-230.2376 359.0826,-240.4904 366.0592,-239.9177\"/>\n",
"</g>\n",
"<!-- 287 -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>287</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"340.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"326.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"330.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">dice</text>\n",
"<text text-anchor=\"start\" x=\"288.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 288&#45;&gt;287 -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>288&#45;&gt;287</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M352.5067,-160.5524C350.8447,-151.5539 349.0501,-141.8374 347.3788,-132.7891\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"350.8162,-132.1289 345.558,-122.9309 343.9326,-133.4003 350.8162,-132.1289\"/>\n",
"</g>\n",
"<!-- 276 -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>276</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"559.8528,-115.4558 443.8528,-115.4558 443.8528,-79.4558 559.8528,-79.4558 559.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"489.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"493.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"451.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 288&#45;&gt;276 -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>288&#45;&gt;276</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M395.6789,-169.8144C417.4987,-154.944 445.003,-136.1995 466.5502,-121.5149\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"468.7943,-124.2211 475.0867,-115.6972 464.8521,-118.4367 468.7943,-124.2211\"/>\n",
"</g>\n",
"<!-- 277 -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>277</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"398.8528,-36 282.8528,-36 282.8528,0 398.8528,0 398.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"318.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"322.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"290.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8889</text>\n",
"</g>\n",
"<!-- 287&#45;&gt;277 -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>287&#45;&gt;277</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M340.8528,-71.8782C340.8528,-63.7122 340.8528,-54.6289 340.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"344.3529,-46.2287 340.8528,-36.2288 337.3529,-46.2288 344.3529,-46.2287\"/>\n",
"</g>\n",
"<!-- 280 -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>280</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"612.8528,-212.9117 496.8528,-212.9117 496.8528,-176.9117 612.8528,-176.9117 612.8528,-212.9117\"/>\n",
"<text text-anchor=\"start\" x=\"531.8528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"535.8528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"504.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 292&#45;&gt;280 -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>292&#45;&gt;280</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M554.8528,-266.7622C554.8528,-253.4123 554.8528,-237.0481 554.8528,-223.3105\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"558.3529,-222.9641 554.8528,-212.9642 551.3529,-222.9642 558.3529,-222.9641\"/>\n",
"</g>\n",
"<!-- 285 -->\n",
"<g id=\"node18\" class=\"node\">\n",
"<title>285</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"750.8528,-230.9117 630.8528,-194.9117 750.8528,-158.9117 870.8528,-194.9117 750.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"737.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"741.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"698.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 286&#45;&gt;285 -->\n",
"<g id=\"edge17\" class=\"edge\">\n",
"<title>286&#45;&gt;285</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M744.9547,-266.7622C745.6207,-258.6491 746.3781,-249.4228 747.1229,-240.3494\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"750.623,-240.4904 747.953,-230.2376 743.6465,-239.9177 750.623,-240.4904\"/>\n",
"</g>\n",
"<!-- 284 -->\n",
"<g id=\"node19\" class=\"node\">\n",
"<title>284</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"750.8528,-115.4558 634.8528,-115.4558 634.8528,-79.4558 750.8528,-79.4558 750.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"667.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"671.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">olive oil</text>\n",
"<text text-anchor=\"start\" x=\"642.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 285&#45;&gt;284 -->\n",
"<g id=\"edge18\" class=\"edge\">\n",
"<title>285&#45;&gt;284</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M732.6604,-164.3434C725.089,-151.6214 716.3706,-136.9721 709.0265,-124.6321\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"711.8421,-122.5193 703.7202,-115.716 705.8268,-126.0993 711.8421,-122.5193\"/>\n",
"</g>\n",
"<!-- 275 -->\n",
"<g id=\"node20\" class=\"node\">\n",
"<title>275</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"884.8528,-115.4558 768.8528,-115.4558 768.8528,-79.4558 884.8528,-79.4558 884.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"802.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"806.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">sausage</text>\n",
"<text text-anchor=\"start\" x=\"776.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 285&#45;&gt;275 -->\n",
"<g id=\"edge19\" class=\"edge\">\n",
"<title>285&#45;&gt;275</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M773.6553,-165.6717C784.0567,-152.3339 796.2768,-136.6639 806.3801,-123.7083\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"809.2838,-125.6763 812.6734,-115.6383 803.7638,-121.3716 809.2838,-125.6763\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bd3252d10>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * salt\n",
" * olive oil\n",
" * garlic clove\n",
" * tomato\n",
" * white wine\n",
" * egg noodle\n",
" * parsley\n",
" * sausage\n",
" * basil\n",
" * pepper\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | cook and drain egg noodle |\n",
"| 2 | dice pepper and mix it with salt. Then saute it. |\n",
"| 3 | Mix olive oil and sausage. Then heat it. |\n",
"| 4 | dice tomato and mix it with white wine and garlic clove and mix it together with the results of step 2 and step 3. Then simmer it. |\n",
"| 5 | Mix basil and parsley and mix it together with the results of step 1 and step 4. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"sausage\",\n",
" \"salt\",\n",
" \"pepper\",\n",
" \"garlic clove\",\n",
" \"white wine\",\n",
" \"tomato\",\n",
" \"parsley\",\n",
" \"basil\",\n",
" \"egg noodle\",\n",
" \"olive oil\"\n",
"])\n",
"\n",
"# actions\n",
"\n",
"mix (d, \"olive oil\", \"sausage\")\n",
"act (d, \"heat\", \"sausage\")\n",
"act (d, \"dice\", \"pepper\")\n",
"mix (d, \"pepper\", \"salt\")\n",
"act (d, \"saute\", \"pepper\")\n",
"mix (d, \"pepper\", \"garlic clove\")\n",
"mix (d, \"white wine\", \"pepper\")\n",
"act (d, \"dice\", \"tomato\")\n",
"mix (d, \"tomato\", \"pepper\")\n",
"mix (d, \"sausage\", \"pepper\")\n",
"act (d, \"simmer\", \"sausage\")\n",
"mix (d, \"parsley\", \"pepper\")\n",
"mix (d, \"basil\", \"pepper\")\n",
"\n",
"act(d, \"cook\", \"egg noodle\")\n",
"act(d, \"drain\", \"egg noodle\")\n",
"\n",
"mix(d, \"egg noodle\", \"sausage\")\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Italian Pasta Salad\n",
"https://www.yummly.com/recipe/Italian-Pasta-Salad-9104504#directions"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"1144pt\" height=\"521pt\"\n",
" viewBox=\"0.00 0.00 1143.85 520.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 516.7351)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-516.7351 1139.8528,-516.7351 1139.8528,4 -4,4\"/>\n",
"<!-- 343 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>343</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"541\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"507.5\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"511.5\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">refrigerate</text>\n",
"<text text-anchor=\"start\" x=\"489\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.7500</text>\n",
"</g>\n",
"<!-- 342 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>342</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"541,-425.8234 421,-389.8234 541,-353.8234 661,-389.8234 541,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"527.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"531.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"489\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.9630</text>\n",
"</g>\n",
"<!-- 343&#45;&gt;342 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>343&#45;&gt;342</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M541,-461.6738C541,-453.8102 541,-444.9007 541,-436.0982\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"544.5001,-435.883 541,-425.883 537.5001,-435.883 544.5001,-435.883\"/>\n",
"</g>\n",
"<!-- 328 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>328</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-310.3675 0,-310.3675 0,-274.3675 116,-274.3675 116,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"31.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"35.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">dressing</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 342&#45;&gt;328 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>342&#45;&gt;328</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M454.2948,-379.7446C369.3996,-368.7272 236.8737,-348.4527 125,-317.8234 120.6288,-316.6266 116.1453,-315.2551 111.6698,-313.7828\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"112.5265,-310.3761 101.9318,-310.4274 110.246,-316.9943 112.5265,-310.3761\"/>\n",
"</g>\n",
"<!-- 334 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>334</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"219\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"205\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"209\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">dice</text>\n",
"<text text-anchor=\"start\" x=\"167\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 342&#45;&gt;334 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>342&#45;&gt;334</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M481.1889,-371.7211C426.6015,-355.1998 345.9154,-330.7795 288.4871,-313.3984\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"289.3484,-310.0023 278.7633,-310.4554 287.3206,-316.7022 289.3484,-310.0023\"/>\n",
"</g>\n",
"<!-- 325 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>325</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"438,-310.3675 322,-310.3675 322,-274.3675 438,-274.3675 438,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"359.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"363.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cheese</text>\n",
"<text text-anchor=\"start\" x=\"330\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 342&#45;&gt;325 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>342&#45;&gt;325</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M501.2022,-365.7332C475.9904,-350.472 443.5502,-330.8355 418.5767,-315.7186\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"420.1082,-312.5544 409.741,-310.3702 416.4834,-318.5428 420.1082,-312.5544\"/>\n",
"</g>\n",
"<!-- 332 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>332</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"541\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"525\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"529\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"489\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 342&#45;&gt;332 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>342&#45;&gt;332</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M541,-353.8113C541,-345.4239 541,-336.496 541,-328.1199\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"544.5001,-327.8873 541,-317.8874 537.5001,-327.8874 544.5001,-327.8873\"/>\n",
"</g>\n",
"<!-- 336 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>336</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"729\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"711\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"715\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">drain</text>\n",
"<text text-anchor=\"start\" x=\"677\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 342&#45;&gt;336 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>342&#45;&gt;336</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M585.0776,-366.9743C612.6942,-352.6584 648.4095,-334.1442 677.3521,-319.1409\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"679.225,-322.1124 686.4922,-314.4028 676.0034,-315.8978 679.225,-322.1124\"/>\n",
"</g>\n",
"<!-- 324 -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>324</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"948,-310.3675 832,-310.3675 832,-274.3675 948,-274.3675 948,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"867\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"871\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"840\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 342&#45;&gt;324 -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>342&#45;&gt;324</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M609.9935,-374.51C667.4673,-361.2056 751.2215,-340.5421 823,-317.8234 826.9371,-316.5772 830.9794,-315.2264 835.0335,-313.8189\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"836.2263,-317.1095 844.4704,-310.4546 833.8757,-310.5159 836.2263,-317.1095\"/>\n",
"</g>\n",
"<!-- 333 -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>333</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"1051\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"1036.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"1040.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">slice</text>\n",
"<text text-anchor=\"start\" x=\"999\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 342&#45;&gt;333 -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>342&#45;&gt;333</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M621.9624,-378.0955C706.1132,-365.3725 841.4267,-343.4157 957,-317.8234 964.2884,-316.2094 971.8589,-314.395 979.3973,-312.4973\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"980.4471,-315.8413 989.2624,-309.9643 978.7062,-309.0612 980.4471,-315.8413\"/>\n",
"</g>\n",
"<!-- 327 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>327</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"277,-223.4558 161,-223.4558 161,-187.4558 277,-187.4558 277,-223.4558\"/>\n",
"<text text-anchor=\"start\" x=\"189\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"193\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">red onion</text>\n",
"<text text-anchor=\"start\" x=\"169\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 334&#45;&gt;327 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>334&#45;&gt;327</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M219,-266.7612C219,-256.3964 219,-244.3917 219,-233.7674\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"222.5001,-233.7151 219,-223.7151 215.5001,-233.7151 222.5001,-233.7151\"/>\n",
"</g>\n",
"<!-- 331 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>331</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"537\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"523\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"527\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">peel</text>\n",
"<text text-anchor=\"start\" x=\"485\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 332&#45;&gt;331 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>332&#45;&gt;331</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M539.8215,-266.7612C539.4545,-258.7873 539.0429,-249.8428 538.6498,-241.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"542.14,-241.0079 538.1839,-231.1795 535.1474,-241.3298 542.14,-241.0079\"/>\n",
"</g>\n",
"<!-- 323 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>323</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"593,-126 477,-126 477,-90 593,-90 593,-126\"/>\n",
"<text text-anchor=\"start\" x=\"503.5\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"507.5\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cucumber</text>\n",
"<text text-anchor=\"start\" x=\"485\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8889</text>\n",
"</g>\n",
"<!-- 331&#45;&gt;323 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>331&#45;&gt;323</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M536.4745,-179.8505C536.2006,-166.5006 535.8647,-150.1364 535.5828,-136.3988\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"539.075,-135.9785 535.3705,-126.0525 532.0765,-136.1222 539.075,-135.9785\"/>\n",
"</g>\n",
"<!-- 335 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>335</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"730\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"714\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"718\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"678\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 336&#45;&gt;335 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>336&#45;&gt;335</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M729.2946,-266.7612C729.3864,-258.7873 729.4893,-249.8428 729.5875,-241.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"733.0886,-241.2191 729.704,-231.1795 726.0891,-241.1385 733.0886,-241.2191\"/>\n",
"</g>\n",
"<!-- 330 -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>330</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"731,-144 611,-108 731,-72 851,-108 731,-144\"/>\n",
"<text text-anchor=\"start\" x=\"717.5\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"721.5\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"679\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 335&#45;&gt;330 -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>335&#45;&gt;330</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M730.2627,-179.8505C730.3434,-171.9868 730.4348,-163.0773 730.5252,-154.2748\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"734.0271,-154.0951 730.63,-144.0596 727.0275,-154.0232 734.0271,-154.0951\"/>\n",
"</g>\n",
"<!-- 322 -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>322</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"722,-36 606,-36 606,0 722,0 722,-36\"/>\n",
"<text text-anchor=\"start\" x=\"646.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"650.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pasta</text>\n",
"<text text-anchor=\"start\" x=\"614\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 330&#45;&gt;322 -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>330&#45;&gt;322</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M709.0617,-78.5306C700.8707,-67.5278 691.6287,-55.1131 683.656,-44.4036\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"686.3576,-42.1713 677.5786,-36.2399 680.7426,-46.3513 686.3576,-42.1713\"/>\n",
"</g>\n",
"<!-- 329 -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>329</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"856,-36 740,-36 740,0 856,0 856,-36\"/>\n",
"<text text-anchor=\"start\" x=\"785.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"789.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"748\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 330&#45;&gt;329 -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>330&#45;&gt;329</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M752.9383,-78.5306C761.1293,-67.5278 770.3713,-55.1131 778.344,-44.4036\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"781.2574,-46.3513 784.4214,-36.2399 775.6424,-42.1713 781.2574,-46.3513\"/>\n",
"</g>\n",
"<!-- 326 -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>326</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"1109,-223.4558 993,-223.4558 993,-187.4558 1109,-187.4558 1109,-223.4558\"/>\n",
"<text text-anchor=\"start\" x=\"1017.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"1021.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">black olive</text>\n",
"<text text-anchor=\"start\" x=\"1001\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 333&#45;&gt;326 -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>333&#45;&gt;326</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M1051,-266.7612C1051,-256.3964 1051,-244.3917 1051,-233.7674\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1054.5001,-233.7151 1051,-223.7151 1047.5001,-233.7151 1054.5001,-233.7151\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bd375b7d0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * dressing\n",
" * cheese\n",
" * salt\n",
" * tomato\n",
" * pasta\n",
" * black olive\n",
" * red onion\n",
" * cucumber\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | peel and chop cucumber |\n",
"| 2 | Mix pasta and salt. Then cook it. |\n",
"| 3 | drain the result of step 2 |\n",
"| 4 | dice red onion, slice black olive and mix it with dressing, cheese and tomato and mix it together with the results of step 1 and step 3. Then refrigerate it. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"pasta\",\n",
" \"cucumber\",\n",
" \"tomato\",\n",
" \"cheese\",\n",
" \"black olive\",\n",
" \"red onion\",\n",
" \"dressing\",\n",
" \"salt\"\n",
"])\n",
"\n",
"# actions\n",
"\n",
"mix (d, \"salt\", \"pasta\")\n",
"act (d, \"peel\", \"cucumber\")\n",
"act (d, \"chop\", \"cucumber\")\n",
"act (d, \"slice\", \"black olive\")\n",
"act (d, \"dice\", \"red onion\")\n",
"act (d, \"cook\", \"pasta\")\n",
"act (d, \"drain\", \"pasta\")\n",
"mix (d, \"pasta\", \"cucumber\")\n",
"mix (d, \"pasta\", \"tomato\")\n",
"mix (d, \"pasta\", \"cheese\")\n",
"mix (d, \"pasta\", \"black olive\")\n",
"mix (d, \"pasta\", \"red onion\")\n",
"mix (d, \"pasta\", \"dressing\")\n",
"\n",
"act(d, \"refrigerate\", \"pasta\")\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Mexican Rice\n",
"https://www.homesicktexan.com/2008/06/with-beans-comes-rice.html"
]
},
{
"cell_type": "code",
"execution_count": 77,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"1201pt\" height=\"434pt\"\n",
" viewBox=\"0.00 0.00 1200.85 433.82\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-429.8234 1196.8528,-429.8234 1196.8528,4 -4,4\"/>\n",
"<!-- 392 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>392</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"786,-425.8234 666,-389.8234 786,-353.8234 906,-389.8234 786,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"772.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"776.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"734\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.9762</text>\n",
"</g>\n",
"<!-- 388 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>388</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"460\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"444\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"448\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"408\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 392&#45;&gt;388 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>392&#45;&gt;388</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M725.8267,-371.8349C670.5217,-355.3018 588.5234,-330.7889 530.2412,-313.3657\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"530.9576,-309.9269 520.374,-310.416 528.9526,-316.6336 530.9576,-309.9269\"/>\n",
"</g>\n",
"<!-- 375 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>375</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"683,-310.3675 567,-310.3675 567,-274.3675 683,-274.3675 683,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"594\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"598\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">lime juice</text>\n",
"<text text-anchor=\"start\" x=\"575\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 392&#45;&gt;375 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>392&#45;&gt;375</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M746.2022,-365.7332C720.9904,-350.472 688.5502,-330.8355 663.5767,-315.7186\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"665.1082,-312.5544 654.741,-310.3702 661.4834,-318.5428 665.1082,-312.5544\"/>\n",
"</g>\n",
"<!-- 383 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>383</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"786\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"773\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"777\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">boil</text>\n",
"<text text-anchor=\"start\" x=\"734\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 392&#45;&gt;383 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>392&#45;&gt;383</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M786,-353.8113C786,-345.4239 786,-336.496 786,-328.1199\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"789.5001,-327.8873 786,-317.8874 782.5001,-327.8874 789.5001,-327.8873\"/>\n",
"</g>\n",
"<!-- 378 -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>378</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"1005,-310.3675 889,-310.3675 889,-274.3675 1005,-274.3675 1005,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"934.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"938.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"897\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 392&#45;&gt;378 -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>392&#45;&gt;378</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M825.7978,-365.7332C851.0096,-350.472 883.4498,-330.8355 908.4233,-315.7186\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"910.5166,-318.5428 917.259,-310.3702 906.8918,-312.5544 910.5166,-318.5428\"/>\n",
"</g>\n",
"<!-- 380 -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>380</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"1108\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"1092\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"1096\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"1056\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 392&#45;&gt;380 -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>392&#45;&gt;380</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M845.8111,-371.7211C900.3985,-355.1998 981.0846,-330.7795 1038.5129,-313.3984\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1039.6794,-316.7022 1048.2367,-310.4554 1037.6516,-310.0023 1039.6794,-316.7022\"/>\n",
"</g>\n",
"<!-- 387 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>387</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"328,-230.9117 208,-194.9117 328,-158.9117 448,-194.9117 328,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"314.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"318.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 388&#45;&gt;387 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>388&#45;&gt;387</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M428.0465,-268.7762C410.9755,-256.1726 389.7198,-240.4795 371.1964,-226.8036\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"373.0266,-223.8043 362.9027,-220.6804 368.8688,-229.4358 373.0266,-223.8043\"/>\n",
"</g>\n",
"<!-- 373 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>373</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-115.4558 0,-115.4558 0,-79.4558 116,-79.4558 116,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"22.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"26.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">garlic clove</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 387&#45;&gt;373 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>387&#45;&gt;373</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M272.3064,-175.5332C231.4501,-161.2262 174.669,-141.153 125,-122.9117 121.5871,-121.6583 118.0805,-120.3594 114.546,-119.0417\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"115.7624,-115.7599 105.1701,-115.5282 113.306,-122.3148 115.7624,-115.7599\"/>\n",
"</g>\n",
"<!-- 374 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>374</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-115.4558 134,-115.4558 134,-79.4558 250,-79.4558 250,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"169\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"173\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"142\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 387&#45;&gt;374 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>387&#45;&gt;374</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M292.2676,-169.3063C271.6088,-154.5025 245.7774,-135.992 225.5076,-121.4669\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"227.3595,-118.4881 217.1923,-115.5083 223.2821,-124.1781 227.3595,-118.4881\"/>\n",
"</g>\n",
"<!-- 371 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>371</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-115.4558 268,-115.4558 268,-79.4558 384,-79.4558 384,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"301\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"305\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">olive oil</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 387&#45;&gt;371 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>387&#45;&gt;371</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M327.261,-158.8996C327.0363,-147.9536 326.7928,-136.0871 326.5802,-125.7278\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"330.0765,-125.5056 326.3719,-115.5795 323.0779,-125.6493 330.0765,-125.5056\"/>\n",
"</g>\n",
"<!-- 379 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>379</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"487\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"473\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"477\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">dice</text>\n",
"<text text-anchor=\"start\" x=\"435\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 387&#45;&gt;379 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>387&#45;&gt;379</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M367.7123,-170.5709C389.8971,-156.9731 417.6515,-139.9616 440.8051,-125.7701\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"442.7356,-128.692 449.4325,-120.4821 439.0775,-122.7238 442.7356,-128.692\"/>\n",
"</g>\n",
"<!-- 377 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>377</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"706,-115.4558 590,-115.4558 590,-79.4558 706,-79.4558 706,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"604.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"608.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">ground cumin</text>\n",
"<text text-anchor=\"start\" x=\"598\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 387&#45;&gt;377 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>387&#45;&gt;377</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M392.4112,-178.2193C443.8206,-164.504 517.4969,-143.9682 581,-122.9117 584.7463,-121.6695 588.5927,-120.3443 592.4571,-118.9758\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"593.838,-122.1984 602.0527,-115.5074 591.4584,-115.6152 593.838,-122.1984\"/>\n",
"</g>\n",
"<!-- 372 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>372</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"545,-36 429,-36 429,0 545,0 545,-36\"/>\n",
"<text text-anchor=\"start\" x=\"468.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"472.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"437\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 379&#45;&gt;372 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>379&#45;&gt;372</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M487,-71.8782C487,-63.7122 487,-54.6289 487,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"490.5001,-46.2287 487,-36.2288 483.5001,-46.2288 490.5001,-46.2287\"/>\n",
"</g>\n",
"<!-- 382 -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>382</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"849,-230.9117 729,-194.9117 849,-158.9117 969,-194.9117 849,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"835.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"839.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"797\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 383&#45;&gt;382 -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>383&#45;&gt;382</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M802.2241,-267.2702C808.848,-257.0235 816.6611,-244.9374 823.9852,-233.6076\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"826.9733,-235.4322 829.4629,-225.134 821.0946,-231.6319 826.9733,-235.4322\"/>\n",
"</g>\n",
"<!-- 368 -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>368</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"840,-115.4558 724,-115.4558 724,-79.4558 840,-79.4558 840,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"769\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"773\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">rice</text>\n",
"<text text-anchor=\"start\" x=\"732\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 382&#45;&gt;368 -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>382&#45;&gt;368</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M828.3511,-164.8765C819.3539,-151.7895 808.899,-136.5822 800.1981,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"803.0436,-121.887 794.4942,-115.6294 797.2753,-125.8527 803.0436,-121.887\"/>\n",
"</g>\n",
"<!-- 370 -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>370</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"974,-115.4558 858,-115.4558 858,-79.4558 974,-79.4558 974,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"895.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"899.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">butter</text>\n",
"<text text-anchor=\"start\" x=\"866\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 382&#45;&gt;370 -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>382&#45;&gt;370</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M869.6489,-164.8765C878.6461,-151.7895 889.101,-136.5822 897.8019,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"900.7247,-125.8527 903.5058,-115.6294 894.9564,-121.887 900.7247,-125.8527\"/>\n",
"</g>\n",
"<!-- 369 -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>369</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"1108,-115.4558 992,-115.4558 992,-79.4558 1108,-79.4558 1108,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"1007.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"1011.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chicken broth</text>\n",
"<text text-anchor=\"start\" x=\"1000\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 382&#45;&gt;369 -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>382&#45;&gt;369</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M895.1135,-172.5533C927.6042,-156.8001 970.9474,-135.7849 1003.5195,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1005.3585,-122.9903 1012.8296,-115.4781 1002.3045,-116.6916 1005.3585,-122.9903\"/>\n",
"</g>\n",
"<!-- 376 -->\n",
"<g id=\"node18\" class=\"node\">\n",
"<title>376</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"1166,-212.9117 1050,-212.9117 1050,-176.9117 1166,-176.9117 1166,-212.9117\"/>\n",
"<text text-anchor=\"start\" x=\"1083\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"1087\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cilantro</text>\n",
"<text text-anchor=\"start\" x=\"1058\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 380&#45;&gt;376 -->\n",
"<g id=\"edge17\" class=\"edge\">\n",
"<title>380&#45;&gt;376</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M1108,-266.7622C1108,-253.4123 1108,-237.0481 1108,-223.3105\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1111.5001,-222.9641 1108,-212.9642 1104.5001,-222.9642 1111.5001,-222.9641\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bd3729cd0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * onion\n",
" * olive oil\n",
" * garlic clove\n",
" * lime juice\n",
" * chicken broth\n",
" * salt\n",
" * cilantro\n",
" * tomato\n",
" * ground cumin\n",
" * rice\n",
" * butter\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | dice onion and mix it with garlic clove, tomato, olive oil and ground cumin. Then cook it. |\n",
"| 2 | Mix rice, butter and chicken broth. Then boil it. |\n",
"| 3 | chop cilantro and mix it with lime juice and salt and mix it together with the results of step 1 and step 2. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"rice\",\n",
" \"chicken broth\",\n",
" \"butter\",\n",
" \"olive oil\",\n",
" \"onion\",\n",
" \"garlic clove\",\n",
" \"tomato\",\n",
" \"lime juice\",\n",
" \"cilantro\",\n",
" \"ground cumin\",\n",
" \"salt\"\n",
"])\n",
"\n",
"# actions\n",
"\n",
"act(d, \"dice\", \"onion\")\n",
"act(d, \"chop\", \"cilantro\")\n",
"\n",
"mix (d, \"rice\", \"chicken broth\")\n",
"mix (d, \"rice\", \"butter\")\n",
"act (d, \"boil\", \"rice\")\n",
"\n",
"mix (d, \"olive oil\", \"onion\")\n",
"mix (d, \"garlic clove\", \"onion\")\n",
"mix (d, \"tomato\", \"onion\")\n",
"mix (d, \"ground cumin\", \"onion\")\n",
"act (d, \"cook\", \"onion\")\n",
"\n",
"mix (d, \"rice\", \"onion\")\n",
"mix (d, \"lime juice\", \"onion\")\n",
"mix (d, \"cilantro\", \"onion\")\n",
"\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## One Pot Cheesy Taco Pasta\n",
"http://www.motherthyme.com/2016/07/one-pot-cheesy-taco-pasta.html?utm_campaign=yummly"
]
},
{
"cell_type": "code",
"execution_count": 84,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"956pt\" height=\"629pt\"\n",
" viewBox=\"0.00 0.00 955.85 628.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 624.7351)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-624.7351 951.8528,-624.7351 951.8528,4 -4,4\"/>\n",
"<!-- 415 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>415</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"460,-620.7351 340,-584.7351 460,-548.7351 580,-584.7351 460,-620.7351\"/>\n",
"<text text-anchor=\"start\" x=\"446.5\" y=\"-588.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"450.5\" y=\"-588.5351\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"408\" y=\"-574.5351\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.7500</text>\n",
"</g>\n",
"<!-- 403 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>403</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-505.2792 0,-505.2792 0,-469.2792 116,-469.2792 116,-505.2792\"/>\n",
"<text text-anchor=\"start\" x=\"21.5\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"25.5\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tortilla chip</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 415&#45;&gt;403 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>415&#45;&gt;403</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M383.3367,-571.6771C314.8954,-559.2134 212.2833,-538.5345 125,-512.7351 120.9055,-511.5248 116.705,-510.1817 112.5004,-508.763\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"113.3251,-505.3435 102.7303,-505.3428 111.0122,-511.9504 113.3251,-505.3435\"/>\n",
"</g>\n",
"<!-- 404 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>404</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"219\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"203\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"207\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"167\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 415&#45;&gt;404 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>415&#45;&gt;404</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M408.8901,-564.0672C370.8991,-548.7043 318.9488,-527.6966 278.9886,-511.5375\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"280.2053,-508.2542 269.6225,-507.75 277.581,-514.7437 280.2053,-508.2542\"/>\n",
"</g>\n",
"<!-- 399 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>399</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"438,-505.2792 322,-505.2792 322,-469.2792 438,-469.2792 438,-505.2792\"/>\n",
"<text text-anchor=\"start\" x=\"359.5\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"363.5\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cheese</text>\n",
"<text text-anchor=\"start\" x=\"330\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 415&#45;&gt;399 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>415&#45;&gt;399</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M436.214,-555.759C425.1528,-542.2843 412.1004,-526.3839 401.3584,-513.298\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"404.0572,-511.0694 395.007,-505.5608 398.6467,-515.5108 404.0572,-511.0694\"/>\n",
"</g>\n",
"<!-- 413 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>413</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"541\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"528\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"532\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">boil</text>\n",
"<text text-anchor=\"start\" x=\"489\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.8333</text>\n",
"</g>\n",
"<!-- 415&#45;&gt;413 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>415&#45;&gt;413</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M484.0834,-555.759C493.4801,-544.4532 504.2961,-531.4398 513.9589,-519.814\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"516.7324,-521.9527 520.4326,-512.025 511.349,-517.4783 516.7324,-521.9527\"/>\n",
"</g>\n",
"<!-- 401 -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>401</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"760,-505.2792 644,-505.2792 644,-469.2792 760,-469.2792 760,-505.2792\"/>\n",
"<text text-anchor=\"start\" x=\"676\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"680\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">avocado</text>\n",
"<text text-anchor=\"start\" x=\"652\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 415&#45;&gt;401 -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>415&#45;&gt;401</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M511.322,-564.0672C551.3973,-547.9284 606.9415,-525.5602 647.7467,-509.1276\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"649.2922,-512.2784 657.2608,-505.2961 646.6773,-505.7851 649.2922,-512.2784\"/>\n",
"</g>\n",
"<!-- 405 -->\n",
"<g id=\"node18\" class=\"node\">\n",
"<title>405</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"863\" cy=\"-487.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"847\" y=\"-491.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"851\" y=\"-491.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"811\" y=\"-477.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 415&#45;&gt;405 -->\n",
"<g id=\"edge17\" class=\"edge\">\n",
"<title>415&#45;&gt;405</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M529.2023,-569.3497C591.9381,-555.2265 686.874,-533.4163 769,-512.7351 775.9885,-510.9752 783.2558,-509.0956 790.5154,-507.1851\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"791.6139,-510.5148 800.3829,-504.5688 789.8199,-503.7486 791.6139,-510.5148\"/>\n",
"</g>\n",
"<!-- 400 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>400</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"277,-407.8234 161,-407.8234 161,-371.8234 277,-371.8234 277,-407.8234\"/>\n",
"<text text-anchor=\"start\" x=\"196\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"200\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"169\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 404&#45;&gt;400 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>404&#45;&gt;400</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M219,-461.6738C219,-448.324 219,-431.9598 219,-418.2222\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"222.5001,-417.8758 219,-407.8758 215.5001,-417.8759 222.5001,-417.8758\"/>\n",
"</g>\n",
"<!-- 412 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>412</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"541,-425.8234 421,-389.8234 541,-353.8234 661,-389.8234 541,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"527.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"531.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"489\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.7500</text>\n",
"</g>\n",
"<!-- 413&#45;&gt;412 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>413&#45;&gt;412</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M541,-461.6738C541,-453.8102 541,-444.9007 541,-436.0982\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"544.5001,-435.883 541,-425.883 537.5001,-435.883 544.5001,-435.883\"/>\n",
"</g>\n",
"<!-- 396 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>396</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-310.3675 268,-310.3675 268,-274.3675 384,-274.3675 384,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"307\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"311\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">water</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 412&#45;&gt;396 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>412&#45;&gt;396</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M493.0174,-368.0737C457.9124,-352.1612 410.4425,-330.6439 375.0828,-314.6159\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"376.4639,-311.3992 365.9109,-310.4585 373.5739,-317.7748 376.4639,-311.3992\"/>\n",
"</g>\n",
"<!-- 397 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>397</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518,-310.3675 402,-310.3675 402,-274.3675 518,-274.3675 518,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"444\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"448\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salsa</text>\n",
"<text text-anchor=\"start\" x=\"410\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 412&#45;&gt;397 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>412&#45;&gt;397</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M516.9166,-360.8473C505.7172,-347.3726 492.5017,-331.4722 481.6254,-318.3863\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"484.2782,-316.1024 475.1946,-310.6491 478.8949,-320.5768 484.2782,-316.1024\"/>\n",
"</g>\n",
"<!-- 409 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>409</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"621\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"603\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"607\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">drain</text>\n",
"<text text-anchor=\"start\" x=\"569\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 412&#45;&gt;409 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>412&#45;&gt;409</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M564.786,-360.8473C574.0668,-349.5415 584.7493,-336.5281 594.2927,-324.9023\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"597.0469,-327.0634 600.6866,-317.1133 591.6364,-322.622 597.0469,-327.0634\"/>\n",
"</g>\n",
"<!-- 398 -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>398</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"840,-310.3675 724,-310.3675 724,-274.3675 840,-274.3675 840,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"764.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"768.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pasta</text>\n",
"<text text-anchor=\"start\" x=\"732\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 412&#45;&gt;398 -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>412&#45;&gt;398</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M592.1099,-369.1555C632.0196,-353.0168 687.3343,-330.6485 727.9709,-314.2159\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"729.4872,-317.3781 737.4457,-310.3844 726.8629,-310.8887 729.4872,-317.3781\"/>\n",
"</g>\n",
"<!-- 408 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>408</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"621\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"605\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"609\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"569\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 409&#45;&gt;408 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>409&#45;&gt;408</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M621,-266.7612C621,-258.7873 621,-249.8428 621,-241.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"624.5001,-241.1794 621,-231.1795 617.5001,-241.1795 624.5001,-241.1794\"/>\n",
"</g>\n",
"<!-- 407 -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>407</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"621,-144 501,-108 621,-72 741,-108 621,-144\"/>\n",
"<text text-anchor=\"start\" x=\"607.5\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"611.5\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"569\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 408&#45;&gt;407 -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>408&#45;&gt;407</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M621,-179.8505C621,-171.9868 621,-163.0773 621,-154.2748\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"624.5001,-154.0596 621,-144.0596 617.5001,-154.0597 624.5001,-154.0596\"/>\n",
"</g>\n",
"<!-- 394 -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>394</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"545,-36 429,-36 429,0 545,0 545,-36\"/>\n",
"<text text-anchor=\"start\" x=\"474.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"478.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"437\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8889</text>\n",
"</g>\n",
"<!-- 407&#45;&gt;394 -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>407&#45;&gt;394</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M583.6735,-82.93C564.4671,-70.0301 541.1837,-54.3921 522.28,-41.6955\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"524.1859,-38.7595 513.9331,-36.0894 520.283,-44.5705 524.1859,-38.7595\"/>\n",
"</g>\n",
"<!-- 395 -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>395</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"679,-36 563,-36 563,0 679,0 679,-36\"/>\n",
"<text text-anchor=\"start\" x=\"581\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"585\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">black pepper</text>\n",
"<text text-anchor=\"start\" x=\"571\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8889</text>\n",
"</g>\n",
"<!-- 407&#45;&gt;395 -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>407&#45;&gt;395</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M621,-71.9121C621,-63.3433 621,-54.3253 621,-46.1692\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"624.5001,-46.0539 621,-36.0539 617.5001,-46.0539 624.5001,-46.0539\"/>\n",
"</g>\n",
"<!-- 393 -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>393</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"813,-36 697,-36 697,0 813,0 813,-36\"/>\n",
"<text text-anchor=\"start\" x=\"718\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"722\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">ground beef</text>\n",
"<text text-anchor=\"start\" x=\"705\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8889</text>\n",
"</g>\n",
"<!-- 407&#45;&gt;393 -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>407&#45;&gt;393</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M658.3265,-82.93C677.5329,-70.0301 700.8163,-54.3921 719.72,-41.6955\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"721.717,-44.5705 728.0669,-36.0894 717.8141,-38.7595 721.717,-44.5705\"/>\n",
"</g>\n",
"<!-- 402 -->\n",
"<g id=\"node19\" class=\"node\">\n",
"<title>402</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"921,-407.8234 805,-407.8234 805,-371.8234 921,-371.8234 921,-407.8234\"/>\n",
"<text text-anchor=\"start\" x=\"838\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"842\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cilantro</text>\n",
"<text text-anchor=\"start\" x=\"813\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 405&#45;&gt;402 -->\n",
"<g id=\"edge18\" class=\"edge\">\n",
"<title>405&#45;&gt;402</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M863,-461.6738C863,-448.324 863,-431.9598 863,-418.2222\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"866.5001,-417.8758 863,-407.8758 859.5001,-417.8759 866.5001,-417.8758\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bd3225110>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * cilantro\n",
" * cheese\n",
" * salt\n",
" * black pepper\n",
" * tomato\n",
" * pasta\n",
" * tortilla chip\n",
" * salsa\n",
" * avocado\n",
" * water\n",
" * ground beef\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | Mix salt, black pepper and ground beef. Then cook it. |\n",
"| 2 | drain the result of step 1 |\n",
"| 3 | Mix water, salsa and pasta and mix it together with the results of step 2. Then boil it. |\n",
"| 4 | chop tomato, chop cilantro and mix it with tortilla chip, cheese and avocado and mix it together with the results of step 3. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"ground beef\",\n",
" \"salt\",\n",
" \"black pepper\",\n",
" \"water\",\n",
" \"salsa\",\n",
" \"pasta\",\n",
" \"cheese\",\n",
" \"tomato\",\n",
" \"avocado\",\n",
" \"cilantro\",\n",
" \"tortilla chip\"\n",
"])\n",
"\n",
"# actions\n",
"\n",
"act (d, \"chop\", \"tomato\")\n",
"act (d, \"chop\", \"cilantro\")\n",
"\n",
"mix (d, \"ground beef\", \"salt\")\n",
"mix (d, \"ground beef\", \"black pepper\")\n",
"act (d, \"cook\", \"ground beef\")\n",
"act (d, \"drain\", \"ground beef\")\n",
"\n",
"mix (d, \"ground beef\", \"salsa\")\n",
"mix (d, \"ground beef\", \"water\")\n",
"mix (d, \"ground beef\", \"pasta\")\n",
"\n",
"act(d, \"boil\", \"pasta\")\n",
"\n",
"mix (d, \"cheese\", \"pasta\")\n",
"\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Spanish Rice and Beans\n",
"https://www.yummly.com/recipe/Spanish-Rice-and-Beans-814#directions"
]
},
{
"cell_type": "code",
"execution_count": 90,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"634pt\" height=\"542pt\"\n",
" viewBox=\"0.00 0.00 634.00 541.82\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 537.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-537.8234 630,-537.8234 630,4 -4,4\"/>\n",
"<!-- 441 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>441</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"311,-533.8234 191,-497.8234 311,-461.8234 431,-497.8234 311,-533.8234\"/>\n",
"<text text-anchor=\"start\" x=\"297.5\" y=\"-501.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"301.5\" y=\"-501.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"259\" y=\"-487.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6364</text>\n",
"</g>\n",
"<!-- 432 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>432</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"121\" cy=\"-400.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"103\" y=\"-404.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"107\" y=\"-404.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">drain</text>\n",
"<text text-anchor=\"start\" x=\"69\" y=\"-390.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 441&#45;&gt;432 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>441&#45;&gt;432</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M266.4534,-474.9743C238.5431,-460.6584 202.4479,-442.1442 173.1974,-427.1409\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"174.4552,-423.8525 163.96,-422.4028 171.2604,-430.081 174.4552,-423.8525\"/>\n",
"</g>\n",
"<!-- 440 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>440</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"311\" cy=\"-400.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"295\" y=\"-404.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"299\" y=\"-404.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"259\" y=\"-390.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 441&#45;&gt;440 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>441&#45;&gt;440</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M311,-461.8113C311,-453.4239 311,-444.496 311,-436.1199\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"314.5001,-435.8873 311,-425.8874 307.5001,-435.8874 314.5001,-435.8873\"/>\n",
"</g>\n",
"<!-- 430 -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>430</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"530,-418.3675 414,-418.3675 414,-382.3675 530,-382.3675 530,-418.3675\"/>\n",
"<text text-anchor=\"start\" x=\"456\" y=\"-404.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"460\" y=\"-404.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salsa</text>\n",
"<text text-anchor=\"start\" x=\"422\" y=\"-390.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 441&#45;&gt;430 -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>441&#45;&gt;430</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M350.7978,-473.7332C376.0096,-458.472 408.4498,-438.8355 433.4233,-423.7186\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"435.5166,-426.5428 442.259,-418.3702 431.8918,-420.5544 435.5166,-426.5428\"/>\n",
"</g>\n",
"<!-- 431 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>431</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"175,-320.9117 59,-320.9117 59,-284.9117 175,-284.9117 175,-320.9117\"/>\n",
"<text text-anchor=\"start\" x=\"79.5\" y=\"-306.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"83.5\" y=\"-306.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">kidney bean</text>\n",
"<text text-anchor=\"start\" x=\"67\" y=\"-292.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.3333</text>\n",
"</g>\n",
"<!-- 432&#45;&gt;431 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>432&#45;&gt;431</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M119.949,-374.7622C119.4011,-361.4123 118.7295,-345.0481 118.1656,-331.3105\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"121.6482,-330.8122 117.7409,-320.9642 114.6541,-331.0993 121.6482,-330.8122\"/>\n",
"</g>\n",
"<!-- 439 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>439</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"313,-338.9117 193,-302.9117 313,-266.9117 433,-302.9117 313,-338.9117\"/>\n",
"<text text-anchor=\"start\" x=\"299.5\" y=\"-306.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"303.5\" y=\"-306.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"261\" y=\"-292.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.5556</text>\n",
"</g>\n",
"<!-- 440&#45;&gt;439 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>440&#45;&gt;439</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M311.5255,-374.7622C311.6869,-366.8985 311.8697,-357.989 312.0503,-349.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"315.554,-349.0411 312.26,-338.9713 308.5554,-348.8974 315.554,-349.0411\"/>\n",
"</g>\n",
"<!-- 428 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>428</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-223.4558 0,-223.4558 0,-187.4558 116,-187.4558 116,-223.4558\"/>\n",
"<text text-anchor=\"start\" x=\"22.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"26.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">garlic clove</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 439&#45;&gt;428 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>439&#45;&gt;428</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M260.1638,-282.7188C217.7136,-266.4952 158.2141,-243.7556 114.7571,-227.1473\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"115.7773,-223.7903 105.1867,-223.4896 113.2782,-230.329 115.7773,-223.7903\"/>\n",
"</g>\n",
"<!-- 433 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>433</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"219\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"203\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"207\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"167\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.0000</text>\n",
"</g>\n",
"<!-- 439&#45;&gt;433 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>439&#45;&gt;433</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M286.0634,-274.9848C274.7417,-263.2469 261.508,-249.5266 249.8017,-237.39\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"252.2025,-234.8375 242.741,-230.0697 247.1642,-239.6971 252.2025,-234.8375\"/>\n",
"</g>\n",
"<!-- 435 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>435</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"407\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"392.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"396.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">heat</text>\n",
"<text text-anchor=\"start\" x=\"355\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 439&#45;&gt;435 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>439&#45;&gt;435</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M339.9366,-274.9848C351.2583,-263.2469 364.492,-249.5266 376.1983,-237.39\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"378.8358,-239.6971 383.259,-230.0697 373.7975,-234.8375 378.8358,-239.6971\"/>\n",
"</g>\n",
"<!-- 429 -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>429</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"626,-223.4558 510,-223.4558 510,-187.4558 626,-187.4558 626,-223.4558\"/>\n",
"<text text-anchor=\"start\" x=\"520.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"524.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">vegetable broth</text>\n",
"<text text-anchor=\"start\" x=\"518\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 439&#45;&gt;429 -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>439&#45;&gt;429</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M365.8362,-282.7188C408.2864,-266.4952 467.7859,-243.7556 511.2429,-227.1473\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"512.7218,-230.329 520.8133,-223.4896 510.2227,-223.7903 512.7218,-230.329\"/>\n",
"</g>\n",
"<!-- 427 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>427</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"273,-126 157,-126 157,-90 273,-90 273,-126\"/>\n",
"<text text-anchor=\"start\" x=\"179\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"183\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">white onion</text>\n",
"<text text-anchor=\"start\" x=\"165\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 433&#45;&gt;427 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>433&#45;&gt;427</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M217.949,-179.8505C217.4011,-166.5006 216.7295,-150.1364 216.1656,-136.3988\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"219.6482,-135.9005 215.7409,-126.0525 212.6541,-136.1876 219.6482,-135.9005\"/>\n",
"</g>\n",
"<!-- 434 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>434</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"411,-144 291,-108 411,-72 531,-108 411,-144\"/>\n",
"<text text-anchor=\"start\" x=\"397.5\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"401.5\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"359\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 435&#45;&gt;434 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>435&#45;&gt;434</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M408.051,-179.8505C408.3806,-171.8194 408.755,-162.6974 409.1238,-153.7127\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"412.6219,-153.8276 409.535,-143.6924 405.6278,-153.5404 412.6219,-153.8276\"/>\n",
"</g>\n",
"<!-- 426 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>426</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"402,-36 286,-36 286,0 402,0 402,-36\"/>\n",
"<text text-anchor=\"start\" x=\"331\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"335\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">rice</text>\n",
"<text text-anchor=\"start\" x=\"294\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 434&#45;&gt;426 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>434&#45;&gt;426</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M389.0617,-78.5306C380.8707,-67.5278 371.6287,-55.1131 363.656,-44.4036\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"366.3576,-42.1713 357.5786,-36.2399 360.7426,-46.3513 366.3576,-42.1713\"/>\n",
"</g>\n",
"<!-- 425 -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>425</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"536,-36 420,-36 420,0 536,0 536,-36\"/>\n",
"<text text-anchor=\"start\" x=\"468.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"472.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">oil</text>\n",
"<text text-anchor=\"start\" x=\"428\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 434&#45;&gt;425 -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>434&#45;&gt;425</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M432.9383,-78.5306C441.1293,-67.5278 450.3713,-55.1131 458.344,-44.4036\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"461.2574,-46.3513 464.4214,-36.2399 455.6424,-42.1713 461.2574,-46.3513\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bde8fcf50>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * garlic clove\n",
" * oil\n",
" * kidney bean\n",
" * white onion\n",
" * salsa\n",
" * vegetable broth\n",
" * rice\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | Mix rice and oil. Then heat it. |\n",
"| 2 | chop white onion and mix it with garlic clove and vegetable broth and mix it together with the results of step 1. Then cook it. |\n",
"| 3 | drain kidney bean and mix it with salsa and mix it together with the results of step 2. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"oil\",\n",
" \"rice\",\n",
" \"white onion\",\n",
" \"garlic clove\",\n",
" \"vegetable broth\",\n",
" \"salsa\",\n",
" \"kidney bean\"\n",
"])\n",
"\n",
"# actions\n",
"act (d, \"drain\", \"kidney bean\")\n",
"act (d, \"chop\", \"white onion\")\n",
"\n",
"mix (d, \"rice\", \"oil\")\n",
"act(d, \"heat\", \"rice\")\n",
"\n",
"mix(d, \"rice\", \"white onion\")\n",
"mix (d, \"rice\", \"garlic clove\")\n",
"mix (d, \"rice\", \"garlic clove\")\n",
"\n",
"mix (d, \"vegetable broth\", \"rice\")\n",
"\n",
"act (d, \"cook\", \"rice\")\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Vegan Curried Rice\n",
"https://www.yummly.com/recipe/Vegan-Curried-Rice-2319743#directions"
]
},
{
"cell_type": "code",
"execution_count": 104,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"1090pt\" height=\"434pt\"\n",
" viewBox=\"0.00 0.00 1089.85 433.82\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-429.8234 1085.8528,-429.8234 1085.8528,4 -4,4\"/>\n",
"<!-- 502 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>502</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"352.8528,-425.8234 232.8528,-389.8234 352.8528,-353.8234 472.8528,-389.8234 352.8528,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"339.3528\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"343.3528\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"300.8528\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.9167</text>\n",
"</g>\n",
"<!-- 487 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>487</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"169.8528,-310.3675 53.8528,-310.3675 53.8528,-274.3675 169.8528,-274.3675 169.8528,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"89.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"93.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"61.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 502&#45;&gt;487 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>502&#45;&gt;487</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M301.7429,-369.1555C261.8332,-353.0168 206.5185,-330.6485 165.8819,-314.2159\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"166.9899,-310.8887 156.4071,-310.3844 164.3657,-317.3781 166.9899,-310.8887\"/>\n",
"</g>\n",
"<!-- 493 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>493</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"272.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"256.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"260.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"220.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 502&#45;&gt;493 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>502&#45;&gt;493</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M329.0668,-360.8473C319.786,-349.5415 309.1035,-336.5281 299.5601,-324.9023\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"302.2164,-322.622 293.1663,-317.1133 296.8059,-327.0634 302.2164,-322.622\"/>\n",
"</g>\n",
"<!-- 486 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>486</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"491.8528,-310.3675 375.8528,-310.3675 375.8528,-274.3675 491.8528,-274.3675 491.8528,-310.3675\"/>\n",
"<text text-anchor=\"start\" x=\"421.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"425.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"383.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 502&#45;&gt;486 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>502&#45;&gt;486</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M376.9362,-360.8473C388.1356,-347.3726 401.3511,-331.4722 412.2274,-318.3863\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"414.9579,-320.5768 418.6582,-310.6491 409.5746,-316.1024 414.9579,-320.5768\"/>\n",
"</g>\n",
"<!-- 501 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>501</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"594.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"583.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"587.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">fry</text>\n",
"<text text-anchor=\"start\" x=\"542.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.7143</text>\n",
"</g>\n",
"<!-- 502&#45;&gt;501 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>502&#45;&gt;501</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M404.1748,-369.1555C442.3234,-353.7927 494.4893,-332.7849 534.6153,-316.6258\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"536.0517,-319.8206 544.0203,-312.8383 533.4367,-313.3273 536.0517,-319.8206\"/>\n",
"</g>\n",
"<!-- 489 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>489</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"330.8528,-212.9117 214.8528,-212.9117 214.8528,-176.9117 330.8528,-176.9117 330.8528,-212.9117\"/>\n",
"<text text-anchor=\"start\" x=\"259.8528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"263.8528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">rice</text>\n",
"<text text-anchor=\"start\" x=\"222.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 493&#45;&gt;489 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>493&#45;&gt;489</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M272.8528,-266.7622C272.8528,-253.4123 272.8528,-237.0481 272.8528,-223.3105\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"276.3529,-222.9641 272.8528,-212.9642 269.3529,-222.9642 276.3529,-222.9641\"/>\n",
"</g>\n",
"<!-- 500 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>500</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"594.8528,-230.9117 474.8528,-194.9117 594.8528,-158.9117 714.8528,-194.9117 594.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"581.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"585.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"542.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.9048</text>\n",
"</g>\n",
"<!-- 501&#45;&gt;500 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>501&#45;&gt;500</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M594.8528,-266.7622C594.8528,-258.8985 594.8528,-249.989 594.8528,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"598.3529,-240.9713 594.8528,-230.9713 591.3529,-240.9714 598.3529,-240.9713\"/>\n",
"</g>\n",
"<!-- 491 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>491</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"68.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"72.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 500&#45;&gt;491 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>500&#45;&gt;491</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M513.8904,-183.1838C429.7396,-170.4608 294.4262,-148.504 178.8528,-122.9117 171.5644,-121.2978 163.994,-119.4833 156.4555,-117.5856\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"157.1466,-114.1496 146.5904,-115.0526 155.4058,-120.9296 157.1466,-114.1496\"/>\n",
"</g>\n",
"<!-- 494 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>494</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"272.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"256.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"260.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"220.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 500&#45;&gt;494 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>500&#45;&gt;494</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M535.0417,-176.8094C480.4544,-160.2881 399.7682,-135.8678 342.3399,-118.4867\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"343.2013,-115.0906 332.6161,-115.5437 341.1734,-121.7905 343.2013,-115.0906\"/>\n",
"</g>\n",
"<!-- 483 -->\n",
"<g id=\"node12\" class=\"node\">\n",
"<title>483</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"491.8528,-115.4558 375.8528,-115.4558 375.8528,-79.4558 491.8528,-79.4558 491.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"398.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"402.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">garlic clove</text>\n",
"<text text-anchor=\"start\" x=\"383.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 500&#45;&gt;483 -->\n",
"<g id=\"edge11\" class=\"edge\">\n",
"<title>500&#45;&gt;483</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M555.0551,-170.8215C529.8432,-155.5603 497.403,-135.9238 472.4295,-120.8069\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"473.9611,-117.6428 463.5938,-115.4585 470.3362,-123.6311 473.9611,-117.6428\"/>\n",
"</g>\n",
"<!-- 492 -->\n",
"<g id=\"node13\" class=\"node\">\n",
"<title>492</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"594.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"578.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"582.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"542.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 500&#45;&gt;492 -->\n",
"<g id=\"edge12\" class=\"edge\">\n",
"<title>500&#45;&gt;492</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M594.8528,-158.8996C594.8528,-150.5122 594.8528,-141.5843 594.8528,-133.2082\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"598.3529,-132.9756 594.8528,-122.9757 591.3529,-132.9757 598.3529,-132.9756\"/>\n",
"</g>\n",
"<!-- 482 -->\n",
"<g id=\"node15\" class=\"node\">\n",
"<title>482</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"813.8528,-115.4558 697.8528,-115.4558 697.8528,-79.4558 813.8528,-79.4558 813.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"735.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"739.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">ginger</text>\n",
"<text text-anchor=\"start\" x=\"705.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 500&#45;&gt;482 -->\n",
"<g id=\"edge14\" class=\"edge\">\n",
"<title>500&#45;&gt;482</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M634.6506,-170.8215C659.8624,-155.5603 692.3026,-135.9238 717.2761,-120.8069\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"719.3695,-123.6311 726.1118,-115.4585 715.7446,-117.6428 719.3695,-123.6311\"/>\n",
"</g>\n",
"<!-- 481 -->\n",
"<g id=\"node16\" class=\"node\">\n",
"<title>481</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"947.8528,-115.4558 831.8528,-115.4558 831.8528,-79.4558 947.8528,-79.4558 947.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"864.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"868.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">olive oil</text>\n",
"<text text-anchor=\"start\" x=\"839.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 500&#45;&gt;481 -->\n",
"<g id=\"edge15\" class=\"edge\">\n",
"<title>500&#45;&gt;481</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M655.1677,-176.8944C701.3081,-162.8631 766.391,-142.5347 822.8528,-122.9117 826.5166,-121.6383 830.2816,-120.2977 834.0687,-118.925\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"835.3033,-122.2002 843.4833,-115.4668 832.8897,-115.6294 835.3033,-122.2002\"/>\n",
"</g>\n",
"<!-- 488 -->\n",
"<g id=\"node17\" class=\"node\">\n",
"<title>488</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"1081.8528,-115.4558 965.8528,-115.4558 965.8528,-79.4558 1081.8528,-79.4558 1081.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"1004.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"1008.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">water</text>\n",
"<text text-anchor=\"start\" x=\"973.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 500&#45;&gt;488 -->\n",
"<g id=\"edge16\" class=\"edge\">\n",
"<title>500&#45;&gt;488</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M675.2139,-182.8797C749.1846,-170.8764 861.5456,-150.2881 956.8528,-122.9117 961.1396,-121.6803 965.5394,-120.2948 969.9366,-118.8223\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"971.2216,-122.081 979.5137,-115.4861 968.9188,-115.4706 971.2216,-122.081\"/>\n",
"</g>\n",
"<!-- 484 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>484</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"142.8528,-36 26.8528,-36 26.8528,0 142.8528,0 142.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"64.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"68.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">carrot</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 491&#45;&gt;484 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>491&#45;&gt;484</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M84.8528,-71.8782C84.8528,-63.7122 84.8528,-54.6289 84.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"88.3529,-46.2287 84.8528,-36.2288 81.3529,-46.2288 88.3529,-46.2287\"/>\n",
"</g>\n",
"<!-- 490 -->\n",
"<g id=\"node11\" class=\"node\">\n",
"<title>490</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"330.8528,-36 214.8528,-36 214.8528,0 330.8528,0 330.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"248.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"252.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spinach</text>\n",
"<text text-anchor=\"start\" x=\"222.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 494&#45;&gt;490 -->\n",
"<g id=\"edge10\" class=\"edge\">\n",
"<title>494&#45;&gt;490</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M272.8528,-71.8782C272.8528,-63.7122 272.8528,-54.6289 272.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"276.3529,-46.2287 272.8528,-36.2288 269.3529,-46.2288 276.3529,-46.2287\"/>\n",
"</g>\n",
"<!-- 485 -->\n",
"<g id=\"node14\" class=\"node\">\n",
"<title>485</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"652.8528,-36 536.8528,-36 536.8528,0 652.8528,0 652.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"569.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"573.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">broccoli</text>\n",
"<text text-anchor=\"start\" x=\"544.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 492&#45;&gt;485 -->\n",
"<g id=\"edge13\" class=\"edge\">\n",
"<title>492&#45;&gt;485</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M594.8528,-71.8782C594.8528,-63.7122 594.8528,-54.6289 594.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"598.3529,-46.2287 594.8528,-36.2288 591.3529,-46.2288 598.3529,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f0bde6f0890>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * salt\n",
" * garlic clove\n",
" * ginger\n",
" * olive oil\n",
" * broccoli\n",
" * carrot\n",
" * rice\n",
" * spinach\n",
" * water\n",
" * pepper\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | chop carrot, chop spinach, chop broccoli and mix it with garlic clove, ginger, olive oil and water. Then fry it. |\n",
"| 2 | cook rice and mix it with pepper and salt and mix it together with the results of step 1. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"olive oil\",\n",
" \"ginger\",\n",
" \"garlic clove\",\n",
" \"carrot\",\n",
" \"broccoli\",\n",
" \"salt\",\n",
" \"pepper\",\n",
" \"water\",\n",
" \"rice\",\n",
" \"spinach\"\n",
"])\n",
"\n",
"# actions\n",
"act(d, \"chop\", \"carrot\")\n",
"act(d, \"chop\", \"broccoli\")\n",
"act(d, \"cook\",\"rice\")\n",
"act(d, \"chop\", \"spinach\")\n",
"\n",
"mix(d, \"olive oil\", \"ginger\")\n",
"mix(d, \"olive oil\", \"garlic clove\")\n",
"mix(d, \"olive oil\", \"carrot\")\n",
"mix(d, \"olive oil\", \"broccoli\")\n",
"mix(d, \"olive oil\", \"water\")\n",
"mix(d, \"olive oil\", \"spinach\")\n",
"\n",
"act(d, \"fry\", \"olive oil\")\n",
"\n",
"r = get_root(d)\n",
"\n",
"display(r.dot())\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Vegetable Ramen Pad Thai\n",
"https://www.yummly.com/recipe/Vegetable-Ramen-Pad-Thai-2067502#directions"
]
},
{
"cell_type": "code",
"execution_count": 119,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * vegetable\n",
" * peanut butter\n",
" * vegetable oil\n",
" * sriacha sauce\n",
" * water\n",
" * ramen noodle\n",
" * teriyaki sauce\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | Mix vegetable oil and vegetable. Then cook it. |\n",
"| 2 | heat water and mix it with ramen noodle. Then cook it. |\n",
"| 3 | drain the result of step 2 |\n",
"| 4 | Mix sriacha sauce, peanut butter and teriyaki sauce and mix it together with the results of step 1 and step 3. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"d = ingredient_nodes([\n",
" \"ramen noodle\",\n",
" \"vegetable oil\",\n",
" \"vegetable\",\n",
" \"teriyaki sauce\",\n",
" \"water\",\n",
" \"peanut butter\",\n",
" \"sriacha sauce\"\n",
"])\n",
"\n",
"# actions\n",
"act(d, \"heat\", \"water\")\n",
"mix(d, \"ramen noodle\", \"water\")\n",
"act(d, \"cook\", \"ramen noodle\")\n",
"act(d, \"drain\", \"ramen noodle\")\n",
"\n",
"mix (d, \"vegetable oil\", \"vegetable\")\n",
"act(d, \"cook\", \"vegetable\")\n",
"\n",
"mix (d, \"vegetable\", \"ramen noodle\")\n",
"\n",
"\n",
"r = get_root(d)\n",
"\n",
"#display(r.dot()) # ← cannot plot tree because some ingredients are unknown!\n",
"display(r.to_instruction().to_markdown())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.7.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}