{"version":3,"sources":["webpack:///./routes/ottimizzazioneLineare.js","webpack:///./components/old/todo.css","webpack:///./components/old/plus.css","webpack:///./components/old/timer.js","webpack:///./components/old/timer.less","webpack:///./components/Latex.js","webpack:///./components/old/minus.js","webpack:///./components/old/plus.js","webpack:///./components/old/todo.js","webpack:///./components/old/minus.css","webpack:///./components/Latex.css","webpack:///./contexts/LatexDefaultInline.js","webpack:///./components/Image.js"],"names":["r","String","raw","OttimizzazioneLineare","render","title","href","to","class","src","Component","module","exports","Timer","state","Date","now","timer","componentDidMount","this","setInterval","setState","componentWillUnmount","clearInterval","dateTo","className","style","parts","milliseconds","seconds","minutes","hours","days","props","timeLeft","Math","floor","expired","unknown","count","text","remaining","renderColor","useContext","LatexRenderColor","defaultInline","LatexDefaultInline","undefined","inline","children","alt","latex","Minus","minus","Plus","plus","Todo","todo","createContext","target"],"mappings":"47FAYMA,EAAIC,OAAOC,IAEIC,E,gLACjBC,OAAA,WACI,OACI,aACI,6CACA,EAAC,IAAD,CAAOC,MAAO,WACV,EAAC,IAAD,CAAOA,MAAO,2BACV,wFAGA,WACI,WAAG,OAAGC,KAAM,4EAAT,4BAGX,EAAC,IAAD,CAAOD,MAAO,oBACV,YACI,YAAI,EAAC,IAAD,CAAOE,GAAI,gBACf,YAAI,EAAC,IAAD,CAAOA,GAAI,gBACf,YAAI,EAAC,IAAD,CAAOA,GAAI,mBAI3B,EAAC,IAAD,CAAOF,MAAO,WACV,EAAC,IAAD,CAAOA,MAAO,sBACV,+EAGA,WACI,EAAC,IAAD,KAAQL,EAAR,QAGR,EAAC,IAAD,CAAOK,MAAO,aACV,oGAGA,WACI,EAAC,IAAD,KAAQL,EAAR,OAEJ,WACI,EAAC,IAAD,KAAQA,EAAR,MADJ,6CAGA,EAAC,IAAD,WACO,EAAC,IAAD,KAAQA,EAAR,MADP,YAEI,YACI,YAAI,EAAC,IAAD,KAAQA,EAAR,OACJ,YAAI,EAAC,IAAD,KAAQA,EAAR,OACJ,YAAI,EAAC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,WACC,OAAO,UAAMI,MAAOkB,IAAM+B,MAAOtC,KAAKc,MAAMgB,W,aAFZvC,a,yCCFlCC,EAAOC,QAAU,CAAC,MAAQ,iB,iBCA1BD,EAAOC,QAAU,CAAC,MAAQ,iB,kCCD1B,gBAEe8C,6BAAc,I,mCCF7B,YAAe,aAASzB,GACpB,OACI,OAAG3B,KAAM2B,EAAMxB,IAAKJ,MAAO4B,EAAMiB,IAAKS,OAAQ,UAAU,SAAKlD,IAAKwB,EAAMxB,IAAKyC,IAAKjB,EAAMiB,U","file":"route-ottimizzazioneLineare.chunk.9e341.js","sourcesContent":["import {Component} from 'preact'\nimport Split from \"../components/old/split\";\nimport Latex from \"../components/Latex\";\nimport Panel from \"../components/old/panel\";\nimport Example from \"../components/example\";\nimport Todo from \"../components/old/todo\";\nimport Minus from \"../components/old/minus\";\nimport Plus from \"../components/old/plus\";\nimport Code from \"../components/old/code\";\nimport Timer from \"../components/old/timer\";\nimport Image from \"../components/Image\";\n\nconst r = String.raw;\n\nexport default class OttimizzazioneLineare extends Component {\n render() {\n return (\n
\n

Ottimizzazione lineare intera

\n \n \n

\n Ho rimosso il rumore in sottofondo da tutti i video di Ricerca Operativa!\n

\n

\n Guardate i video qui!\n

\n
\n \n
    \n
  1. \n
  2. \n
  3. \n
\n
\n
\n \n \n

\n La funzione obiettivo è la funzione con valore noto sconosciuto:\n

\n

\n {r`z = C_1 \\cdot x_1 + C_2 \\cdot x_2 + C_n \\cdot x_n`}\n

\n
\n \n

\n Funzione della funzione obiettivo che indica la direzione del suo aumento più veloce.\n

\n

\n {r`\\nabla f = \\frac{\\delta f}{\\delta x_1} e_1 + \\frac{\\delta f}{\\delta x_2} e_2 + \\frac{\\delta f}{\\delta x_n} e_n`}\n

\n

\n {r`e_i`} è la direzione della coordinata i-esima.\n

\n \n Se {r`n = 3`}, allora:\n
    \n
  • {r`e_1 = (1, 0, 0)`}
  • \n
  • {r`e_2 = (0, 1, 0)`}
  • \n
  • {r`e_3 = (0, 0, 1)`}
  • \n
\n
\n \n Se la funzione obiettivo è z = 2w + 3x + 4y, il suo gradiente è {r`\\nabla z = (2, 3, 4)`}.\n \n
\n
\n \n \n
    \n
  • Solo equazioni
  • \n
  • Tutte le variabili maggiori di zero
  • \n
\n
\n \n
    \n
  • Equazioni e disequazioni
  • \n
  • Tutte le variabili maggiori di zero
  • \n
\n
\n \n
    \n
  • Equazioni e disequazioni
  • \n
  • Variabili con qualsiasi valore
  • \n
\n
\n
\n \n \n

\n Convertiamo ogni equazione {r`=`} in due disequazioni {r`\\leq`} e {r`\\geq`},\n

\n Why would you ever do that?!\n
\n \n

\n Convertiamo le disequazioni in equazioni aggiungendo una variabile slack.\n

\n \n {r`a \\leq 3`} diventa {r`a + s_1 = 3`}.\n \n
\n \n

\n Sostituiamo le variabili potenzialmente negative (unconstrained) {r`x_j`} con due variabili {r`x_j^+`} e {r`x_j^-`}.\n

\n \n {r`a \\in \\mathbb{Z}`} diventa {r`a^+ \\in \\mathbb{N}`} e {r`-a^- \\in \\mathbb{N}`}.\n \n
\n
\n \n \n

\n La funzione da minimizzare/massimizzare, tipicamente indicata con una {r`z`} al termine noto.\n

\n
\n \n

\n Un modo per rappresentare sistemi in forma standard, anche noto come matrice equivalente completa del sistema.\n

\n \n Il sistema:

\n {r`\n \\begin{cases}\n 2000A + 1000B = z\\\\\n 1A \\leq 3\\\\\n 1B \\leq 3\\\\\n 2A + 2B \\leq 7\n \\end{cases}\n `}

\n Diventa in forma di tableau:

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
TNx_1x_2s_1s_2
z2000100000
31010
30101
72200
\n
\n
\n \n

\n Variabili che hanno tutti 0 e un 1 nella loro colonna del tableu.\n

\n

\n La loro controparte sono le variabili fuori base.\n

\n

\n Un sistema lineare è risolto quando tutte le variabili originali (x_n) sono nella base.\n

\n
\n
\n \n \n

\n Un algoritmo per massimizzare efficientemente variabili di sistemi lineari, derivato da Gauss-Jordan.\n

\n \n E' spiegato semplicemente qui.\n \n
\n \n
    \n
  1. Trasforma il sistema in forma standard.
  2. \n
  3. Finchè ci sono variabili con coefficienti positivi nella funzione obiettivo:\n
      \n
    1. Scegli una variabile della funzione obiettivo, chiamandola variabile entrante. Come? Vedi nel prossimo pannello.
    2. \n
    3. Trova la variabile di base (detta variabile uscente) con il valore minore per il rapporto {r`\\frac{termine\\ noto}{coeff.\\ variabile\\ entrante}`}
    4. \n
    5. Riscrivi tutte le funzioni del sistema in termini della variabile entrante.
    6. \n
    \n
  4. \n
  5. Il termine noto della funzione obiettivo è il tuo risultato.
  6. \n
\n
\n \n

\n Se il problema è rappresentato in forma di tableau, allora esso è risolvibile applicando l'algoritmo di Gauss-Jordan, in aggiunta tenendo conto delle regole per la selezione delle variabili entranti e uscenti.\n

\n
\n \n
    \n
  • Coefficiente maggiore nella funzione obiettivo.
  • \n
  • Incremento maggiore della funzione obiettivo.
  • \n
  • A caso.
  • \n
  • Regola di Bland: scegli variabili entranti e uscenti con indice minore (ovvero, prendi le prime possibili). È usato nella teoria perchè impedisce i cicli infiniti!
  • \n
\n
\n \n \n Ho risolto il problema 3 del file Ex_LP_testo con il Simplex:\n

\n \n

\n
\n
\n
\n \n \n

\n Un estensione del Simplex per permettere la risoluzione di problemi con termini noti negativi.\n

\n

\n Prevede l'introduzione di un problema ausiliario.\n

\n
\n
\n
\n )\n }\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"todo\":\"todo__1UVRh\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"plus\":\"plus__2u13i\"};","import {Component} from 'preact'\nimport style from \"./timer.less\"\n\n\nexport default class Timer extends Component {\n constructor() {\n super();\n this.state = {\n \"now\": Date.now()\n };\n this.timer = null;\n }\n\n componentDidMount() {\n this.timer = setInterval(() => {\n this.setState({\"now\": Date.now()})\n }, 1000)\n }\n\n componentWillUnmount() {\n if(this.timer !== null) {\n clearInterval(this.timer)\n }\n }\n\n render() {\n let dateTo = \"Unknown date\";\n let className = style.timer;\n\n let parts = {\n milliseconds: \"?\",\n seconds: \"?\",\n minutes: \"?\",\n hours: \"?\",\n days: \"?\",\n };\n\n if(this.props.to) {\n dateTo = new Date(this.props.to);\n let timeLeft = dateTo - this.state.now;\n\n if(timeLeft > 0) {\n parts = {\n milliseconds: timeLeft % 1000,\n seconds: Math.floor(timeLeft / 1000) % 60,\n minutes: Math.floor(timeLeft / 60000) % 60,\n hours: Math.floor(timeLeft / 3600000) % 24,\n days: Math.floor(timeLeft / 86400000),\n };\n }\n\n else {\n parts = {\n milliseconds: 0,\n seconds: 0,\n minutes: 0,\n hours: 0,\n days: 0,\n };\n\n className += \" \" + style.expired;\n }\n }\n else {\n className += \" \" + style.unknown;\n }\n\n return (\n
\n
\n {parts.days}\n
\n
\n giorni\n
\n
\n {parts.hours}\n
\n
\n ore\n
\n
\n {parts.minutes}\n
\n
\n minuti\n
\n
\n {parts.seconds}\n
\n
\n secondi\n
\n
\n rimasti\n
\n
\n )\n }\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"timer\":\"timer__K0K_h\",\"days\":\"days__vN3tf\",\"hours\":\"hours__3v0KX\",\"minutes\":\"minutes__vkYk7\",\"seconds\":\"seconds__3gJ99\",\"count\":\"count__1VV4k\",\"text\":\"text__khS4i\",\"remaining\":\"remaining__zUECg\",\"unknown\":\"unknown__af307\",\"expired\":\"expired__1rtHB\"};","import style from './Latex.css';\nimport {useContext} from \"preact/hooks\";\nimport LatexRenderColor from \"../contexts/LatexRenderColor\";\nimport LatexDefaultInline from \"../contexts/LatexDefaultInline\";\n\nexport default function(props) {\n\t// black, blue, brown, cyan, darkgray, gray, green, lightgray, lime, magenta, olive, orange, pink, purple, red, teal, violet, white, yellow\n\tlet renderColor = useContext(LatexRenderColor);\n\tlet defaultInline = useContext(LatexDefaultInline);\n\n\tlet is_inline;\n\tif(props.inline === undefined) {\n\t\tis_inline = defaultInline;\n\t}\n\telse {\n\t\tis_inline = props.inline;\n\t}\n\n\tlet inline = is_inline ? `\\\\inline` : \"\";\n\tlet equation = `${inline} {\\\\color{${renderColor}} ${props.children} }`;\n\n\treturn (\n\t\t{props.children}\n\t\t\t\n\t);\n}\n","import style from \"./minus.css\";\nimport { Component } from 'preact';\n\nexport default class Minus extends Component {\n\trender() {\n\t\treturn {this.props.children};\n\t}\n}\n","import style from \"./plus.css\";\nimport { Component } from 'preact';\n\nexport default class Plus extends Component {\n\trender() {\n\t\treturn {this.props.children};\n\t}\n}\n","import style from \"./todo.css\";\nimport { Component } from 'preact';\n\nexport default class Todo extends Component {\n\trender() {\n\t\treturn {this.props.children};\n\t}\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"minus\":\"minus__2EaF0\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"latex\":\"latex__3zlIu\"};","import {createContext} from \"preact\";\r\n\r\nexport default createContext(true);\r\n","export default function(props) {\r\n return (\r\n {props.alt}/\r\n )\r\n}\r\n"],"sourceRoot":""}