<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8025442413689651638</id><updated>2026-07-06T16:51:57.244-05:00</updated><category term="asintotica"/><category term="ciclo"/><category term="complejidad"/><category term="criptografia"/><category term="encriptacion"/><category term="euclides"/><category term="euler"/><category term="grafo"/><category term="instancia"/><category term="königsberg"/><category term="latex"/><category term="leonhard"/><category term="modulo"/><category term="numeros primos"/><category term="rsa"/><category term="subscript"/><category term="superscript"/><category term="teoria"/><title type='text'>A.C. IAS (Algoritmos Computacionales)</title><subtitle type='html'>Aquí publicare las notas, tareas, actividades y proyectos realizados relativos a la clase de algoritmos computacionales.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-2690170967297856915</id><published>2010-05-21T21:06:00.010-05:00</published><updated>2010-05-21T23:05:24.426-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asintotica"/><category scheme="http://www.blogger.com/atom/ns#" term="complejidad"/><category scheme="http://www.blogger.com/atom/ns#" term="instancia"/><category scheme="http://www.blogger.com/atom/ns#" term="latex"/><category scheme="http://www.blogger.com/atom/ns#" term="subscript"/><category scheme="http://www.blogger.com/atom/ns#" term="superscript"/><title type='text'>Análisis asintotico</title><content type='html'>Ahora demostrare un ejemplo del ejercicio 2 del examen: Análisis asintotico. Esta fue la forma como respondí a la pregunta 2 del &lt;a href=&quot;http://it.ciidit.uanl.mx/%7Eelisa/teaching/comp/alg/pdf/mediocurso2010.pdf&quot;&gt;examen anterior&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
2. Encuentre una función de complejidad asintotica f(n) así que la función g(n) definida experimentalmente por doce puntos en la siguiente tabla sea $\Omega f(n)$.&lt;br /&gt;
&lt;br /&gt;
Justifique esto con una gráfica y discute la calidad de la cota obtenida.&lt;br /&gt;
&lt;br /&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 14&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;  &lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: medium none;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;n&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;g(n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;n&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;g(n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;n&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;g(n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;15&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;130&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;3,800&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;3,982&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;190,000&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;12&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;170&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;203&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;7,500&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;5,002&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;240,000&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;30&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;600&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;603&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;22,000&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;10,393&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;550,000&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;57&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;1,500&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;1,038&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 79.15pt;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;42,000&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;40,039&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 1.1in;&quot; valign=&quot;top&quot; width=&quot;106&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;2,600,000&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Primero noto que con los primeros 4 datos, f(n) podría ser n&lt;sup&gt;2&lt;/sup&gt; porque 3&lt;sup&gt;2&lt;/sup&gt; se aproxima a 15, 12&lt;sup&gt;2&lt;/sup&gt; se aproxima 170, 30&lt;sup&gt;2&lt;/sup&gt; se aproxima a 600 y 57&lt;sup&gt;2&lt;/sup&gt; se aproxima a 1,500 pero al calcular los últimos, no:&lt;br /&gt;
&lt;br /&gt;
3,982&lt;sup&gt;2&lt;/sup&gt;= 15,856,324&lt;br /&gt;
5,002&lt;sup&gt;2&lt;/sup&gt;= 25,020,004&lt;br /&gt;
10,393&lt;sup&gt;2&lt;/sup&gt;= 108,014,449&lt;br /&gt;
40,039&lt;sup&gt;2&lt;/sup&gt;= 1,603,121,251&lt;br /&gt;
&lt;br /&gt;
Como la complejidad asintotica es mas importante a grandes instancias y n&lt;sup&gt;2&lt;/sup&gt; crece demasiado rápido, probaremos con una función inferior pero que obviamente sea superior a n.&lt;br /&gt;
&lt;br /&gt;
3,982&lt;sup&gt;1.5&lt;/sup&gt;= 251,276.5054&lt;br /&gt;
5,002&lt;sup&gt;1.5&lt;/sup&gt;= 353,765.5438&lt;br /&gt;
10,393&lt;sup&gt;1.5&lt;/sup&gt;= 1,059,525.4449&lt;br /&gt;
40,039&lt;sup&gt;1.5&lt;/sup&gt;= 8,011,702.8514&lt;br /&gt;
&lt;br /&gt;
Demasiado, ahora con potencia 1.4:&lt;br /&gt;
&lt;br /&gt;
3,982&lt;sup&gt;1.4&lt;/sup&gt;= 109,683.6155&lt;br /&gt;
5,002&lt;sup&gt;1.4&lt;/sup&gt;= 150,938.8936&lt;br /&gt;
10,393&lt;sup&gt;1.4&lt;/sup&gt;= 420,181.8590&lt;br /&gt;
40,039&lt;sup&gt;1.4&lt;/sup&gt;= 2,776,364.6813&lt;br /&gt;
&lt;br /&gt;
Suficiente para mi, g(n)= n&lt;sup&gt;1.4&lt;/sup&gt;, ahora busquemos una cota inferior.&lt;br /&gt;
&lt;br /&gt;
Sabemos que una cota inferior a g(n) puede ser f(n)= log n, pero no esta tan próxima a  n&lt;sup&gt;1.4&lt;/sup&gt;, una mas inmediata seria  n&lt;sup&gt;1.35&lt;/sup&gt;, así que la tomaremos y comparamos:&lt;br /&gt;
&lt;br /&gt;
3,982&lt;sup&gt;1.35&lt;/sup&gt;= 72,466.4013&lt;br /&gt;
5,002&lt;sup&gt;1.35&lt;/sup&gt;= 98,592.5224&lt;br /&gt;
10,393&lt;sup&gt;1.35&lt;/sup&gt;= 264,606.3437&lt;br /&gt;
40,039&lt;sup&gt;1.35&lt;/sup&gt;= 1,634,377.4061&lt;br /&gt;
&lt;br /&gt;
Los datos son inferiores a los de n&lt;sup&gt;1.4&lt;/sup&gt;, entonces f(n)= n&lt;sup&gt;1.35&lt;/sup&gt; sera nuestra cota inferior u $\Omega f(n)$.&lt;br /&gt;
&lt;br /&gt;
Vemos la gráfica: &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqT7uDzZHwYbrjnqX5DWxN0ZDKjLKQsv4MIG32RwU_dugYl-jEnnrhd-38tZAAR0ZtbImO895XUNuyd1t-oHR9M4GIVhT-56w7eQG7hX5nHRHMiztGNzdWq3IgCKb37SVNwYMTaD_t9vo/s1600/loki.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqT7uDzZHwYbrjnqX5DWxN0ZDKjLKQsv4MIG32RwU_dugYl-jEnnrhd-38tZAAR0ZtbImO895XUNuyd1t-oHR9M4GIVhT-56w7eQG7hX5nHRHMiztGNzdWq3IgCKb37SVNwYMTaD_t9vo/s640/loki.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Como pueden ver la linea roja representa nuestra función g(n) aproximada, la verde la cota inferior f(n) y la azul los datos experimentales de la tabla. La cota inferior resulto bastante buena ya que no nos fuimos hasta log n para hacerla inferior a la lineal  n&lt;sup&gt;1.4&lt;/sup&gt; sino a n&lt;sup&gt;1.35&lt;/sup&gt; que se encuentra inmediatamente debajo de g(n).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Por ultimo me gustaría comentar sobre como realice esta entrada porque a alguien le podría servir en un futuro. Las potencias que se ven por el estilo de n&lt;sup&gt;e&lt;/sup&gt;, se realizan con una herramienta que ya viene incluida en los blogs que se llama superscript y subscript y se hacen escribiendo &lt;code&gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;&lt;/code&gt; y &lt;code&gt;&amp;lt;sub&amp;gt; &amp;lt;/sub&amp;gt;&lt;/code&gt; respectivamente, mientras que los símbolos como $\Omega$ se hacen agregando al blog un gadget (código en java) para que reconozca escritura LaTeX, pero eso ya lo explique en &lt;a href=&quot;http://algoritmoshade.blogspot.com/2010/05/prueba-escritura-latex.html&quot;&gt;esta entrada&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Por otro lado la gráfica la hice con un programa llamado &lt;a href=&quot;http://www.gnuplot.info/&quot;&gt;gnuplot&lt;/a&gt; de descarga y uso gratuito, cuando lo descargue me incluyo un documento tutorial o guía para aprender a usarlo. Es un programa a base de linea de comando pero es muy potente.</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/2690170967297856915/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/puntos-extra.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/2690170967297856915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/2690170967297856915'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/puntos-extra.html' title='Análisis asintotico'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqT7uDzZHwYbrjnqX5DWxN0ZDKjLKQsv4MIG32RwU_dugYl-jEnnrhd-38tZAAR0ZtbImO895XUNuyd1t-oHR9M4GIVhT-56w7eQG7hX5nHRHMiztGNzdWq3IgCKb37SVNwYMTaD_t9vo/s72-c/loki.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-1085458534192129290</id><published>2010-05-17T17:53:00.047-05:00</published><updated>2010-05-21T21:23:19.454-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="criptografia"/><category scheme="http://www.blogger.com/atom/ns#" term="encriptacion"/><category scheme="http://www.blogger.com/atom/ns#" term="euclides"/><category scheme="http://www.blogger.com/atom/ns#" term="modulo"/><category scheme="http://www.blogger.com/atom/ns#" term="numeros primos"/><category scheme="http://www.blogger.com/atom/ns#" term="rsa"/><title type='text'>Encriptacion RSA</title><content type='html'>&lt;blockquote style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&quot;&gt;Encriptacion: (Cifrado, codificación). La encriptación es el proceso para volver  ilegible información considera importante. La información una vez  encriptada sólo puede leerse aplicándole una clave.&lt;br /&gt;
&lt;br /&gt;
Se trata de una medida de seguridad que es usada para almacenar o  transferir información delicada que no debería ser accesible a terceros.  Pueden ser contraseñas,  numeros de tarjetas de crédito, conversaciones privadas, etc. &lt;/blockquote&gt;&lt;br /&gt;
Acabo de leer hace poco sobre un &lt;span style=&quot;font-family: inherit;&quot;&gt;método&lt;/span&gt; para encriptar información que es muy interesante, se creo en 1978 y se llama RSA, siglas de sus creadores: Rivest, Shamir y Adleman; se basa en la dificultad de factorizar números grandes en números primos, por ejemplo, resulta fácil multiplicar 2 números primos para obtener un tercero pero es difícil a partir del tercero obtener sus 2 factores primos. De hecho este es el mejor método de encriptacion que existe y lo usan bancos, instituciones gubernamentales, etc. Un banco de Monterrey, N.L. que usa este sistema proporcinado por &lt;i&gt;RSA&lt;/i&gt;, The Security Division of EMC es Banorte&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://www.banorte.com/portal/banorte.portal?_nfpb=true&amp;amp;_pageLabel=pageService&amp;amp;productId=153&amp;amp;sectionId=972&quot;&gt;Token Banorte&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/SecureID_token_new.JPG/220px-SecureID_token_new.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/SecureID_token_new.JPG/220px-SecureID_token_new.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
La mayoría de los números primos que se utilizan en la encriptacion RSA son de 250 dígitos o mas, esto es para obtener mayor seguridad pues es mas tardado factorizar un numero primo entre mas grande sea. Teóricamente cifras primas de 250 dígitos requieren millones de años para factorizar.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Como funciona exactamente&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Resulta que:&lt;br /&gt;
&lt;br /&gt;
$c \equiv m^{e} \ mod \ n$&lt;br /&gt;
$m \equiv c^{d} \ mod \ n$&lt;br /&gt;
&lt;br /&gt;
Si y solo si&lt;br /&gt;
$n=pq$, p y q son números primos&lt;br /&gt;
$1 &amp;lt; e &amp;lt; \phi (n)$ y $gcd(e, \phi (n))=1$, con $\phi (n)=(p-1)(q-1)$&lt;br /&gt;
Y d cumple con $de \equiv 1 \ mod&amp;nbsp; \ n$&lt;br /&gt;
m seria un mensaje numerico y c su contra parte cifrada.&lt;br /&gt;
e seria la clave publica para encriptar y d la llave privada para desencriptar.&lt;br /&gt;
Nota: phi(n) es la función de Euler.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Procedimiento&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Se buscan dos numeros p y q que sean primos.&lt;/li&gt;
&lt;li&gt;Se obtienen n multiplicando p y q, y phi(n) multiplicando (p-1) y (q-1).&lt;/li&gt;
&lt;li&gt;Se busca un numero e que no tenga divisores comunes con phi(n), y que divida a phi(n)+1 sin dejar residuo.&lt;/li&gt;
&lt;li&gt;Se encuentra d con la division phi(n)+1 entre e.&lt;/li&gt;
&lt;li&gt; Ahora ya tenemos todo y la llave publica sera (e, n) mientras que la privada es (d), como el resto de los numeros (p, q, phi(n)) no los vamos a necesitar, pueden destruirse para mayor seguridad.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Ejemplo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Supongamos que elegimos:&lt;br /&gt;
&lt;br /&gt;
$p=11, \ q=23$, dos números primos pequeños ideales para nuestro ejemplo.&lt;br /&gt;
Entonces calculamos n: $n=pq=253,$&lt;br /&gt;
Calculamos phi(n): $\phi (n)=(p-1)(q-1)=(11-1)(23-1)=220$ &lt;br /&gt;
Y e: $$1 &amp;lt; e &amp;lt; \phi (n)=220 \ y \ gcd(e, 220)=1$$.&lt;br /&gt;
Un numero que lo cumple es 13: $$1 &amp;lt; 13 &amp;lt; \phi (n)=220 \ y \ gcd(13, 220)=1$$&lt;br /&gt;
Ahora d es la division de phi(n)+1 entre e: $\frac{221}{13} =17$. Observamos que se cumple: $(17)(13) \equiv 1 \ mod&amp;nbsp; \ 253$, o que es lo mismo, phi(n)+1 puede ser dividido por e con residuo 0.&lt;br /&gt;
&lt;br /&gt;
Comprobación:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Con el mensaje: 11 &lt;br /&gt;
$c=11^{13} \ mod \ 253=132$&lt;br /&gt;
$m=132^{17}  \ mod \ 253=11$&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Otro ejemplo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Otro ejemplo con mayor claridad seria el siguiente:&lt;br /&gt;
&lt;br /&gt;
$p=3, \ q=11$ &lt;br /&gt;
$n=33$&lt;br /&gt;
$\phi n=(3-1)(11-1)=20$ &lt;br /&gt;
$e=7$ porque cumple con 1&lt;e&gt; &amp;lt; 7 &amp;lt; 20 y gcd(7, 20)=1&lt;/e&gt;&lt;br /&gt;
$d=\frac{\phi (n)+1}{e}=\frac{21}{7} =3$&lt;br /&gt;
&lt;br /&gt;
Comprobación:&lt;br /&gt;
&lt;br /&gt;
Con el mensaje m=2 &lt;br /&gt;
&lt;br /&gt;
$c=m^{e} \ mod \ n=2^{7} \ mod \ 33=128 \ mod \ 33=29$&lt;br /&gt;
$m=c^{d} \ mod \ n=29^{3} \ mod \ 33=24389 \ mod \ 33=2$ &lt;br /&gt;
&lt;br /&gt;
Podemos observar que si introducimos el mensaje m=2 se encripta en c=29 y se puede desencriptar con la llave privada d. Ahora con nuestras llaves es posible encriptar y desencriptar cualquier mensaje numérico por mas largo que sea.&lt;br /&gt;
&lt;br /&gt;
Nota que si vas a realizar operaciones de exponenciacion muy grandes, deberás de utilizar el algoritmo de potenciacion binaria para ahorrar operaciones. &lt;br /&gt;
&lt;br /&gt;
Algunas formas para convertir un texto a numero es aplicando una llave numérica por partes o simplemente convirtiéndolo a valores ASCII (aunque esto no es tan seguro).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Mas información&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/goog_2095932163&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rsa.com/&quot;&gt;http://www.rsa.com/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.tagoror.com/enciclopedia/es/wikipedia/f/fu/funcion_phi_de_euler.html&quot;&gt;http://www.tagoror.com/enciclopedia/es/wikipedia/f/fu/funcion_phi_de_euler.html &lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://boards5.melodysoft.com/canalingenio/la-funcion-phi-de-euler-225.html&quot;&gt;http://boards5.melodysoft.com/canalingenio/la-funcion-phi-de-euler-225.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://neo.lcc.uma.es/evirtual/cdd/tutorial/presentacion/rsa.html&quot;&gt;http://neo.lcc.uma.es/evirtual/cdd/tutorial/presentacion/rsa.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora les mostrare el pseudocodigo que estoy haciendo, no esta terminado pero me da la idea de lo que voy a hacer para implementarlo. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;/*Pseudocodigo para cifrar, metodo RSA*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt; stdio.h &amp;gt;&lt;stdio.h&gt;&lt;br /&gt;
#include &amp;lt; time.h &amp;gt;&lt;math.h&gt;&lt;br /&gt;
#define p long 47&lt;br /&gt;
#define q long 13&lt;br /&gt;
long p, q, n, h, e, d, m;&lt;br /&gt;
char M[4000];&lt;br /&gt;
long a[3], b[3], m[3], res;&lt;br /&gt;
&lt;br /&gt;
n();&lt;br /&gt;
h();&lt;br /&gt;
e();&lt;br /&gt;
d();&lt;br /&gt;
string();&lt;br /&gt;
ps();&lt;br /&gt;
encrypt();&lt;br /&gt;
decrypt();&lt;br /&gt;
show-string();&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; n();&lt;br /&gt;
&amp;nbsp; h();&lt;br /&gt;
&amp;nbsp; e();&lt;br /&gt;
&amp;nbsp; d();&lt;br /&gt;
&amp;nbsp; put-string();&lt;br /&gt;
&amp;nbsp; ps(M)&lt;br /&gt;
&amp;nbsp; encrypt(m);&lt;br /&gt;
&amp;nbsp; decrypt(c);&lt;br /&gt;
&amp;nbsp; ps(m);&lt;br /&gt;
&amp;nbsp; show-string(M);&lt;br /&gt;
&amp;nbsp; getch();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
n()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; //Elegir 2 primos (p y q)&lt;br /&gt;
&amp;nbsp; n=p*q;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; //Funcion phi Euler&lt;br /&gt;
&amp;nbsp; h=(p-1)*(q-1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
e()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; //e&lt;h gcd(e,=&quot;&quot; h)=&quot;1&amp;lt;br&quot; y=&quot;&quot;&gt;&amp;nbsp; long fac[3];&lt;br /&gt;
&amp;nbsp; e=(5*h)/8;&lt;br /&gt;
&amp;nbsp; fac[0]=e;&lt;br /&gt;
&amp;nbsp; fac[1]=h;&lt;br /&gt;
&amp;nbsp; gcd();&lt;br /&gt;
&amp;nbsp; while (fac[1]!=1&amp;amp;&amp;amp;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gcd();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
d()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; //Algoritmo euclideano extendido para calcular &lt;br /&gt;
&amp;nbsp; //el modulo multiplicativo inverso de: e (mod h)&lt;br /&gt;
&amp;nbsp; a[1]=1;&lt;br /&gt;
&amp;nbsp; b[1]=0;&lt;br /&gt;
&amp;nbsp; m[1]=e;&lt;br /&gt;
&amp;nbsp; a[2]=0;&lt;br /&gt;
&amp;nbsp; b[2]=1;&lt;br /&gt;
&amp;nbsp; m[2]=h;&lt;br /&gt;
&amp;nbsp; res=e-(h*m[2]);&lt;br /&gt;
&amp;nbsp; while (m[2]!=1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Correr los valores&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a[0]=a[1];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a[1]=a[2];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b[0]=b[1];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b[1]=b[2];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m[0]=m[1];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m[1]=m[2];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Calcular ultimos valores&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a[2]=a[0]-(a[1]*res);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b[2]=b[0]-(b[1]*res);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m[2]=m[0]-(m[1]*res);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; d=a[2];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; printf(&quot;Introduce el mensaje que quieras encriptar:\n&quot;);&lt;br /&gt;
&amp;nbsp; scanf(&quot;%s&quot;, M);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
ps(char x)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; //Convertir cadena a numeros o viceversa&lt;br /&gt;
&amp;nbsp; if (isalfa(x))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m=tonumber(x);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return m;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M=toalfa(x);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return M;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
long encrypt(long)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; c=pow(m, e) mod n;&lt;br /&gt;
&amp;nbsp; return c;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
long decrypt(long)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; m=pow(c, d) mod n;&lt;br /&gt;
&amp;nbsp; return m;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
show-string()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; printf(&quot;%s&quot;, M);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
gcd()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; //Algoritmo euclidiano&lt;br /&gt;
&amp;nbsp; fac[0]=e;&lt;br /&gt;
&amp;nbsp; fac[1]=h;&lt;br /&gt;
&amp;nbsp; fac[2]=fac[0]%fac[1];&lt;br /&gt;
&amp;nbsp; while (fac[2]!=0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fac[0]=fac[1];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fac[1]=fac[2];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fac[2]=fac[0]%fac[1];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/h&gt;&lt;/math.h&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Seguiré mejorando el pseudocodigo y mejorare la información aquí presente. Pueden darse una vuelta de vez en cuando para ver el avance. También agregare mas enlaces con información por si tienen dudas de como conseguir todos los números para las claves, se supone&amp;nbsp; que se utilizan ciertos métodos de factorizacion como el algoritmo euclideano que aprendimos la clase&lt;/span&gt; pasada en el salon pero por falta de tiempo no la mostrare aquí.&lt;br /&gt;
&lt;br /&gt;
Actualización 18 Mayo 2010: He corregido unas cosas importantes y agregue un ejemplo mas.&lt;br /&gt;
Actualización 21 Mayo 2010: Utilizar algoritmo de potenciacion binaria para ahorrar operaciones.</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/1085458534192129290/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/encriptacion-rsa.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/1085458534192129290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/1085458534192129290'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/encriptacion-rsa.html' title='Encriptacion RSA'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-6606505864349351947</id><published>2010-05-16T20:45:00.513-05:00</published><updated>2010-05-21T22:49:16.939-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ciclo"/><category scheme="http://www.blogger.com/atom/ns#" term="euler"/><category scheme="http://www.blogger.com/atom/ns#" term="grafo"/><category scheme="http://www.blogger.com/atom/ns#" term="königsberg"/><category scheme="http://www.blogger.com/atom/ns#" term="leonhard"/><category scheme="http://www.blogger.com/atom/ns#" term="teoria"/><title type='text'>Proyecto 5: Ciclo euleriano</title><content type='html'>El tema que yo elegí se llama ciclo euleriano, Euler se pronuncia &quot;oil-er&quot;. A este tema también se le llama circuito euleriano, circuito de euler, tour euleriano o tour euler.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Definición&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Un ciclo euleriano es un camino en un grafo G que comienza y termina en el mismo vértice, que incluye cada arista del grafo exactamente una vez y que puede tener vértices repetidos, es decir, un ciclo que incluye todas las aristas de E y que estas no se repitan. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Temas similares&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Este tema esta extremada mente relacionado con el camino euleriano que trata sobre encontrar un camino en un grafo G de manera que se incluyan todas sus aristas sin repetirse, y también es comparado mas aun con el ciclo hamiltoniano que trata sobre un ciclo que incluye todos los vértices una sola vez.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; Orígenes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Este acertijo surge con el problema de los 7 pu&lt;span style=&quot;font-size: small;&quot;&gt;entes de &lt;/span&gt;Königsberg (ciudad alemana del siglo XVIII situada sobre el río Praga) que fue resuelto por el matemático suizo Leonhard Euler en 1736 y publicado en un articulo titulado: &lt;i&gt;Solutio problematis ad geometriam situs pertinentis&lt;/i&gt; (Solución de un problema relacionado con la geometría de posición).&lt;br /&gt;
&lt;br /&gt;
El problema trata sobre atravesar los 7 puentes de la ciudad que conectaban 2 islas, una sola vez cada uno.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://canitz.org/wp-content/uploads/2009/06/inner-harbour.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; src=&quot;http://canitz.org/wp-content/uploads/2009/06/inner-harbour.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;a href=&quot;http://canitz.org/?p=35&quot;&gt;Königsberg&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvXXjQVynSil1oDEAqsF9yFB0NP6Yg23W1M9VQXecJL-qmXzKm6voUbirePiKbyXrdP4IPUgL0ZAqUef3f_NUgXdFdmCsduJEKxXYulFEJnwAonABwNrcrKIHjkbfuqyyjgNdjMqmHAw4/s1600/koenigsberg+selection+bridges.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvXXjQVynSil1oDEAqsF9yFB0NP6Yg23W1M9VQXecJL-qmXzKm6voUbirePiKbyXrdP4IPUgL0ZAqUef3f_NUgXdFdmCsduJEKxXYulFEJnwAonABwNrcrKIHjkbfuqyyjgNdjMqmHAw4/s320/koenigsberg+selection+bridges.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://staff.jccc.net/swilson/misc/images/koenigsberg_1910.jpg&quot;&gt;http://staff.jccc.net/swilson/misc/images/koenigsberg_1910.jpg&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Los puentes son los caminos blancos sobre el río gris.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
Euler resolvio el problema imaginando el territorio de las islas y el rio con un grafo conexo.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;Para entender el problema de los 7 pu&lt;span style=&quot;font-size: small;&quot;&gt;entes de &lt;/span&gt;Königsberg, hay que imaginar que las aristas son los puentes y que los vértices son islas o territorios en la siguiente imagen.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://wapedia.mobi/thumb/553b14740/en/fixed/470/376/Konigsburg_graph.svg?format=jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;256&quot; src=&quot;http://wapedia.mobi/thumb/553b14740/en/fixed/470/376/Konigsburg_graph.svg?format=jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Ahora hay que tratar de encontrar un ciclo que incluya todas las aristas de manera que en el trayecto no se repitan aristas.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Euler descubrió que esto es imposible de hacer en este grafo!, mas no fue el quien dio la demostración matemática sino que fue Carl Hierholzer hasta 1873.&lt;br /&gt;
&lt;br /&gt;
Lo que Leonhard Euler dijo fue (en nuestros términos) que un ciclo euleriano en un grafo G existe si y solo si:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;El grafo era conexo, es decir, hay por lo menos un camino para llegar a cualquier vértice y&lt;/li&gt;
&lt;li&gt;El grado de todos los vértices de G es un numero par o dicho de otra manera, si no existe un solo vértice de grado impar.&lt;/li&gt;
&lt;/ol&gt;Y como podemos observar, el grado de cada vértice en el grafo es un numero impar, de tal manera que ni siquiera se aproxima poseer un ciclo euleriano ya que si quisiéramos crearlo tendríamos que agregar o eliminar las tres arista del centro del grafo o agregarle 2 aristas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Explicación &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Podemos entender el argumento de Euler debido a que en un ciclo euleriano cuando pasamos a través de un vértice tenemos que tener 2 caminos (aristas) o cualquier otro numero par, esto es gra(e) mod 2 = 0, uno para llegar y el otro para partir o viceversa y completar el ciclo, de otro modo nos quedaríamos &quot;atascados&quot; en el mismo vértice o en su defecto jamas podríamos volver, de cualquier modo siempre nos faltaría 1 arista por recorrer para completar el ciclo.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Problema que se debe de resolver&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Se puede decir que Euler resolvió el siguiente problema de decisión:&lt;br /&gt;
&quot;Existe un trayecto que incluya todas las aristas sin repetirse, partiendo de un vértice v y regresando al mismo vértice v, en un grafo G?&quot;.&lt;br /&gt;
&lt;br /&gt;
Sin su algoritmo para determinar este problema de decisión, tendríamos que realizar todos los trayectos posibles para determinar si existe algún ciclo euleriano y esto nos daría una complejidad asintótica O(n!), pero con las simples reglas de Euler obtenemos la complejidad O(n).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ejemplo de ciclo euleriano&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Es interesante observar que no importa cuan grande o complejo sea un grafo, si cumple con las 2 condiciones necesarias anteriores (1 y 2), este posee un ciclo euleriano.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.cs.sunysb.edu/%7Eskiena/combinatorica/animations/anim/euler.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://www.cs.sunysb.edu/%7Eskiena/combinatorica/animations/anim/euler.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
En esta imagen el grafo es conexo además de que el grado de todos los vértices es un numero par.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Algoritmo del problema&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Se pueden realizar varios algoritmos dependiendo de lo que se pretende resolver, por ejemplo, uno que resuelva el problema de decision: Existe un ciclo euleriano en un grafo G?, otro que resuelva el problema de decision: Cual es un ciclo euleriano en G?, e incluso un tercero que resuelva el problema de decisión: Cuales son todos los ciclos eulerianos en G? (una variante del anterior).&lt;br /&gt;
&lt;br /&gt;
Ademas de que pueden existir variaciones del ciclo euleriano para resolver problemas de optimizacion como: Encuentra un ciclo euleriano de manera que se recorran ciertos vertices antes que otros, en este caso se podrian ponderar los vertices de acuerdo a la preferencia y optimizando el trayecto a recorrer para obtener el mejor ciclo posible.&lt;br /&gt;
&lt;br /&gt;
Algoritmo de existencia&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Para cada vértice en el grafo se analizara su grado (ignoramos los vecinos, es trivial).&lt;/li&gt;
&lt;li&gt;Si alguno tiene un grado impar, se dirá que no existe un ciclo euleriano en el grafo y termina el algoritmo.&lt;/li&gt;
&lt;li&gt;Si al final de analizar todos los vértices, nunca se dijo que no existía un ciclo euleriano, entonces se dice que si existe un ciclo euleriano.&lt;/li&gt;
&lt;/ol&gt;Algoritmo de busqueda (cual es un ciclo euleriano?)&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Iniciamos en un vértice al azar o elegido&lt;/li&gt;
&lt;li&gt;Imaginamos una barrera que comienza a recorrer una arista elegida al azar. &lt;/li&gt;
&lt;li&gt;La barrera se movera hasta que pueda llegar a un vértice con grado distinto a 1. La barrera almacenara en una pila cada arista del trayecto que recorrió, en orden.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Nota: Esta barrera reservara un camino de llegada al vértice inicial, asegurando el ciclo.&lt;/li&gt;
&lt;li&gt;La barrera cada vez que se mueve a una nueva posicion, eliminara las aristas recorridas. &lt;/li&gt;
&lt;li&gt;Por otro lado imaginamos un viajero que recorrerá aristas al azar y que por supuesto no tiene acceso a las aristas eliminadas en el trayecto de la barrera.&lt;/li&gt;
&lt;li&gt;Cada vez que se mueve el viajero a una arista vecina, guarda la arista recorrida en una lista o arreglo y elimina esa misma arista (para no volver a pasar por allí).&lt;/li&gt;
&lt;li&gt;Cuando la barrera y el viajero no puedan moverse a ningun vertice vecino, se dice cual es el ciclo euleriano, mostrando primero la lista y luego la pila cuyos elementos aparecen en orden contrario a su introducción.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Nota: Probablemente exista un mejor método para encontrar un ciclo euleriano pero por falta de tiempo solo pensé en este algoritmo.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Complejidad computacional&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
En el algoritmo de existencia consideramos la instancia n como la cantidad de aristas en el grafo, en el paso 1 se sabe de un ciclo de n veces las operaciones que realizara dentro de este. En el segundo paso (que esta dentro del ciclo) se realiza la operación modular con 3 y la comparación con 0 para determinar si el grado es impar, estas son 2 operaciones (2n hasta ahora). Y en el tercer paso solo espera que termine el ciclo para decir que si existe un ciclo euleriano. En total fue:&lt;br /&gt;
&lt;br /&gt;
$O(2n)$, como las constantes no importan es $O(n)$. El problema de existencia de un ciclo euleriano esta en &lt;b&gt;P&lt;/b&gt; porque la complejidad O(n) es polinomial.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Pseudocodigo del algoritmo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Problema de decisión (existe un ciclo euleriano?)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#define num_de_vertices 4000&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;main()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;int i, grad[&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;num_de_vertices&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;];&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;for (i=0;i&amp;lt;=size(grad[]);i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; if (grad[i]&amp;gt;1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; if (grad[i]%3==0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; puts No existe ciclo euleriano;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto end;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; puts No existe ciclo euleriano;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Problema de decisión (cual es un ciclo euleriano?)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#define num_vertices 4000&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int n, fin=0, turno=1, barrera, viajero, ver, aristas[400][400]; //aristas[][] no es mas que una matriz de adyacencia &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;main()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; read datafile; //Se encuentra la información del grafo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; ver= rand(0)%3;//Elegimos un vértice al &quot;azar&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; barrera=ver;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; while (!fin)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; switch (turno) //Turnamos las funciones de barrera y viajero&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 1:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fbarrera();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 2:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fviajero();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; if (detenerbarrera==true&amp;amp;&amp;amp;detenerviajero==true) &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print camino(); //Se terminan de turnar y muestran resultados&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print pila(); //en el orden correcto&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;end &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;fbarrera()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; if (gra(barrera)==0)//Si no tiene a donde ir, marca terminado &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; detenerbarrera();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fin=true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; if (gra(barrera)==1)//Si solo existe un camino posible,se mueve&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pila(barrera); //Almacena el trayecto en que se movió&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; barrera=vecino(barrera);//Aquí se mueve&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eliminar(barrera, vecino(barrera));//Se elimina ese camino //para no repetirlo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; turno++;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;end&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;fviajero()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; if (gra(viajero)==0) &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;//Si no tiene a  donde ir, marca terminado &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; detenerviajero();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; camino(viajero);//Se alamacena el trayecto&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; viajero=vecino(viajero);//Se mueve por una arista permitida&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; eliminar(viajero, vecino(viajero));//Para no repetir aristas&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; turno--;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;end &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;vecino(int x)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; int i; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; for (i=0;i&amp;lt;=num_vertices;i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (aristas[x][j]==1)//Si existe una arista que incide en x, //se regresa el vértice al que lleva la arista&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return alpha(j);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;eliminar(int t, int k)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; aristas[t][k]=null;//Al eliminar se asegura quitar la relacion&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp; aristas[k][t]=null;//en cualquier direccion&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;Análisis asintótico del algoritmo&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para el primer algoritmo en el peor caso es $O(n)$ porque:&lt;br /&gt;
&lt;br /&gt;
Se asigna una constante (num_de_vertices). +1 paso&lt;br /&gt;
El for crea un ciclo donde la complejidad dependerá de los procesos dentro de este.&lt;br /&gt;
Se hacen dos comparaciones, grad[i]&amp;gt;1 y grad[i] mod 3==0, y una operación modular, mod 3. +3n pasos&lt;br /&gt;
&lt;br /&gt;
Tenemos entonces O(3n+3) pero como las constantes no importan es O(n) y resulta polinomial.&lt;br /&gt;
&lt;br /&gt;
En este mismo pseudocodigo en el mejor de los casos es O(1) esto es debido a que el primer vértice introducido puede ser de grado impar y por lo tanto eliminar la posibilidad del grafo en poseer un ciclo euleriano, entonces el caso promedio seria $O(\frac{1+(3n+1)}{2})$, como las constantes son triviales, sigue siendo $O(n)$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Para el segundo algoritmo (de búsqueda) es $O(n)$ porque:&lt;br /&gt;
&lt;br /&gt;
Declaramos una constante, num_vertices, y una variable, turno. +2 pasos&lt;br /&gt;
Asignamos un vertice al &quot;azar&quot;. +2 pasos&lt;br /&gt;
Igualamos barrera y ver. +1 paso&lt;br /&gt;
Se intercambiaran el mando del programa fbarrera y fviajero por turnos, esto depende de que tan rapido encuentre el ciclo euleriano.&lt;br /&gt;
&lt;br /&gt;
fbarrera va a comparar si termino de buscar el ciclo (1 operación), compara el grado del vértice actual (1 procedimiento si se almacena su grado). +2 pasos&lt;br /&gt;
&lt;br /&gt;
Aquí viene lo interesante, si el grado de vértice es 1, la barrera puede avanzar y realizara las operaciones siguientes:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Almacena su trayecto en la pila (1 operación), se cambia de posición (1 operación) a un nodo vecino que para encontrarlo se hace en aproximadamente n pasos dependiendo del grado del vértice actual (n operaciones aproximadamente), y elimina la arista que recorrió (2 operaciones). n+4 pasos &lt;/li&gt;
&lt;li&gt;Incrementa el turno. +1 paso &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
fviajero almacena su trayecto en un arreglo o lista, se mueve (1 operación) a un nodo vecino que para encontrarlo se hace en aproximadamente n pasos dependiendo el grado de vértice actual y se elimina la arista que recorrió (2 operaciones). n+3 pasos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
El resultado es $O((t/2)(2n+9))$, donde t es la cantidad de veces que se turnaron.&lt;br /&gt;
&lt;br /&gt;
Nota: En realidad la complejidad asintotica es menor que lo anterior pero no me meteré en detalles numéricos.&lt;br /&gt;
&lt;br /&gt;
Al final las constantes se ignoran y nos quedamos con $O(n)$. El problema esta en &lt;b&gt;P&lt;/b&gt;, tiempo polinomial.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Estructuras de datos utilizadas&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Utilice arreglos unidimensionales en el primer pseudocodigo y arreglos unidimensionales, pilas y listas en el segundo.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Aplicaciones&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Una aplicación del ciclo euleriano puede ser en la optimizacion de recorridos en mapas, por ejemplo si nos preguntaran si existe un camino para un viaje de turistas de manera que estos no recorran cualquiera de los caminos mas de una vez o en la versión extendida, cual es el mejor ciclo para los turistas recorriendo ciertos lugares antes que otros y sin pasar por los mismos caminos mas de una vez?.&lt;br /&gt;
&lt;br /&gt;
También se me acaba de ocurrir que se puede aplicar en la determinación de flexibilidad en problemas de decisión en grandes instituciones o empresas, por ejemplo si se crea un modelo gráfico que simulara las opciones por las que puede optar una empresa con aristas y los estados finales al llevar a cabo lo optado con vértices, se podría conocer entonces el grado de flexibilidad en decisiones de cada estado dependiendo si existe un ciclo euleriano que permita volver al estado inicial por opciones distintas (aristas distintas), esto se vuelve mas real si permitimos la eliminación de opciones con el tiempo, es decir, eliminar aristas cada cierto tiempo, sea al azar o no.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Curiosidades&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Los 7 puentes de Königsberg fueron bombardeados y destruidos por los aliados en 1944 y solo 5 se reconstruyeron.&lt;/li&gt;
&lt;li&gt;La ciudad Königsberg fue renombrada Kalingraado y ahora es parte de Rusia.&lt;/li&gt;
&lt;li&gt;Ahora es posible visitar los puentes con un camino de Euler pero no con un ciclo de Euler.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;El problema de los 7 puentes de Königsberg resuelto por L. Euler abrio paso a la topología, rama de las matemáticas que se encarga de estudiar propiedades    de los objetos geométricos que tienen que ver con la posicion relativa entre puntos.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Fuentes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1 &lt;a href=&quot;http://www.itl.nist.gov/div897/sqg/dads/HTML/eulercycle.html&quot;&gt;http://www.itl.nist.gov/div897/sqg/dads/HTML/eulercycle.html&lt;/a&gt;&lt;br /&gt;
2 &lt;a href=&quot;http://www.economicexpert.com/a/Eulerian:path.htm&quot;&gt;http://www.economicexpert.com/a/Eulerian:path.htm&lt;/a&gt;&lt;br /&gt;
3 &lt;a href=&quot;http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK4/NODE165.HTM&quot;&gt;http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK4/NODE165.HTM&lt;/a&gt;&lt;br /&gt;
4 &lt;a href=&quot;http://books.google.com.mx/books?id=7XUSn0IKQEgC&amp;amp;pg=PA502&amp;amp;lpg=PA502&amp;amp;dq=euler+cycle+applications&amp;amp;source=bl&amp;amp;ots=z6cFQPOS0e&amp;amp;sig=gCQCrKXT4T2ZWCFZLVtJ9k-juhk&amp;amp;hl=es&amp;amp;ei=x-DpS5DhHoyCtgOX3IX-Bw&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=9&amp;amp;ved=0CFkQ6AEwCA#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;http://books.google.com.mx/books?id=7XUSn0IKQEgC&amp;amp;pg=PA502&amp;amp;lpg=PA502&amp;amp;dq=euler+cycle+applications&amp;amp;source=bl&amp;amp;ots=z6cFQPOS0e&amp;amp;sig=gCQCrKXT4T2ZWCFZLVtJ9k-juhk&amp;amp;hl=es&amp;amp;ei=x-DpS5DhHoyCtgOX3IX-Bw&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=9&amp;amp;ved=0CFkQ6AEwCA#v=onepage&amp;amp;q&amp;amp;f=false&lt;/a&gt;&lt;br /&gt;
5 &lt;a href=&quot;http://theoremoftheweek.wordpress.com/2009/09/29/theorem-8-eulerian-circuits/&quot;&gt;http://theoremoftheweek.wordpress.com/2009/09/29/theorem-8-eulerian-circuits/&lt;/a&gt;&lt;br /&gt;
6 &lt;a href=&quot;http://www.personal.kent.edu/%7Ermuhamma/Algorithms/MyAlgorithms/GraphAlgor/eulerTour.htm&quot;&gt;http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/eulerTour.htm&lt;/a&gt;&lt;br /&gt;
7 &lt;a href=&quot;http://mathworld.wolfram.com/EulerianCycle.html&quot;&gt;http://mathworld.wolfram.com/EulerianCycle.html&lt;/a&gt;&lt;br /&gt;
8 &lt;a href=&quot;http://mathforum.org/isaac/problems/bridges2.html&quot;&gt;http://mathforum.org/isaac/problems/bridges2.html&lt;/a&gt;&lt;br /&gt;
9 &lt;a href=&quot;http://www.cs.sunysb.edu/%7Eskiena/combinatorica/animations/euler.html&quot;&gt;http://www.cs.sunysb.edu/~skiena/combinatorica/animations/euler.html&lt;/a&gt;&lt;br /&gt;
10 &lt;a href=&quot;http://mathdl.maa.org/mathDL/46/?pa=content&amp;amp;sa=viewDocument&amp;amp;nodeId=1310&amp;amp;bodyId=1452&quot;&gt;http://mathdl.maa.org/mathDL/46/?pa=content&amp;amp;sa=viewDocument&amp;amp;nodeId=1310&amp;amp;bodyId=1452&lt;/a&gt; (explica cada párrafo de la demostración escrita por L. Euler)&lt;br /&gt;
11 &lt;a href=&quot;http://math.dartmouth.edu/%7Eeuler/docs/originals/E053.pdf&quot;&gt;http://math.dartmouth.edu/~euler/docs/originals/E053.pdf&lt;/a&gt;&lt;br /&gt;
12 &lt;a href=&quot;http://www.iesezequielgonzalez.com/matematicas/grafos.htm&quot;&gt;http://www.iesezequielgonzalez.com/matematicas/grafos.htm&lt;/a&gt;&lt;br /&gt;
13 &lt;a href=&quot;http://www.mathematische-basteleien.de/house.html&quot;&gt;http://www.mathematische-basteleien.de/house.html&lt;/a&gt;&lt;br /&gt;
14 &lt;a href=&quot;http://books.google.com.mx/books?id=aFDWuZZslUUC&amp;amp;printsec=frontcover&amp;amp;dq=CRC+concise+encyclopedia+of+mathematics&amp;amp;ei=f1z0S9qxLpTukgSM_YS8Bw&amp;amp;cd=1&quot;&gt;http://books.google.com.mx/books?id=aFDWuZZslUUC&amp;amp;printsec=frontcover&amp;amp;dq=CRC+concise+encyclopedia+of+mathematics&amp;amp;ei=f1z0S9qxLpTukgSM_YS8Bw&amp;amp;cd=1&lt;/a&gt;&lt;br /&gt;
15 &lt;a href=&quot;http://books.google.com.mx/books?id=TrXd-gxPhVYC&amp;amp;printsec=frontcover&amp;amp;dq=The+algorithm+design+manual+2&amp;amp;ei=x1z0S9aPFJf4lASauI2uBw&amp;amp;cd=1&quot;&gt;http://books.google.com.mx/books?id=TrXd-gxPhVYC&amp;amp;printsec=frontcover&amp;amp;dq=The+algorithm+design+manual+2&amp;amp;ei=x1z0S9aPFJf4lASauI2uBw&amp;amp;cd=1&lt;/a&gt;&lt;br /&gt;
16 &lt;a href=&quot;http://www.ual.es/%7Ejlrodri/Topgen5/introduccion.html&quot;&gt;http://www.ual.es/~jlrodri/Topgen5/introduccion.html&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;Comentario de auto evaluación&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
Creo que realice un buen trabajo con el reporte del blog, inclui todos los requisitos, agregue imagenes, trate de explicar de la manera mas simple posible, por otro lado mostré el algoritmo en que yo pensé para poder resolver el problema, y en algunas partes pedi la participacion del lector, estuvo muy completo e inclui 16 enlaces fuente al final para que los lectores encontraran mas información del tema.&lt;br /&gt;
&lt;br /&gt;
Respecto a la presentacion, los primeros segundos al comenzar estaba algo nervioso pero despues se me fueron conforme pasaba el tiempo y me concentraba en la teoria, la cantidad de diapositivas para mostrar me parecio que se excedia en 2 para el tiempo de esta ocasion pero me las salte y las explique muy rapido, aun asi esas 2 diapositivas solo resaltaban el ejemplo posterior del algoritmo y fue mas facil que el publico entendiera la solución del problema de esta ultima forma. El diseno de la presentacion fue muy simple para mantener todo limpio, claro y conciso.&lt;br /&gt;
&lt;br /&gt;
También hice al publico partícipe de la presentación y comente alguna curiosidad pequeña respecto al problema del ciclo euleriano al terminar. El tiempo que me tarde fue un poquito mas del limite acordado pero valieron la pena esos segundos extra para el publico.</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/6606505864349351947/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/proyecto-5-ciclo-euleriano.html#comment-form' title='7 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/6606505864349351947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/6606505864349351947'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/proyecto-5-ciclo-euleriano.html' title='Proyecto 5: Ciclo euleriano'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvXXjQVynSil1oDEAqsF9yFB0NP6Yg23W1M9VQXecJL-qmXzKm6voUbirePiKbyXrdP4IPUgL0ZAqUef3f_NUgXdFdmCsduJEKxXYulFEJnwAonABwNrcrKIHjkbfuqyyjgNdjMqmHAw4/s72-c/koenigsberg+selection+bridges.jpg" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-4342031310096684960</id><published>2010-05-06T19:42:00.004-05:00</published><updated>2010-05-06T19:58:08.925-05:00</updated><title type='text'>Isomorfismo</title><content type='html'>&lt;b&gt;Que es isomorfismo?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
La propiedad de un grafo  que indica que dicho grafo puede obtenerse de otro re etiquetando sus vértices.&lt;br /&gt;
&lt;br /&gt;
Matemáticamente hablando:&lt;br /&gt;
&lt;br /&gt;
G= (V, E) y G&#39;=  (V&#39;, E&#39;) son isomorfos $G\cong G&#39;$ si existe una aplicación biyectiva f entre sus respectivos conjuntos de vértices V y V&#39; que preserva sus adyacencias:&lt;br /&gt;
&lt;br /&gt;
$$\forall v,w \in V,&amp;nbsp; v~w \Leftrightarrow f(v)~f(w)$$&lt;br /&gt;
&lt;br /&gt;
La idea es simple, todos los vecinos que pertenecen a un vértice, también deben pertenecer al vértice del otro grafo.&lt;br /&gt;
&lt;br /&gt;
Por ejemplo si el grafo G(1, 5) posee un vértice v cuyos vecinos son {a, b, c, d, e} y otro grafo M(1, 5) posee un vértice x cuyos vecinos también son {a, b, c, d, e}, entonces el vértice v es el mismo que el vértice x y los grafos G y M son los mismos a excepción por su ubicación en el espacio. Eso es isomorfismo, pero es mas claro verlo con un ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWvqPeI9u-iZ8etq1ug2j5b1v_nUBgJToccYwkqVx-SPTl9c5_AuwrNwfGrMdnOZ6n7LO4znnifpxRk-p9EeLCTvIdRYD5aJs62EO5wJtXdLmscAw0Zn1_5OgFOFCwv5vM2OOc-RmS-vc/s1600/Isomorfismo+-+Copy.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWvqPeI9u-iZ8etq1ug2j5b1v_nUBgJToccYwkqVx-SPTl9c5_AuwrNwfGrMdnOZ6n7LO4znnifpxRk-p9EeLCTvIdRYD5aJs62EO5wJtXdLmscAw0Zn1_5OgFOFCwv5vM2OOc-RmS-vc/s320/Isomorfismo+-+Copy.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
En la imagen las posiciones de los vértices cambian al igual que algunas aristas, sin embargo todos los vértices conservan los mismos vecinos, entonces ambos grafos son isomorfos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Fuentes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
http://mate.cucei.udg.mx/matdis/5gra/5gra6.htm&lt;br /&gt;
http://web.udl.es/usuaris/p4088280/teaching/terminologia.pdf&lt;br /&gt;
http://mathworld.wolfram.com/GraphIsomorphismComplete.html</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/4342031310096684960/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/isoformismo.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/4342031310096684960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/4342031310096684960'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/isoformismo.html' title='Isomorfismo'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWvqPeI9u-iZ8etq1ug2j5b1v_nUBgJToccYwkqVx-SPTl9c5_AuwrNwfGrMdnOZ6n7LO4znnifpxRk-p9EeLCTvIdRYD5aJs62EO5wJtXdLmscAw0Zn1_5OgFOFCwv5vM2OOc-RmS-vc/s72-c/Isomorfismo+-+Copy.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-5799486398158427320</id><published>2010-05-06T17:44:00.032-05:00</published><updated>2010-05-06T18:27:52.786-05:00</updated><title type='text'>Prueba de escritura LaTeX</title><content type='html'>Prueba 1:&lt;br /&gt;
&lt;br /&gt;
$$\int\int \frac{\sqrt{2x}^7\cos^3{8x}}{9-\sqrt{4x^2-672}}&amp;nbsp; dx$$ $$\LaTeX !$$&lt;br /&gt;
&lt;br /&gt;
Acabo de agregar una función que me permite interpretar código LaTeX en el blog, la forma de hacer esto se describe fácilmente en esta mini &lt;a href=&quot;http://watchmath.com/vlog/?p=438&quot;&gt;guía&lt;/a&gt;. Aquí esta otra &lt;a href=&quot;http://mathcache.appspot.com/static/docs.html&quot;&gt;guía&lt;/a&gt; diferente que hace lo mismo (también proporciona el código javascript), eligan la que mas les guste.&lt;br /&gt;
&lt;br /&gt;
Resumiendo el procedimiento: Copien el código que aparece en esa guía y agregenlo como gadget HTML/Javascript a su blog.&lt;br /&gt;
&lt;br /&gt;
Ahora pueden escribir cualquier símbolo matemático entre 2 signos de dinero $.&lt;br /&gt;
Ejemplo: (signo dinero)codigo LaTeX(signo dinero)&lt;br /&gt;
&lt;br /&gt;
Algunos otros ejemplos:&lt;br /&gt;
&lt;br /&gt;
$$\exists \forall \wedge \vee \ni \bigcup \notin \nabla (\partial \int \hbar \prod \delta \mu \lambda \alpha \zeta \sqrt{\sum\gamma\eta}\ointH\Gamma)$$&lt;br /&gt;
&lt;pre class=&quot;javascript&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/5799486398158427320/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/prueba-escritura-latex.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/5799486398158427320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/5799486398158427320'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/05/prueba-escritura-latex.html' title='Prueba de escritura LaTeX'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-1343009297088398804</id><published>2010-04-26T00:00:00.025-05:00</published><updated>2010-05-06T19:55:14.670-05:00</updated><title type='text'>Proyecto 4: Merge sort</title><content type='html'>El proyecto que elegimos mis compañeros y yo se trata de un algoritmo que ordena un arreglo con un método de división recursiva (merge sort u ordenamiento por mezcla).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Que hice yo:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;Ayude a editar la presentación, cree un pseudocódigo, hice parte de la implementación interactiva y subí el documento a Internet.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Como me salio:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;El diseño de la presentación fue correcto, limpio y ordenado, el pseudocódigo que hice no me convenció del todo porque lo&amp;nbsp; hice muy rápido casi sin pensarlo y tal vez debí de agregar mas detalles pero por otro lado esta bien mantenerlo simple y general para que el publico lo entienda rápidamente, y en cuanto a la implementación interactiva no estoy seguro de darle el orden correcto aunque de todas maneras se entienden los pasos del algoritmo.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Que podría mejorar:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;Probablemente la longitud del pseudocódigo, en lugar de dejarlo sin detalles, crear el código en lenguaje C y por otro lado no dejar las cosas para ultima hora.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;En qué aspectos estoy bien y en qué me hace falta mejorar&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
Estoy bien al tomar el mando del equipo porque casi nadie tiene la iniciativa, también en cuanto al esfuerzo extra para hacer las cosas bien. Estoy mal en la falta de responsabilidad y en dejar todo a última hora ya que aunque quiera hacer un esfuerzo extra para mejorar las cosas, ya no alcanza el tiempo.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ayudo a los demás o me apoyo en ellos:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;Definitivamente ayudo a los demás, si hay tiempo les explico como funcionarían algunas cosas, si no hay tiempo les digo que después les explico para poder avanzar en cuanto al proyecto y que en cambio traten de leer un poco mas sobre el tema.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;b&gt;Quién se encarga de coordinar el trabajo:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;En todos los equipos a los que he pertenecido, siempre soy yo el que coordino el trabajo, observo las capacidades y formo grupos mas pequeños, les pido que cada quien haga algo al igual que los demás, para que todos cooperemos al mismo tiempo (cuando se puede).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Qué papel tomo yo:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;El que coordina a los demás y el que hace los códigos o pseudocódigos. Tomo mucha iniciativa y espero lo mismo de los demás aunque la mayoría de las veces no ocurra. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reflexión personal:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;Me falto ampliar el pseudocódigo porque iba a la carrera, siendo sincero no es que no administre mi tiempo si no que la organización con los demás miembros fue difícil, planeamos trabajar cosas juntos y acordamos fechas para reunirnos pero los horarios junto con la distancia nos impidió muchas cosas. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Links a los blogs:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://jo0eel.blogspot.com/&quot;&gt;Joel Ángel  Escamilla Montemayor&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://jorgemtz90.blogspot.com/&quot;&gt;&lt;br /&gt;
Jorge  Martínez Chavez&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Descargar:&lt;/b&gt; &lt;br /&gt;
&lt;a href=&quot;http://download683.mediafire.com/w2zmo2jmxITg/z2dmnoo2w2j/Presentacion+P4+FINAL.pptx&quot;&gt;Descargar&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://docs.google.com/fileview?id=0B3K-hUtrPZdFMjZlNGY5NDAtYzhhMy00ODNjLWEyZjQtMzZhMDcwNjljMmE2&amp;amp;hl=en&quot;&gt;Visualizar&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Dinámica interactiva:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.cosc.canterbury.ac.nz/mukundan/dsal/MSort.html&quot;&gt;Applet Java&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/1343009297088398804/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/04/proyecto-4-merge-sort.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/1343009297088398804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/1343009297088398804'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/04/proyecto-4-merge-sort.html' title='Proyecto 4: Merge sort'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-6992317330119304954</id><published>2010-03-21T23:59:00.014-05:00</published><updated>2010-05-06T18:31:17.551-05:00</updated><title type='text'>Proyecto 3: Calcular potencias elevadas</title><content type='html'>El problema que optamos para el proyecto 3 es el de calcular potencias elevadas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Objetivo:&lt;/b&gt; Calcular una potencia elevada en el menor tiempo posible empleando algoritmo iterativo y/o recursivo&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Que es recursion:&lt;/b&gt; Un algoritmo recursivo es aquel que realiza una llamada a una subrutina inherente a la misma, haciendo que los pasos o acciones dentro de esta, puedan ser repetidos sucesivamente hasta que una o varias variables pueda ser operada al convertirla en un dato conocido. Las propiedades de las subrutinas nos permiten expander su uso a una infinidad de programas, incluso a los mas complejos.&lt;br /&gt;
&lt;br /&gt;
Un algoritmo recursivo se puede usar cuando se necesitan realizar las mismas acciones muchas veces, que aunque no es mas eficiente que el algoritmo iterativo, ahorra tiempo al implementarlo.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Como trabajamos como grupo:&lt;/b&gt;  La organización no fue lo mejor en nuestro equipo, aunque con algo de  esfuerzo hacia el final, pudimos terminar todo lo planeado. Creo que tome un papel importante dentro de este, ya que me fui viendo cada vez mas frecuente como el que iba liderando al equipo ya que asignaba actividades o corregía algunos trabajos.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Que fue mi contribución al trabajo:&lt;/b&gt; Realice ambos algoritmos (iterativo y recursivo), los 2 pseudocodigos los realice a partir de un código  hecho por mi compañera en lenguaje C, que corregí previamente. Hice ademas las gráficas del análisis asintotico con el programa &quot;gnuplot&quot;, la corrección de la introducción, la conclusión y las recomendaciones.&lt;br /&gt;
También la complejidad computacional, el análisis paso a paso solo del algoritmo iterativo y al igual que mi compañero, subí el documento PDF a Internet para mayor seguridad.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Que podría mejorar en el futuro:&lt;/b&gt; La creación de los pseudocódigos y la forma de organizarme individualmente y con mi equipo.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Links a los blogs:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://doranellygonzalez.blogspot.com/&quot;&gt;Dora Nelly González Martínez&lt;/a&gt; &lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;PowerPoint.Slide&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;span style=&quot;color: black; font-family: Calibri; font-size: 32pt;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://jo0eel.blogspot.com/&quot;&gt;Joel Ángel  Escamilla Montemayor&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://jorgemtz90.blogspot.com/&quot;&gt;&lt;br /&gt;
Jorge  Martínez Chavez &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Links del documento PDF:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://docs.google.com/fileview?id=0B-dTVWVH-7_YMWFiOTUxNGItNmRhMS00NjhlLTg4NDktOTJiNjU4YTQwYWYx&amp;amp;hl=en&quot;&gt;Visualizar&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://docs.google.com/uc?export=download&amp;amp;id=0B-dTVWVH-7_YMWFiOTUxNGItNmRhMS00NjhlLTg4NDktOTJiNjU4YTQwYWYx&quot;&gt;Descargar&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/El%20problema%20que%20optamos%20para%20el%20proyecto%203%20es%20el%20de%20calcular%20potencias%20elevadas.%20%20Objetivo:%20%20%20Link%20al%20documento%20PDF:%3Ca%20href=%22http://download545.mediafire.com/fimlotejeh4g/umeaw4kwmm0/Presentacion+P3+final.pdf%22%3E%3C/a%3E&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/El%20problema%20que%20optamos%20para%20el%20proyecto%203%20es%20el%20de%20calcular%20potencias%20elevadas.%20%20Objetivo:%20%20%20Link%20al%20documento%20PDF:%3Ca%20href=%22http://download545.mediafire.com/fimlotejeh4g/umeaw4kwmm0/Presentacion+P3+final.pdf%22%3E%3C/a%3E&quot;&gt;&lt;br /&gt;
&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/6992317330119304954/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/03/proyecto-3.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/6992317330119304954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/6992317330119304954'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/03/proyecto-3.html' title='Proyecto 3: Calcular potencias elevadas'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-929823795872910856</id><published>2010-03-05T00:59:00.013-06:00</published><updated>2010-03-05T02:28:40.628-06:00</updated><title type='text'>Proyecto 2: Árbol de expansión mínima</title><content type='html'>&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 14&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_editdata.mso&quot; rel=&quot;Edit-Time-Data&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1107304683 0 0 415 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
h1
	{mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-link:&quot;Heading 1 Char&quot;;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:1;
	font-size:24.0pt;
	font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;
	font-weight:bold;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:purple;
	mso-themecolor:followedhyperlink;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
span.Heading1Char
	{mso-style-name:&quot;Heading 1 Char&quot;;
	mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:&quot;Heading 1&quot;;
	mso-ansi-font-size:24.0pt;
	mso-bidi-font-size:24.0pt;
	font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;
	mso-ascii-font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;
	mso-hansi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-font-kerning:18.0pt;
	mso-fareast-language:ES-MX;
	font-weight:bold;}
span.texhtml
	{mso-style-name:texhtml;
	mso-style-unhide:no;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
 /* List Definitions */
 @list l0
	{mso-list-id:611058926;
	mso-list-type:hybrid;
	mso-list-template-ids:-1053136508 134873103 134873113 134873115 134873103 134873113 134873115 134873103 134873113 134873115;}
@list l0:level1
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level2
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level3
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l0:level4
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level5
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level6
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l0:level7
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level8
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;}
@list l0:level9
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l1
	{mso-list-id:953248134;
	mso-list-template-ids:-55391472;}
@list l2
	{mso-list-id:1046103512;
	mso-list-template-ids:-2112423212;}
@list l2:level1
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:&quot;Courier New&quot;;
	mso-bidi-font-family:&quot;Times New Roman&quot;;}
@list l2:level3
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2:level4
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2:level5
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2:level6
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2:level7
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2:level8
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2:level9
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l3
	{mso-list-id:1835805282;
	mso-list-template-ids:1483890308;}
@list l4
	{mso-list-id:1909683909;
	mso-list-template-ids:-1985826372;}
@list l5
	{mso-list-id:1945384898;
	mso-list-template-ids:-1639934122;}
@list l1:level1 lfo3
	{mso-level-start-at:2;}
@list l4:level1 lfo4
	{mso-level-start-at:3;}
@list l5:level1 lfo5
	{mso-level-start-at:4;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--&gt;
&lt;/style&gt;  &lt;/div&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;El problema que yo elegí es: Árbol de expansión mínima o minimum spanning tree (MST) &lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;Objetivo: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Se pretende a partir de un grafo conexo, construir un árbol o subgrafo sin ciclos, &amp;nbsp;conteniendo todos los vértices del grafo inicial y con la suma de distancias o pesos mínimos posibles. Es decir, buscamos la expansión mínima.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Aplicaciones: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;La aplicación de estos problemas se ubica en las redes de comunicación eléctrica, telefónica, carretera, ferroviaria, aérea, marítima, etc.&lt;/span&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;En donde los nodos representan un consumo eléctrico, teléfonos aeropuertos, computadoras,etc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;En &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;sistemas distribuidos, interpretación de datos climatológicos, visión artificial, análisis de imágenes, extracción de rasgos de parentesco, análisis de clusters y búsqueda de superestructuras de quasar, plegamiento de proteínas, reconocimiento de células cancerosas, y otros). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;Ejemplo, si la compañía de televisión por cable desea instalar en un vecindario sus cables pero estos solamente pueden recorrer por patrones o caminos específicos, seria útil saber cuales caminos son los mas cortos para así ahorrar la mayor cantidad de cable posible.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;Otra aplicación es la de las redes de telecomunicación para optimizar las distancias recorridas y asi mismo el material utilizado. Una similar a esta última es utilizada en redes de información entre servidores y computadoras cliente, para disminuir la distancia, aumentar la velocidad de transmisión de información y reducir los costos.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Otra aplicación mas, aunque menos obvia es que el árbol de expansión &amp;nbsp;total mínima puede ser usado como solución aproximada al problema del viajante de comercio (traveling salesman problem), recuerde que encontrar la solución óptima a este problema es NP-Hard. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Representación: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;Nuestro grafo tiene un numero de vértices, así como ramas o conexiones entre estos vértices, además tiene un numero representante de la distancia o expansión entre ambos vértices. Matemáticamente se expresa &lt;/span&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;G(V, E) &lt;/span&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;donde V = (v1, v2, … vn ) es un conjunto finito de vértices (nodos) y E = &lt;abbr title=&quot; eij,= (vi, vj ), vi, vj ε V &quot;&gt;Eij&lt;/abbr&gt; en un conjunto finito de enlaces que representan la conexión entre los terminales o estaciones. Cada enlace tiene un número positivo real asociado denotado por W = &lt;abbr title=&quot; wij,= w (vi, vj ), wij &amp;gt; 0, vi, vj ε V
 &quot;&gt;Wij&lt;/abbr&gt; representando distancia, costo, etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: inherit; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.people.vcu.edu/%7Egasmerom/MAT131/k4-e.GIF&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.people.vcu.edu/%7Egasmerom/MAT131/k4-e.GIF&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.people.vcu.edu/%7Egasmerom/MAT131/K6-mst.GIF&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://www.people.vcu.edu/%7Egasmerom/MAT131/K6-mst.GIF&quot; width=&quot;176&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt; text-align: center;&quot;&gt;&lt;span style=&quot;color: #595959; font-size: small;&quot;&gt;&lt;a href=&quot;http://www.people.vcu.edu/%7Egasmerom/MAT131/mst.html&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;http://www.people.vcu.edu/~gasmerom/MAT131/mst.html&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;h1 style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Definido matemáticamente: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: inherit; text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqw2baOx0IZI4w4fm-Rz7ZfY2wta-ysreDVA_zBGHSoD63u0vaVqbfwhoobrcE_ixo_SX4hlgGIhJLHXd0Fu3T02SPe8YWgXLZEp_mjGN_nbAHIIgMQ0BG3ISUqp54-OC0I88Eq999UO4/s1600-h/MST+Matematicamente.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;308&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqw2baOx0IZI4w4fm-Rz7ZfY2wta-ysreDVA_zBGHSoD63u0vaVqbfwhoobrcE_ixo_SX4hlgGIhJLHXd0Fu3T02SPe8YWgXLZEp_mjGN_nbAHIIgMQ0BG3ISUqp54-OC0I88Eq999UO4/s640/MST+Matematicamente.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;Ejemplo de instancia y solución optima:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;El tránsito de Rusia esta planificando la construcción de una línea de sistemas de transito que conecte 7 zonas principales de la ciudad. (A, B, C, D, E, F, G). Donde los kilómetros entre ellas se representan son un numero en el arista correspondiente. Cada kilómetro de construcción le costara al tránsito 4 millones.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;El transito desea acortar la distancia de traslación entre las 7 zonas pero asegurando no gastar demasiado del presupuesto. Es decir, desean optimizar la construcción por kilómetro recorrido.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Esto se ilustra como:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNfxFmU1khuEzT9iwYf0KkpjQMm7qJschMZsfia3qVOEAzWf07gfIqNhu0fwhyphenhyphenS3It0-mM10nGnXdMcjVdcM4ws4O1vnqfsboF3TLD0phBLPgsRBpZM4G2hvVB-KuuTkMSHYa4Zsr5hLM/s1600-h/prim+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNfxFmU1khuEzT9iwYf0KkpjQMm7qJschMZsfia3qVOEAzWf07gfIqNhu0fwhyphenhyphenS3It0-mM10nGnXdMcjVdcM4ws4O1vnqfsboF3TLD0phBLPgsRBpZM4G2hvVB-KuuTkMSHYa4Zsr5hLM/s320/prim+1.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Teniendo en cuenta las distancias entre las zonas, se puede resolver de la siguiente manera.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: medium none; font-family: inherit;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: 1pt solid rgb(163, 163, 163); padding: 4pt; width: 163.5pt;&quot; valign=&quot;top&quot; width=&quot;218&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjNL8cc8HHMhviEaOE8H0cpMDKWAFIm1o0p54YxTQwupw-W1iSsBarNANrqH5L0ys54XCAd_6qTTRGWUEk3L-ubvw5HhqIjO_KKdbvmz-i_eInp9zPVWLKAZbMD9WmrBpfYJn72DB5EPo/s1600-h/kru+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjNL8cc8HHMhviEaOE8H0cpMDKWAFIm1o0p54YxTQwupw-W1iSsBarNANrqH5L0ys54XCAd_6qTTRGWUEk3L-ubvw5HhqIjO_KKdbvmz-i_eInp9zPVWLKAZbMD9WmrBpfYJn72DB5EPo/s320/kru+1.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: rgb(163, 163, 163) rgb(163, 163, 163) rgb(163, 163, 163) -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 4pt; width: 393.7pt;&quot; valign=&quot;top&quot; width=&quot;525&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;AD&lt;/b&gt; y &lt;b&gt;CE&lt;/b&gt; son las aristas mas cortas, con peso   5, y &lt;b&gt;AD&lt;/b&gt; se ha elegido &lt;a href=&quot;http://es.wikipedia.org/w/index.php?title=Arbitrariamente&amp;amp;action=edit&amp;amp;redlink=1&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;arbitrariamente&lt;/span&gt;&lt;/a&gt;,   por tanto se resalta.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163); border-style: none solid solid; border-width: medium 1pt 1pt; padding: 4pt; width: 163.5pt;&quot; valign=&quot;top&quot; width=&quot;218&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTfV_rh9GeIo5aqCQLChoSPCSWnrqMNDiYf-tTIH_ckEBovGoSdcsiZU_NOKc1_dTKbhO61QMjaCG5XwQVu9IHEahSByRO_8Ndm0YvNWbh2NrqqDNW-I7xgeIlja2-ZkgE37ESrX-yJTE/s1600-h/kru+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTfV_rh9GeIo5aqCQLChoSPCSWnrqMNDiYf-tTIH_ckEBovGoSdcsiZU_NOKc1_dTKbhO61QMjaCG5XwQVu9IHEahSByRO_8Ndm0YvNWbh2NrqqDNW-I7xgeIlja2-ZkgE37ESrX-yJTE/s320/kru+2.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163) -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 4pt; width: 393.7pt;&quot; valign=&quot;top&quot; width=&quot;525&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Sin embargo, ahora es &lt;b&gt;CE&lt;/b&gt;   la arista mas pequeña que no forma ciclos, con distancia 5, por lo que se   resalta como segunda arista.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163); border-style: none solid solid; border-width: medium 1pt 1pt; padding: 4pt; width: 163.5pt;&quot; valign=&quot;top&quot; width=&quot;218&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqWu3cgnVCzgjFajcWtrpTibVsmQ3Slg6CJWkvFOqnPoUkUuLHogZ0liY0V_sL1fGC7I93c9XD6AJNOkxECwx6WFHiLAxC7-MdK14p1b5E59SI6vyK3gVmoWhcf_m4IMdY8OLH94ZHEqE/s1600-h/kru+3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqWu3cgnVCzgjFajcWtrpTibVsmQ3Slg6CJWkvFOqnPoUkUuLHogZ0liY0V_sL1fGC7I93c9XD6AJNOkxECwx6WFHiLAxC7-MdK14p1b5E59SI6vyK3gVmoWhcf_m4IMdY8OLH94ZHEqE/s320/kru+3.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163) -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 4pt; width: 393.7pt;&quot; valign=&quot;top&quot; width=&quot;525&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;La siguiente arista, &lt;b&gt;DF&lt;/b&gt;   con distancia 6, ha sido resaltada utilizando el mismo método.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163); border-style: none solid solid; border-width: medium 1pt 1pt; padding: 4pt; width: 163.5pt;&quot; valign=&quot;top&quot; width=&quot;218&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuQh4lbaWso3YGVP4bM3_utznHQLlNYlLxm6B_95teKMxV_B3rDBHsDaQfbl7iiDAX47UdIa6p5B55_sAdtTYon5UuT5wMRB_AiMMOPjJ2UdrFPvRdcTB35DdLfmKzLLzrLpd85oFeKOw/s1600-h/kru+4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuQh4lbaWso3YGVP4bM3_utznHQLlNYlLxm6B_95teKMxV_B3rDBHsDaQfbl7iiDAX47UdIa6p5B55_sAdtTYon5UuT5wMRB_AiMMOPjJ2UdrFPvRdcTB35DdLfmKzLLzrLpd85oFeKOw/s320/kru+4.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163) -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 4pt; width: 393.7pt;&quot; valign=&quot;top&quot; width=&quot;525&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;La siguientes aristas mas   pequeñas son &lt;b&gt;AB&lt;/b&gt; y &lt;b&gt;BE&lt;/b&gt;, ambas con distancia 7. &lt;b&gt;AB&lt;/b&gt; se elige   arbitrariamente, y se resalta. La arista &lt;b&gt;BD&lt;/b&gt; se resalta en rojo, porque   formaría un ciclo &lt;b&gt;ABD&lt;/b&gt; si se hubiera elegido.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163); border-style: none solid solid; border-width: medium 1pt 1pt; padding: 4pt; width: 163.5pt;&quot; valign=&quot;top&quot; width=&quot;218&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDqgC5897nauqmu_5j6Ltu3wroih67pEim-IzYp4B_7WLzKIKv4_eMWNCSdOJJ-JAdHmqylBd4LXKcyIqB3BGz1cLB6KexAu9plT2mc7Q8I0Xx9SzcwO72AFDIESpeJWJz7_mEyKTuYaA/s1600-h/kru+5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDqgC5897nauqmu_5j6Ltu3wroih67pEim-IzYp4B_7WLzKIKv4_eMWNCSdOJJ-JAdHmqylBd4LXKcyIqB3BGz1cLB6KexAu9plT2mc7Q8I0Xx9SzcwO72AFDIESpeJWJz7_mEyKTuYaA/s320/kru+5.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163) -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 4pt; width: 393.7pt;&quot; valign=&quot;top&quot; width=&quot;525&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;El proceso continúa marcando   las aristas, &lt;b&gt;BE&lt;/b&gt; con distancia 7. Muchas otras aristas se marcan en   rojo en este paso: &lt;b&gt;BC&lt;/b&gt; (formaría el ciclo &lt;b&gt;BCE&lt;/b&gt;), &lt;b&gt;DE&lt;/b&gt; (formaría   el ciclo &lt;b&gt;DEBA&lt;/b&gt;), y &lt;b&gt;FE&lt;/b&gt; (formaría el ciclo &lt;b&gt;FEBAD&lt;/b&gt;).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163); border-style: none solid solid; border-width: medium 1pt 1pt; padding: 4pt; width: 163.5pt;&quot; valign=&quot;top&quot; width=&quot;218&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq0N3Z_9z0hSszW0aalA0uFaZCV7JEe4K_b3uuGy_mc0C0wZ5-Ic8UxF0DAbHkoaD8ZrRi1UGMHWB3ErFGNhf2leBWEFJ4Zq3TfKyq_5fgj8rgT7glqq7gfkAwGE77sp4Dobt7AKNdCI8/s1600-h/kru+6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq0N3Z_9z0hSszW0aalA0uFaZCV7JEe4K_b3uuGy_mc0C0wZ5-Ic8UxF0DAbHkoaD8ZrRi1UGMHWB3ErFGNhf2leBWEFJ4Zq3TfKyq_5fgj8rgT7glqq7gfkAwGE77sp4Dobt7AKNdCI8/s320/kru+6.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color rgb(163, 163, 163) rgb(163, 163, 163) -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 4pt; width: 393.7pt;&quot; valign=&quot;top&quot; width=&quot;525&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Finalmente, el proceso termina   con la arista &lt;b&gt;EG&lt;/b&gt; de distancia 9, y se ha encontrado &lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;el árbol de expansión mínima.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;El total de kilómetros obtenidos son 39 y el costo resultante es 156 millones.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Qué pasaría si se hubiera construido en lugar de la distancia BE, la distancia BC?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Respuesta: El costo aumentaría a 160 millones.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;Formular un problema de decisión correspondiente:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Existe más de una forma de resolver la expansión mínima de un grafo &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;G(V, E)?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Si, existen 4 algoritmos para su solución, estos son:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1.&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Algoritmo de Kruskal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2.&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Algoritmo de Prims&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3.&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Algoritmo de Boruvka&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt 0.5in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Con complejidad O(E log n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt 0.5in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;4.&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Algoritmo de Edmond&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt 0.5in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Con complejidad &lt;/span&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-size: small;&quot;&gt;O(E log n) para un árbol esparcido y O(n&lt;sup&gt;2&lt;/sup&gt;) para uno denso.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 14&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1593833729 1073750107 16 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:purple;
	mso-themecolor:followedhyperlink;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;  &lt;br /&gt;
&lt;div style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Este problema fue resuelto independientemente por &lt;a href=&quot;http://personales.upv.es/arodrigu/grafos/Dijkstra.htm&quot;&gt;&lt;b&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;Dijkstra&lt;/span&gt;&lt;/b&gt;&lt;/a&gt; (1959), Kruskal (1956) y &lt;a href=&quot;http://personales.upv.es/arodrigu/grafos/Prim.htm&quot;&gt;&lt;b&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;Prim&lt;/span&gt;&lt;/b&gt;&lt;/a&gt; (1957) y la existencia de un algoritmo polinomial (que todos ellos demostraron) es una grata sorpresa, debido a que un grafo con N vértices puede llegar a contener N&lt;sup&gt;N-2&lt;/sup&gt; subárboles T*.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;La complejidad asintótica del algoritmo&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzRH79z-4-0F-TW988oc9SMco8mo4qwLvNemb2pSpWu21SSe-CnWUgVqT6jLwOr_NOsUJw2bvBCR4k0a5x3WfChlhhb4yH8SMdS22Ig6HuqxW3YccR6qhojxUEaJA57FUbVcechHSPYVk/s1600-h/complejidad+asintotica.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzRH79z-4-0F-TW988oc9SMco8mo4qwLvNemb2pSpWu21SSe-CnWUgVqT6jLwOr_NOsUJw2bvBCR4k0a5x3WfChlhhb4yH8SMdS22Ig6HuqxW3YccR6qhojxUEaJA57FUbVcechHSPYVk/s640/complejidad+asintotica.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span id=&quot;goog_1267777483228&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;El algoritmo de solución es NP duro?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyfYlJwYGfQQTcbheBCxBzELkuQXvk2SrI5ZgshMFMGWQEpEfnUdG-OhBinXnIXGKjqo9QJH9oj-TRfZudEXTUl1cwoVgu6Fi0sjAc_XlGB5_FyirQ1YdtUSnnP_5punrnM0jF4kt_ImI/s1600-h/NP+duro.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;68&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyfYlJwYGfQQTcbheBCxBzELkuQXvk2SrI5ZgshMFMGWQEpEfnUdG-OhBinXnIXGKjqo9QJH9oj-TRfZudEXTUl1cwoVgu6Fi0sjAc_XlGB5_FyirQ1YdtUSnnP_5punrnM0jF4kt_ImI/s640/NP+duro.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;P&lt;/span&gt;&lt;/b&gt;&lt;b&gt;resentar un algoritmo para el problema de optimización&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Algoritmo de Prim&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Los pasos son:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;font-size-adjust: none; font-size: small; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Se marca un nodo cualquiera, será el nodo de partida. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;font-size-adjust: none; font-size: small; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Seleccionamos la arista de menor valor incidente en el nodo marcado anteriormente, y marcamos el otro nodo en el que incide. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3.&lt;/span&gt;&lt;span style=&quot;font-size-adjust: none; font-size: small; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Repetir el paso 2 siempre que la arista elegida enlace un nodo marcado y otro que no lo esté. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;4.&lt;/span&gt;&lt;span style=&quot;font-size-adjust: none; font-size: small; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;El proceso termina cuando tenemos todos los nodos del grafo marcados. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Ejemplo: &lt;/b&gt;Determinar el árbol de mínima expansión para el siguiente grafo:&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigP2n6iUaIdM7eNmW52lf2USWBQEPu8pHBdIDp_8CljN5wN9u4zVyEGCQBsmrVWQoRw66qlKeqFLFzZu1qlR0GdUnH26VyfgbUp__w8XwCOdR8RVAOY9Uy9PXoWhLh1kKb84cLmnqGXPc/s1600-h/alg+prim+3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;142&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigP2n6iUaIdM7eNmW52lf2USWBQEPu8pHBdIDp_8CljN5wN9u4zVyEGCQBsmrVWQoRw66qlKeqFLFzZu1qlR0GdUnH26VyfgbUp__w8XwCOdR8RVAOY9Uy9PXoWhLh1kKb84cLmnqGXPc/s400/alg+prim+3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 27pt; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;·&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Siguiendo el algoritmo de Prim, tenemos: &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Elegimos, por ejemplo, el nodo&lt;b&gt; 1&lt;/b&gt; y lo marcamos.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Elegimos la arista con menor valor incidente en 1, la&lt;b&gt; (1, 3)&lt;/b&gt; = 1 la marcamos y marcamos el otro nodo en el que incide, el &lt;b&gt;3&lt;/b&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Elegimos la arista con menor valor incidente en un nodo marcado y otro que no lo esté, la &lt;b&gt;(1, 2)&lt;/b&gt; = 3 la marcamos y marcamos el nodo no marcado, el &lt;b&gt;2&lt;/b&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Elegimos la arista con menor valor incidente en un nodo marcado y otro que no lo esté, la &lt;b&gt;(2, 5)&lt;/b&gt; = 5 la marcamos y marcamos el nodo no marcado, el &lt;b&gt;5&lt;/b&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Elegimos la arista con menor valor incidente en un nodo marcado y otro que no lo esté, la &lt;b&gt;(5, 6)&lt;/b&gt; = 1 la marcamos y marcamos el nodo no marcado, el &lt;b&gt;6&lt;/b&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Elegimos la arista con menor valor incidente en un nodo marcado y otro que no lo esté, la &lt;b&gt;(5, 7)&lt;/b&gt; = 2 la marcamos y marcamos el nodo no marcado, el &lt;b&gt;7&lt;/b&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Elegimos la arista con menor valor incidente en un nodo marcado y otro que no lo esté, la &lt;b&gt;(5, 4)&lt;/b&gt; = 6 la marcamos y marcamos el nodo no marcado, el &lt;b&gt;4&lt;/b&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FIN. Finalizamos dado que tenemos marcados los 7 nodos del grafo.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin: 0in 0in 0.0001pt 0.75in; text-indent: -0.25in; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;o&lt;span style=&quot;font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Por tanto el árbol de mínima expansión resultante sería:&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR49YaVxOJe5vBVKBbIm1weLL1yQ0h7uAHdzeNCieHXfNw70NDOPgmMf8j24ooTMVlA0mcso6tElWm5q9v9iliOonevUzLLsOxoLDsz2Vl7uJu_RTldPnLm9mp2QvD-U2aMAHHTfaY4Wo/s1600-h/alg+prim+4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR49YaVxOJe5vBVKBbIm1weLL1yQ0h7uAHdzeNCieHXfNw70NDOPgmMf8j24ooTMVlA0mcso6tElWm5q9v9iliOonevUzLLsOxoLDsz2Vl7uJu_RTldPnLm9mp2QvD-U2aMAHHTfaY4Wo/s400/alg+prim+4.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Aquí hay un pseudocódigo de Prim para resolverlo, y otro ejemplo de ejecución.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;b&gt;JARNIK&lt;/b&gt; (Grafo G, nodo_fuente s)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Inicializamos todos los nodos del grafo. La distancia la ponemos a infinito y el padre de cada nodo a NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Encolamos, en una cola de prioridad donde la prioridad es la distancia, todas las parejas &lt;nodo,distancia&gt; del grafo&lt;/nodo,distancia&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;por cada&lt;/b&gt; u en V[G] &lt;b&gt;hacer&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distancia[u] = INFINITO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padre[u] = NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Añadir(cola,&amp;lt;u,distancia[u]&amp;gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distancia[s]=0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;mientras&lt;/b&gt; cola != 0 &lt;b&gt;do&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // OJO: Se entiende por mayor prioridad aquel nodo cuya distancia[u] es menor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u = extraer_minimo(cola) //devuelve el minimo y lo elimina de la cola.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;por cada&lt;/b&gt; &lt;b&gt;v&lt;/b&gt; adyacente a &#39;&lt;b&gt;u&#39;&lt;/b&gt; &lt;b&gt;hacer&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;si&lt;/b&gt; ((v &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;∈&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; cola) &lt;b&gt;&amp;amp;&amp;amp;&lt;/b&gt; (distancia[v] &amp;gt; peso(u, v)) &lt;b&gt;entonces&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padre[v] = u&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distancia[v] = peso(u, v)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Actualizar(cola,&amp;lt;v,distancia[v]&amp;gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Imagen&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Descripción&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;No visto&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;En el grafo&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;En el árbol&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNfxFmU1khuEzT9iwYf0KkpjQMm7qJschMZsfia3qVOEAzWf07gfIqNhu0fwhyphenhyphenS3It0-mM10nGnXdMcjVdcM4ws4O1vnqfsboF3TLD0phBLPgsRBpZM4G2hvVB-KuuTkMSHYa4Zsr5hLM/s1600-h/prim+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;158&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNfxFmU1khuEzT9iwYf0KkpjQMm7qJschMZsfia3qVOEAzWf07gfIqNhu0fwhyphenhyphenS3It0-mM10nGnXdMcjVdcM4ws4O1vnqfsboF3TLD0phBLPgsRBpZM4G2hvVB-KuuTkMSHYa4Zsr5hLM/s200/prim+1.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Este es   el grafo ponderado de partida. No es un árbol ya que requiere que no haya   circuitos y en este grafo los hay. Los números cerca de las aristas indican   el peso. Ninguna de las aristas está marcada, y el vértice &lt;b&gt;D&lt;/b&gt; ha sido   elegido arbitrariamente como el punto de partida.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;C, G&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A, B,   E, F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;D&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd4YTZtH5lTLB1Ebz5LWb0_gb3prWOmOwMctOjGzU5hjiS2eRlwygOu6pRLivexSqwfQK-Krew9Dd2BZkWEmcCM0xKI72Y3JI50f1Qjrt6V4cG5qCbqL63H6lTKkJgQWz6SuPlnFz2tE8/s1600-h/prim+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd4YTZtH5lTLB1Ebz5LWb0_gb3prWOmOwMctOjGzU5hjiS2eRlwygOu6pRLivexSqwfQK-Krew9Dd2BZkWEmcCM0xKI72Y3JI50f1Qjrt6V4cG5qCbqL63H6lTKkJgQWz6SuPlnFz2tE8/s320/prim+2.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;El   segundo vértice es el más cercano a &lt;b&gt;D&lt;/b&gt;: &lt;b&gt;A&lt;/b&gt; está a 5 de distancia,   &lt;b&gt;B&lt;/b&gt; a 9, &lt;b&gt;E&lt;/b&gt; a 15 y &lt;b&gt;F&lt;/b&gt; a 6. De estos, 5 es el valor más   pequeño, así que marcamos la arista &lt;b&gt;DA&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;C, G&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;B, E, F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A, D&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMOFpgKxSrmLsHMqlaf-eBU8EH3DRLP-fgni8kCBiEJyVg0v-OcPl6S-YhMkkoCdW4HyXIzcObQcPLZE81-xGgGkGQgFmGWMhXOGr440aepw1q9juux3c3RbbxZA7UuylLuItu-dBRjDM/s1600-h/prim+3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMOFpgKxSrmLsHMqlaf-eBU8EH3DRLP-fgni8kCBiEJyVg0v-OcPl6S-YhMkkoCdW4HyXIzcObQcPLZE81-xGgGkGQgFmGWMhXOGr440aepw1q9juux3c3RbbxZA7UuylLuItu-dBRjDM/s320/prim+3.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;El   próximo vértice a elegir es el más cercano a &lt;b&gt;D&lt;/b&gt; o &lt;b&gt;A&lt;/b&gt;. &lt;b&gt;B&lt;/b&gt;   está a 9 de distancia de &lt;b&gt;D&lt;/b&gt; y a 7 de &lt;b&gt;A&lt;/b&gt;, &lt;b&gt;E&lt;/b&gt; está a 15, y &lt;b&gt;F&lt;/b&gt;   está a 6. 6 es el valor más pequeño, así que marcamos el vértice &lt;b&gt;F&lt;/b&gt; y a   la arista &lt;b&gt;DF&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;C&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;B, E, G&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A, D, F&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNjIc4gQIyJlS38D2g18yUmIygZggHe197qUC-ZHHl-PiuGldflXADULnPJ551_Yy1kGqBFj2E247UlWLsl4UCLDGGdJxHOiOGjXYLPPCkgfqe6iLiXJio1CyQhQWX7gxDkf7oftafpDE/s1600-h/prim+4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNjIc4gQIyJlS38D2g18yUmIygZggHe197qUC-ZHHl-PiuGldflXADULnPJ551_Yy1kGqBFj2E247UlWLsl4UCLDGGdJxHOiOGjXYLPPCkgfqe6iLiXJio1CyQhQWX7gxDkf7oftafpDE/s320/prim+4.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;El   algoritmo continua. El vértice &lt;b&gt;B&lt;/b&gt;, que está a una distancia de 7 de &lt;b&gt;A&lt;/b&gt;,   es el siguiente marcado. En este punto la arista &lt;b&gt;DB&lt;/b&gt; es marcada en rojo   porque sus dos extremos ya están en el árbol y por lo tanto no podrá ser   utilizado.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;null&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;C, E, G&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A, D,   F, B&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6gi9JIIosYh_-CtLhfL4Ouxr_bcK41WF1d4AycaMxyyCV6vvaTBVROqJ21sbkTjXMUazbHe799hoSPtrsV_i8SKF3AjB7y4P0iW-vYPvrWj3QnTTe6UIHOEBXMrBIBbg-ADrotDjQ5jY/s1600-h/prim+5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6gi9JIIosYh_-CtLhfL4Ouxr_bcK41WF1d4AycaMxyyCV6vvaTBVROqJ21sbkTjXMUazbHe799hoSPtrsV_i8SKF3AjB7y4P0iW-vYPvrWj3QnTTe6UIHOEBXMrBIBbg-ADrotDjQ5jY/s320/prim+5.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Aquí   hay que elegir entre &lt;b&gt;C&lt;/b&gt;, &lt;b&gt;E&lt;/b&gt; y &lt;b&gt;G&lt;/b&gt;. &lt;b&gt;C&lt;/b&gt; está a 8 de   distancia de &lt;b&gt;B&lt;/b&gt;, &lt;b&gt;E&lt;/b&gt; está a 7 de distancia de &lt;b&gt;B&lt;/b&gt;, y &lt;b&gt;G&lt;/b&gt;   está a 11 de distancia de &lt;b&gt;F&lt;/b&gt;. &lt;b&gt;E&lt;/b&gt; está más cerca, entonces   marcamos el vértice &lt;b&gt;E&lt;/b&gt; y la arista &lt;b&gt;EB&lt;/b&gt;. Otras dos aristas fueron   marcadas en rojo porque ambos vértices que unen fueron agregados al árbol.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;null&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;C, G&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A, D,   F, B, E&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMneErL6giMBJnDS1T5GJ26i6lw860id43gP5qCQ0_aJPDpISGUlniE_aKpPckEhBDNDQrAmv3qxN8-mamrtOTyKF2OMHzbdKQqHanFd7Q50-vD288W1K86G5LLERk8NZEZ-PZgsuW3dc/s1600-h/prim+6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMneErL6giMBJnDS1T5GJ26i6lw860id43gP5qCQ0_aJPDpISGUlniE_aKpPckEhBDNDQrAmv3qxN8-mamrtOTyKF2OMHzbdKQqHanFd7Q50-vD288W1K86G5LLERk8NZEZ-PZgsuW3dc/s320/prim+6.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Sólo   quedan disponibles &lt;b&gt;C&lt;/b&gt; y &lt;b&gt;G&lt;/b&gt;. &lt;b&gt;C&lt;/b&gt; está a 5 de distancia de &lt;b&gt;E&lt;/b&gt;,   y &lt;b&gt;G&lt;/b&gt; a 9 de distancia de &lt;b&gt;E&lt;/b&gt;. Se elige &lt;b&gt;C&lt;/b&gt;, y se marca con el   arco &lt;b&gt;EC&lt;/b&gt;. El arco &lt;b&gt;BC&lt;/b&gt; también se marca con rojo.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;null&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;G&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A, D,   F, B, E, C&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRyAnWnXboZE52t1ahDr6_xiIVPa6khMgHA9axf4khNmr4le7OOY01Tf_Bd8d1RDKDCfPESyecu0JLXrqEJ6QDbp-rQhNhoPoRqvlaChxtZr5220QEG1A6ylMw2mZfych7eHeCuWrjKe0/s1600-h/prim+7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRyAnWnXboZE52t1ahDr6_xiIVPa6khMgHA9axf4khNmr4le7OOY01Tf_Bd8d1RDKDCfPESyecu0JLXrqEJ6QDbp-rQhNhoPoRqvlaChxtZr5220QEG1A6ylMw2mZfych7eHeCuWrjKe0/s320/prim+7.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;G&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; es el único vértice pendiente,   y está más cerca de &lt;b&gt;E&lt;/b&gt; que de &lt;b&gt;F&lt;/b&gt;, así que se agrega &lt;b&gt;EG&lt;/b&gt; al   árbol. Todos los vértices están ya marcados, el &lt;a href=&quot;http://es.wikipedia.org/wiki/%C3%81rbol_de_expansi%C3%B3n_m%C3%ADnimo&quot; title=&quot;Árbol de expansión mínimo&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;árbol de expansión mínimo&lt;/span&gt;&lt;/a&gt; se muestra en   verde. En este caso con un peso de 39.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;null&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;null&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 3.75pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A, D,   F, B, E, C, G&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;Finalmente les dejo un link para que vean como el algoritmo de Prim resuelve el problema paso a paso:&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 14&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5CShade%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;&lt;span lang=&quot;X-NONE&quot; style=&quot;font-size: small; line-height: 115%;&quot;&gt;&lt;a href=&quot;http://lear.inforg.uniovi.es/ioperativa/TutorialGrafos/minimaexp/prim/appletPrim.htm&quot;&gt;&lt;span style=&quot;color: blue; text-decoration: none;&quot;&gt;Applet de simulacion de Prim&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmrWZqWE5OsdAnNEBPJfGrpWAdc9ojr6U2DyyKbzGFiloUIO04ynzBjTe8SQxYP5g3T0oA7jQFHjvI2_BL_XFbRYH2BKgvgXq2f2bqD4MbLaDFCWJeRkCiHZCt_BzhpGY1uiADvXOlsSw/s1600-h/mst+prim.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;448&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmrWZqWE5OsdAnNEBPJfGrpWAdc9ojr6U2DyyKbzGFiloUIO04ynzBjTe8SQxYP5g3T0oA7jQFHjvI2_BL_XFbRYH2BKgvgXq2f2bqD4MbLaDFCWJeRkCiHZCt_BzhpGY1uiADvXOlsSw/s640/mst+prim.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: #595959;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: black;&quot;&gt;Bibliografía:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;http://www.tcs.tifr.res.in/%7Eprahladh/teaching/2009-10/limits/lectures/lec01.pdf&quot;&gt;http://www.tcs.tifr.res.in/~prahladh/teaching/2009-10/limits/lectures/lec01.pdf&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;http://www.lab.dit.upm.es/%7Elprg/material/apuntes/o/index.html&quot;&gt;http://www.lab.dit.upm.es/~lprg/material/apuntes/o/index.html&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span lang=&quot;X-NONE&quot;&gt;&lt;a href=&quot;http://www.people.vcu.edu/%7Egasmerom/MAT131/mst.html&quot;&gt;http://www.people.vcu.edu/~gasmerom/MAT131/mst.html&lt;/a&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: #595959;&quot;&gt;&lt;a href=&quot;http://www.ics.uci.edu/%7Eeppstein/161/960206.html&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;http://www.ics.uci.edu/~eppstein/161/960206.html&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: #595959;&quot;&gt;&lt;a href=&quot;http://www-b2.is.tokushima-u.ac.jp/%7Eikeda/suuri/kruskal/Kruskal.shtml&quot;&gt;http://www-b2.is.tokushima-u.ac.jp/~ikeda/suuri/kruskal/Kruskal.shtml&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Algoritmo_de_Prim&quot;&gt;http://es.wikipedia.org/wiki/Algoritmo_de_Prim&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: #595959;&quot;&gt;&lt;a href=&quot;http://lear.inforg.uniovi.es/ioperativa/TutorialGrafos/minimaexp/minimaexp.htm&quot;&gt;http://lear.inforg.uniovi.es/ioperativa/TutorialGrafos/minimaexp/minimaexp.htm&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Algoritmo_de_Kruskal&quot;&gt;http://es.wikipedia.org/wiki/Algoritmo_de_Kruskal&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 
14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Kruskal%27s_algorithm&quot;&gt;http://en.wikipedia.org/wiki/Kruskal%27s_algorithm&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 
14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://personales.upv.es/arodrigu/grafos/Kruskal.htm&quot;&gt;http://personales.upv.es/arodrigu/grafos/Kruskal.htm&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 
14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.mitecnologico.com/Main/ArbolesGeneradoresMinimales&quot;&gt;http://www.mitecnologico.com/Main/ArbolesGeneradoresMinimales&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 
14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://docencia.udea.edu.co/regionalizacion/teoriaderedes/minimos.htm&quot;&gt;http://docencia.udea.edu.co/regionalizacion/teoriaderedes/minimos.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 
14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://sisbib.unmsm.edu.pe/bibvirtual/publicaciones/indata/v05_n2/algorit_evo.htm&quot;&gt;http://sisbib.unmsm.edu.pe/bibvirtual/publicaciones/indata/v05_n2/algorit_evo.htm&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 
14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://dns.uls.cl/%7Eej/fit_2009/teo_fit_2009/Lect_2009/Fit_1998/el.htm&quot;&gt;http://dns.uls.cl/~ej/fit_2009/teo_fit_2009/Lect_2009/Fit_1998/el.htm&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 
14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.algorithm-code.com/wiki/Prim%27s_algorithm&quot;&gt;http://www.algorithm-code.com/wiki/Prim%27s_algorithm&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 
14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;/div&gt;&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://148.202.148.5/cursos/mt260/matedisc/unidad5/tem5.7.htm&quot;&gt;http://148.202.148.5/cursos/mt260/matedisc/unidad5/tem5.7.htm&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;OneNote.File&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft OneNote 14&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;  &lt;br /&gt;
&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #595959; margin: 0in;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: inherit; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; margin: 0in 0in 0.0001pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/929823795872910856/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/03/el-problema-que-yo-elegi-es-arbol-de.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/929823795872910856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/929823795872910856'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/03/el-problema-que-yo-elegi-es-arbol-de.html' title='Proyecto 2: Árbol de expansión mínima'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqw2baOx0IZI4w4fm-Rz7ZfY2wta-ysreDVA_zBGHSoD63u0vaVqbfwhoobrcE_ixo_SX4hlgGIhJLHXd0Fu3T02SPe8YWgXLZEp_mjGN_nbAHIIgMQ0BG3ISUqp54-OC0I88Eq999UO4/s72-c/MST+Matematicamente.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-397985170961482636</id><published>2010-02-19T22:14:00.004-06:00</published><updated>2010-02-25T13:03:32.617-06:00</updated><title type='text'>Proyecto 1: #2 Buscar una buena ruta</title><content type='html'>Objetivo: Buscar una buena ruta de un lugar a otro en un mapa.&lt;br /&gt;
&lt;br /&gt;
Pareja de proyecto: Alan http://twowolvescorp.blogspot.com/&lt;br /&gt;
&lt;br /&gt;
Este es el pseudocodigo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 11&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 11&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5Cfrank%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;
	mso-ansi-language:ES-MX;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;#include &amp;lt; stdio.h &amp;gt;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;main()&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;#define si 1, no 0;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Se declaran algunas variables, i, j y k serán índices para evaluar repeticiones.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;double ndir, i, j, k;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Estas son matrices que contienen palabras.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;char direcciones[ ][ ], caminos[ ];&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Y acá se encuentran algunos números de precisión.*/ &lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;long float distancias[ ][ ], suma, menor, menoralt[ ];&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Este programa calcula la distancia mas corta de uno o varios trayectos \nque se puede recorrer en un mapa, desde una dirección inicial a una final.”);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Cuantas direcciones son?: ”)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;scanf(“%ld”, &amp;amp;ndir);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;/*Se define la primera matriz nxn.*/ &lt;/span&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;direcciones[ndir][ndir];&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Ahora se van llenando los espacios de la primera fila de la matriz.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;while (i&amp;lt;=ndir)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Direccion %d?: ”, i);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;scanf(“%s”, &amp;amp;direcciones[i][1]);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;i++;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Asignar la conexión o unión entre las direcciones:”)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Se sigue llenando la matriz pero ahora completamente, las conexiones de cada camino se escriben inmediatamente debajo de la fila en cada columna.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;for (i=1; i&amp;lt;=ndir; i++)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“La direccion %s, se conecta con,”, direcciones[i][1]);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;for (j=2; j&amp;lt;=ndir; j++)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Este while crea un lista de las uniones que puedes elegir para cada dirección.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;while (i&amp;lt;=ndir)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“\n%ld. %s”, i, direcciones[i][1]);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;i++;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;i-=i+1;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“la dirección(numero): ”);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;scanf(“%ld”, &amp;amp;opcion);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;if (opcion=1)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Seria ir a la misma dirección, carece de sentido.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Opción invalida, elegir otra...”);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*El switch va llenando la matriz según la el numero elegido, en su posición correspondiente.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;switch (opcion)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;case 2:&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;direcciones[i][j]=&lt;/span&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;direcciones[i][1]&lt;/span&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;break;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;case 3:&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;direcciones[i][j+1]=&lt;/span&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;direcciones[i][1]&lt;/span&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;break;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;continue case ndir:&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;direcciones[i][j+2]=direcciones[i][1];&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;break;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Se conecta además con otra dirección?: ”);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;scanf(“%s”, &amp;amp;eleccion);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;if (eleccion==1)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;j++&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Regreso a la linea 53 para seguir llenando la matriz en la siguiente columna.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;return line 53;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/* Esto asegura no repetir las preguntas de uniones de las direcciones.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;j++;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Asignar las distancias entre las direcciones:”);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Se define otra matriz nxn para las distancias (numero float).*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;distancias[ndir+1][ndir+1];&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;for ((i=1; i&amp;lt;=ndir; i++)&amp;amp;&amp;amp;(j=2; j&amp;lt;=ndir; j++))&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Dice que si existe algo definido en la posición [i][j] de la matriz “direcciones”, asignara el numero 1 en la matriz de “distancias” en su posición equivalente.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;if (exists(direccion[i][j])==1)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;distancias[i][j]=1;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;for (i=1; i&amp;lt;=ndir; i++)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;for (j=2; j&amp;lt;=ndir; j++)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Y luego dice que si existe un 1 en las posiciones de la matriz “distancias”, te pedirá ingresar la distancia.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;if (exists(direcciones[i][j])==1)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Cual es la distancia %s-%s?: ”, direcciones[i][1],direcciones[i][j])&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;scanf(“%lf”, distancias[i][j]);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/* Esto (j++) es para que no se repitan las preguntas de distancias iguales pero en diferente sentido. Es decir distancia=AB=BA*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;j++&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Cual es la dirección inicial?: ”)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;scanf(“%s”, &amp;amp;inicio);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Y cual es la dirección final o de llegada?: ”)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;scanf(“%s”, &amp;amp;fin);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Esta es la parte que es un poco confusa porque todavía no sabemos como hacer diagramas de árbol.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;generate diagram (caminos[])&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Aquí solo le decimos que nos genere k-caminos posibles a partir de la matriz de las direcciones y que vaya sumando las distancias.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;for (k=1; k&amp;lt;=distancias[i][j]; k++)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;for (j=2; j&amp;lt;=tam(direcciones[i][j]))&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Busca direcciones adyacentes o uniones.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;search adyacent (direcciones[])&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;suma= distancias[i][j]+distancias[i][j++]&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;caminos[k]=suma;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;suma=0;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;PT&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Tomamos el primer numero de los caminos generados y lo comparamos con todos los demás, se le asignara la variable “menor” al menor numero de cada comparación hecha. Se hace esto porque hay veces que resultan 500 caminos diferentes.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;k=1;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;menor= caminos[k];&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;for (k=2; k&amp;lt;=size(caminos[]); k++)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;if (menor&amp;gt;caminos[k])&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;menor=caminos[k];&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;else if (menor=caminos[k])&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Menoralt significa menor alternativo, ya que a veces puedes encontrar 2 o mas caminos con la misma distancia.*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;menoralt[i]=caminos[k];&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“El camino mas corto que puede tomar de %s a %s es: %-s con una distancia de: %lf”, inicio, fin, caminos[k], menor);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;/*Se comparan los resultados alternativos y se ofrecen en pantalla solo si son iguales al camino mas corto (menor).*/&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;j= size(menoralt[]);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;if (menoralt[j]=menor)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;for (i&amp;lt;=j; i=1; i- -)&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;while (menor=menoralt[i])&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;{&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;printf(“Otra alternativa es: %-s con la misma distancia”, caminos[i]);&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;getch ();&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Arial;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;Un ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 11&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 11&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5Cfrank%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5Cfrank%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_editdata.mso&quot; rel=&quot;Edit-Time-Data&quot;&gt;&lt;/link&gt;&lt;o:smarttagtype _moz-userdefined=&quot;&quot; name=&quot;City&quot; namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot;&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype _moz-userdefined=&quot;&quot; name=&quot;place&quot; namespaceuri=&quot;urn:schemas-microsoft-com:office:smarttags&quot;&gt;&lt;/o:smarttagtype&gt;&lt;style&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;
	mso-ansi-language:ES-MX;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:1389301827;
	mso-list-type:hybrid;
	mso-list-template-ids:1206537134 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
	{mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--&gt;
&lt;/style&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot;&gt;Este es un ejemplo del algoritmo con un mapa simple:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;1&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot;&gt;Tomemos un mapa cualquiera, en este caso será el estado de      Arizona, EU.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgslqp5aa_NmzgBqDq1G74DNwEj6bWtDyx0lDrmIBNYcSYgvJws84wgn_SyJCe_mL5EHIGRYWYPFyl9zCguXSLMxDqNtZbLXm-PGrdGSacJ8actZPRIra8_Lbnkv5Cqm9AYfXiF0IBJ7KY/s1600-h/cities-map-arizona-free+modified.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgslqp5aa_NmzgBqDq1G74DNwEj6bWtDyx0lDrmIBNYcSYgvJws84wgn_SyJCe_mL5EHIGRYWYPFyl9zCguXSLMxDqNtZbLXm-PGrdGSacJ8actZPRIra8_Lbnkv5Cqm9AYfXiF0IBJ7KY/s400/cities-map-arizona-free+modified.gif&quot; width=&quot;366&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES-MX&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES-MX&quot;&gt;Fuente: &lt;a href=&quot;http://i459.photobucket.com/albums/qq317/pauljorg31/arizona/cities-map-arizona-free.gif&quot;&gt;http://i459.photobucket.com/albums/qq317/pauljorg31/arizona/cities-map-arizona-free.gif&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;2&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot;&gt;Supongamos que deseas ir de Holbrook a Blythe, solo por los      caminos resaltados en azul y las ciudades subrayadas con rojo.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;3&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-MX&quot;&gt;El programa comienza pidiéndote la cantidad de ciudades o      direcciones que existen: 11&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Blythe, Needles, Kingman, Williams, &lt;st1:city _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;Flagstaff&lt;/st1:city&gt;, Sedona, &lt;st1:city _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;Prescott&lt;/st1:city&gt;, Wickenburg, &lt;st1:city _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;&lt;st1:place _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;Phoenix&lt;/st1:place&gt;&lt;/st1:city&gt;, Globe y Holbrook.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;4&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Entonces se define una matriz de      11x11.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;5&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Llena los espacios de la primera fila      como van ingresando los datos.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;6&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Te pregunta cuales son las conexiones      o uniones de la primera dirección (Blythe), en el mapa podemos observar      que son Needles, Wickenburg y Phoenix. Y el programa las inserta justo      debajo de la primera ciudad:&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;center&quot;&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: medium none;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 55.05pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 70.15pt;&quot; valign=&quot;top&quot; width=&quot;94&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;i=1&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;i=2&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;i=3&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;i=4&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 45.55pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;i=5&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 55.05pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;j=1&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 70.15pt;&quot; valign=&quot;top&quot; width=&quot;94&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;Blythe&lt;span lang=&quot;ES&quot;&gt;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;Needles&lt;span lang=&quot;ES&quot;&gt;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;Kingman&lt;span lang=&quot;ES&quot;&gt;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;Williams&lt;span lang=&quot;ES&quot;&gt;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 45.55pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 55.05pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;j=2&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 70.15pt;&quot; valign=&quot;top&quot; width=&quot;94&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Needles&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Blythe&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 45.55pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 55.05pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;j=3&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 70.15pt;&quot; valign=&quot;top&quot; width=&quot;94&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Wickenburg&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 45.55pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 55.05pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;j=4&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 70.15pt;&quot; valign=&quot;top&quot; width=&quot;94&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Phoenix&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 45.55pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;7&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Y hace lo mismo con las demás      ciudades sin repetir las preguntas.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;8&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Se define una matriz para las      distancias pero es 1 número más grande que la cantidad total de      direcciones. Es decir de 12x12.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;9&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Si existe algún valor sea numérico o alfabético      en la matriz de direcciones, se le asigna un 1 a su homologo en la matriz      de distancias. Es decir distancias[i+1][j+1].&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;center&quot;&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: medium none;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 45.9pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Blythe&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Needles&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Kingman&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Williams&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Bythe&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 45.9pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Needles&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 45.9pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;1&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Kingman&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 45.9pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Phoenix&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 45.9pt;&quot; valign=&quot;top&quot; width=&quot;61&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;1&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 49.45pt;&quot; valign=&quot;top&quot; width=&quot;66&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 55.5pt;&quot; valign=&quot;top&quot; width=&quot;74&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;…&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 54.8pt;&quot; valign=&quot;top&quot; width=&quot;73&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;10&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Después, si existe un 1 en la matriz      anterior, se pedirá la distancia de [i][1] a [i][j].&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;11&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Se piden la dirección inicial y la dirección      final: Holbrook y Blythe.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;12&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Comienza a hacer el diagrama de árbol      a partir de ambas matrices y asignando los resultados en un arreglo      llamado caminos[k].&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/blockquote&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5YvDjb5M_QdlGNcalBaRSGlpT_QD9s56mNeJZkPCag-xHeaHLZU-MuzgxJ35HIEvjGMpOlgJkZ7LOZjUwOAJREeu_l1n9eh-rAwy4BSLk398GVxoAseXvCHLbXNg2W7mXNrXHcGCyXJY/s1600-h/Holbrook+a+Blythe.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;381&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5YvDjb5M_QdlGNcalBaRSGlpT_QD9s56mNeJZkPCag-xHeaHLZU-MuzgxJ35HIEvjGMpOlgJkZ7LOZjUwOAJREeu_l1n9eh-rAwy4BSLk398GVxoAseXvCHLbXNg2W7mXNrXHcGCyXJY/s400/Holbrook+a+Blythe.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Aquí se puede apreciar la complejidad del mapa con todos sus caminos posibles.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;13&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Mas tarde de haber generado todos los      caminos[k], compara las distancias obtenidas, es decir cada una de las      ramas del diagrama de árbol que terminan en Blythe, nuestro objetivo.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;14&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Casi por ultimo se determina cual fue      el menor de todas las distancias y se ofrece como resultado final. Para      fines prácticos nosotros supondremos que el camino mas corto es el que      tiene menos direcciones de por medio. Se puede ver en el diagrama que esos      caminos son:&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;Holbrook &amp;gt; &lt;st1:city _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;&lt;st1:place _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;Globe&lt;/st1:place&gt;&lt;/st1:city&gt; &amp;gt; Phoenix &amp;gt; Blythe.&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;15&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES&quot;&gt;Ya por ultimo se ofrecen algunas alternativas:&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;Otra opción puede ser:&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;Holbrook &amp;gt; &lt;st1:city _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;Flagstaff&lt;/st1:city&gt; &amp;gt; Williams &amp;gt; &lt;st1:place _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;&lt;st1:city _moz-userdefined=&quot;&quot; w:st=&quot;on&quot;&gt;Prescott&lt;/st1:city&gt;&lt;/st1:place&gt; &amp;gt; Wickenburg &amp;gt; Bythe.&lt;/div&gt;&lt;/blockquote&gt;La complejidad del programa es aproximadamente NP ya que el diagrama de arbol aumenta exponencialmente conforme los caminos o conecciones entre ciudades aumentan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;o:p _moz-userdefined=&quot;&quot;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/397985170961482636/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/02/proyecto-1-2-buscar-una-buena-ruta.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/397985170961482636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/397985170961482636'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/02/proyecto-1-2-buscar-una-buena-ruta.html' title='Proyecto 1: #2 Buscar una buena ruta'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgslqp5aa_NmzgBqDq1G74DNwEj6bWtDyx0lDrmIBNYcSYgvJws84wgn_SyJCe_mL5EHIGRYWYPFyl9zCguXSLMxDqNtZbLXm-PGrdGSacJ8actZPRIra8_Lbnkv5Cqm9AYfXiF0IBJ7KY/s72-c/cities-map-arizona-free+modified.gif" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-4499812377174718077</id><published>2010-02-05T16:55:00.016-06:00</published><updated>2010-02-11T12:07:14.989-06:00</updated><title type='text'>Ejercicio 2 - De entero a binario</title><content type='html'>&lt;div style=&quot;color: black;&quot;&gt;Aquí esta mi algoritmo en C para convertir un numero entero a un numero binario:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;#include &amp;lt; stdio.h &amp;gt;&lt;br /&gt;
#include &amp;lt; math.h &amp;gt;&lt;br /&gt;
#include &amp;lt; stdlib.h &amp;gt;&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int num1, i= 0, opcion;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; double base= pow(2,i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;Escribir un numero entero para convertir a binario: &quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; scanf(&quot;%d&quot;, &amp;amp;num1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while (base&amp;lt;=num1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot; %lf&quot;, base);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base= pow(2,i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; i--;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\n i=%d\n\n&quot;, i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; base= pow(2,i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while (num1&amp;gt;0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (base&lt;num1) _moz-userdefined=&quot;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num1-=base;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i--;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base= pow(2,i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;1&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (base&amp;gt;num1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i--;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base= pow(2,i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;0&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (base=num1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; num1-=base;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;1&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while (i&amp;gt;0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;0&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i--;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\n\n.&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; system(&quot;pause&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
} &lt;br /&gt;
&amp;nbsp;&lt;/num1)&gt;&lt;/blockquote&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/4499812377174718077/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/02/aqui-dejo-un-codigo-en-lenguaje-c-para.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/4499812377174718077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/4499812377174718077'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/02/aqui-dejo-un-codigo-en-lenguaje-c-para.html' title='Ejercicio 2 - De entero a binario'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8025442413689651638.post-7746626421721444841</id><published>2010-01-28T22:15:00.014-06:00</published><updated>2010-01-29T15:09:09.431-06:00</updated><title type='text'>Ejercicio 1 - Creacion de serie Fibonacci</title><content type='html'>&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Primero realizamos un pseudocodigo parecido al siguiente para guiarnos durante la clase:&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;blockquote style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;conteo= 0&lt;br /&gt;
a= 0&lt;br /&gt;
p= 1&lt;br /&gt;
print 0,1&lt;br /&gt;
while (conteo&amp;lt;100)&lt;br /&gt;
&amp;nbsp; do&lt;br /&gt;
&amp;nbsp; n= a+p&lt;br /&gt;
&amp;nbsp; print n&lt;br /&gt;
&amp;nbsp; a= p, p= n&lt;br /&gt;
&amp;nbsp; conteo++&lt;/blockquote&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #cc0000; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Un algoritmo en C quedaría como:&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;blockquote&gt;#include &lt;stdio.h&gt;&amp;lt; stdio.h &amp;gt;&lt;br /&gt;
#include &amp;lt; stdlib.h &amp;gt;&lt;stdlib.h&gt;&lt;br /&gt;
&lt;br /&gt;
main ()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Definiendo variables, C es un conteo numerico*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int A=0,B=1,C=3,N;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot; %d\n %d\n&quot;,A,B);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (C&amp;lt;=47)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {N=A+B;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot; %ld\n&quot;,N);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Se corren los numeros en las variables*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A=B,B=N;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Aumenta el conteo*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
system (&quot;pause&quot;);&lt;br /&gt;
}&lt;/stdlib.h&gt;&lt;/stdio.h&gt;&lt;/blockquote&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://algoritmoshade.blogspot.com/feeds/7746626421721444841/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://algoritmoshade.blogspot.com/2010/01/ejercicio-1-creacion-de-serie-fibonacci.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/7746626421721444841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8025442413689651638/posts/default/7746626421721444841'/><link rel='alternate' type='text/html' href='http://algoritmoshade.blogspot.com/2010/01/ejercicio-1-creacion-de-serie-fibonacci.html' title='Ejercicio 1 - Creacion de serie Fibonacci'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>