(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 7.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[    173736,       4395]
NotebookOptionsPosition[    170538,       4289]
NotebookOutlinePosition[    170990,       4306]
CellTagsIndexPosition[    170947,       4303]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["MODELO DE COSTOS DE OSIPTEL", "Title",
 CellChangeTimes->{{3.6267124397636743`*^9, 3.6267124560740004`*^9}, {
  3.6267137038391423`*^9, 3.626713711899868*^9}}],

Cell["OPERADOR FICTICIO - 2012", "Subtitle",
 CellChangeTimes->{{3.6267137144600983`*^9, 3.6267137355619974`*^9}, {
  3.6326577402494173`*^9, 3.6326577413045225`*^9}}],

Cell[CellGroupData[{

Cell["Algoritmo de Enrutamiento", "Chapter",
 CellChangeTimes->{{3.632222461065221*^9, 3.6322224693383827`*^9}}],

Cell[CellGroupData[{

Cell["Configuraciones Iniciales", "Section",
 CellChangeTimes->{{3.6322225059473114`*^9, 3.632222514864275*^9}}],

Cell[CellGroupData[{

Cell["Configuracion de mensajes", "Subsection",
 CellChangeTimes->{{3.6322225679897747`*^9, 3.632222578250595*^9}}],

Cell["\<\
Off[General::spell1]; 
Off[General::spell]; \
\>", "Text",
 CellChangeTimes->{{3.632145375446862*^9, 3.632145387688086*^9}, 
   3.632236567245824*^9, 3.6322409898841467`*^9}]
}, Closed]],

Cell[CellGroupData[{

Cell["Directorio de trabajo", "Subsection",
 CellChangeTimes->{{3.6322225864224987`*^9, 3.63222259368433*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", 
    RowBox[{
    "El", " ", "modelo", " ", "utiliza", " ", "diversos", " ", "archivos", 
     " ", "de", " ", "texto", " ", "como", " ", 
     RowBox[{"entrada", ".", "En"}], " ", "esta", " ", "instrucci\[OAcute]n", 
     " ", "se", " ", "establece", " ", "el", " ", "directorio", " ", "donde", 
     " ", "se", " ", "encuentran", " ", "ubicados", " ", "dichos", " ", 
     "archivos"}], "*)"}],
   FontColor->GrayLevel[0]], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{
   StyleBox[
    RowBox[{
     RowBox[{"TempDir", "=", 
      RowBox[{"NotebookDirectory", "[", "]"}]}], ";"}],
    FontColor->GrayLevel[0]], "\[IndentingNewLine]", 
   StyleBox[
    RowBox[{
     RowBox[{"SetDirectory", "[", "TempDir", "]"}], ";"}],
    FontColor->GrayLevel[0]], 
   StyleBox["\[IndentingNewLine]",
    FontColor->GrayLevel[0]]}]}]], "Input",
 CellChangeTimes->{{3.6322393803132*^9, 3.6322393936722*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Lectura de parametros", "Subsection",
 CellChangeTimes->{{3.632222534460842*^9, 3.632222546714322*^9}, {
  3.6322226015924625`*^9, 3.6322226022237625`*^9}, {3.632222684173069*^9, 
  3.632222685949461*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"OpenRead", "[", "\"\<input_Param.txt\>\"", "]"}], ";"}], 
  " "}], "\n", 
 RowBox[{
  RowBox[{"d", "=", 
   RowBox[{"N", "[", 
    RowBox[{"ReadList", "[", 
     RowBox[{"\"\<input_Param.txt\>\"", ",", "Number"}], "]"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Close", "[", "\"\<input_Param.txt\>\"", "]"}], ";"}], 
  " "}]}], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", " ", 
    RowBox[{
    "N\[UAcute]mero", " ", "de", " ", "MhZ", " ", "de", " ", "ancho", " ", 
     "de", " ", "banda", " ", "al", " ", "codificar", " ", "1", " ", "Mbps", 
     " ", "de", " ", "datos", " ", "para", " ", "Tx", " ", "Satelital"}], " ",
     "*)"}],
   FontColor->RGBColor[1, 0, 0]], "\n", 
  RowBox[{
   RowBox[{
    RowBox[{"factorNoLinealUrban", "=", 
     FractionBox["1", 
      RowBox[{"d", "\[LeftDoubleBracket]", "57", "\[RightDoubleBracket]"}]]}],
     ";"}], "\n", 
   StyleBox[
    RowBox[{"(*", " ", 
     RowBox[{
     "Factor", " ", "de", " ", "no", " ", "linealidad", " ", "de", " ", 
      "fibra", " ", "\[OAcute]ptica", " ", "canalizada"}], " ", "*)"}],
    FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"factorNoLinealNoUrban", "=", 
     FractionBox["1", 
      RowBox[{"d", "\[LeftDoubleBracket]", "58", "\[RightDoubleBracket]"}]]}],
     ";"}], "\n", 
   StyleBox[
    RowBox[{"(*", " ", 
     RowBox[{
     "Factor", " ", "de", " ", "no", " ", "linealidad", " ", "de", " ", 
      "fibra", " ", "\[OAcute]ptica", " ", "enterrada"}], " ", "*)"}],
    FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"factorNoLinealRadio", "=", 
     FractionBox["1", 
      RowBox[{"d", "\[LeftDoubleBracket]", "59", "\[RightDoubleBracket]"}]]}],
     ";"}], "\n", 
   StyleBox[
    RowBox[{"(*", " ", 
     RowBox[{
     "Factor", " ", "de", " ", "no", " ", "linealidad", " ", "de", " ", "los",
       " ", "enlaces", " ", "de", " ", "radio"}], " ", "*)"}],
    FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"factnolinLD", "=", 
     RowBox[{"d", "\[LeftDoubleBracket]", "69", "\[RightDoubleBracket]"}]}], 
    ";"}], "\n", 
   StyleBox[
    RowBox[{"(*", " ", 
     RowBox[{
     "Grado", " ", "de", " ", "utilizaci\[OAcute]n", " ", "de", " ", "la", 
      " ", "Fibra", " ", "\[CapitalOAcute]ptica", " ", "Enterrada"}], " ", 
     "*)"}],
    FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ConsideraPRIM", "=", 
     RowBox[{"d", "\[LeftDoubleBracket]", "9", "\[RightDoubleBracket]"}]}], 
    ";"}]}]}]], "Input",
 CellChangeTimes->{{3.632156995766535*^9, 3.6321569960905657`*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Lectura de departamentos", "Subsection",
 CellChangeTimes->{{3.632222689586002*^9, 3.632222697412878*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", 
    RowBox[{
    "Listado", " ", "de", " ", "los", " ", "departamentos", " ", "y", " ", 
     "les", " ", "asigna", " ", "un", " ", "n\[UAcute]mero", " ", 
     "correlativo"}], "*)"}],
   FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"OpenRead", "[", "\"\<input_Departamentos.txt\>\"", "]"}], ";"}], 
   " ", "\n", 
   RowBox[{
    RowBox[{"deptTXTd", " ", "=", " ", 
     RowBox[{"ReadList", "[", 
      RowBox[{"\"\<input_Departamentos.txt\>\"", ",", " ", "String", ",", " ", 
       RowBox[{"RecordLists", " ", "\[Rule]", " ", "False"}]}], "]"}]}], 
    ";"}], " ", "\n", 
   RowBox[{
    RowBox[{"For", "[", 
     RowBox[{
      RowBox[{"id", " ", "=", " ", "1"}], ",", " ", 
      RowBox[{"id", " ", "\[LessEqual]", " ", 
       RowBox[{"Length", "[", "deptTXTd", "]"}]}], ",", " ", 
      RowBox[{"id", "++"}], ",", " ", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"ExpressionCell", "[", 
        RowBox[{
         RowBox[{"ToExpression", "[", 
          RowBox[{"StringJoin", "[", 
           RowBox[{
            RowBox[{
            "deptTXTd", "\[LeftDoubleBracket]", "id", 
             "\[RightDoubleBracket]"}], ",", " ", "\"\<=\>\"", ",", " ", 
            RowBox[{"ToString", "[", "id", "]"}], ",", " ", "\"\<;\>\""}], 
           "]"}], "]"}], ",", " ", "\"\<Input\>\""}], "]"}], ";"}]}], " ", 
     "\[IndentingNewLine]", "]"}], ";"}], " ", "\n", 
   RowBox[{
    RowBox[{"Close", "[", "\"\<input_Departamentos.txt\>\"", "]"}], ";"}], 
   " ", "\n", 
   RowBox[{
    RowBox[{"nd", "=", 
     RowBox[{"Length", "[", "deptTXTd", "]"}]}], ";"}], "\[IndentingNewLine]", 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{
     "N\[UAcute]mero", " ", "de", " ", "datos", " ", "a", " ", "nivel", " ", 
      "de", " ", "c\[AAcute]lculos", " ", "y", " ", "resultados", " ", 
      "departamentales"}], "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]"}]}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Establecimiento de constantes", "Subsection",
 CellChangeTimes->{{3.632222706989894*^9, 3.6322227223273706`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", 
    RowBox[{
    "Esquema", " ", "de", " ", "identificaci\[OAcute]n", " ", 
     "l\[OAcute]gico", " ", "entre", " ", 
     StyleBox["Centrales",
      FontWeight->"Bold"], 
     StyleBox[" ",
      FontWeight->"Bold"], 
     StyleBox["Cabeceras",
      FontWeight->"Bold"], " ", "y", " ", 
     StyleBox["URAS",
      FontWeight->"Bold"], " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"Unidades", " ", "Remotas"}], ",", " ", 
       RowBox[{
       "tanto", " ", "Anal\[OAcute]gicas", " ", "como", " ", "Digitales"}]}], 
      ")"}]}], "*)"}],
   FontColor->GrayLevel[0.5]], 
  StyleBox["\[IndentingNewLine]",
   FontColor->GrayLevel[0.5]], 
  RowBox[{
   RowBox[{
    RowBox[{"CABECERA", "=", "1"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"URA", "=", "0"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"MGW", "=", "2"}], ";"}], "\[IndentingNewLine]", 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{
     "Listado", " ", "de", " ", "Tecnolog\[IAcute]as", " ", "identificadas", 
      " ", "por", " ", "un", " ", "n\[UAcute]mero"}], "*)"}],
    FontColor->GrayLevel[0.5]], "\n", 
   RowBox[{
    RowBox[{"Satelite", "=", "1"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"Otro", "=", "1"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"EnRev", "=", "2"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"SDH", "=", "2"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"Enterrado", "=", "2"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"Radio", "=", "3"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"NA", "=", "4"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"Urbana", "=", "5"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"Aereo", "=", "6"}], ";"}], "\n", 
   RowBox[{
    RowBox[{"Fiberoptic", "=", "2"}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.63214577503032*^9, 3.632145778821144*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Lectura de centrales", "Subsection",
 CellChangeTimes->{{3.63222273068929*^9, 3.632222739526247*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"Off", "[", 
    RowBox[{"ToExpression", "::", "\"\<sntxi\>\""}], "]"}], ";"}], " ", 
  "\[IndentingNewLine]", "\[IndentingNewLine]", 
  StyleBox[
   RowBox[{"(*", 
    RowBox[{
    "Abre", " ", "Archivo", " ", "de", " ", "Texto", " ", 
     "\"\<input_centralesfinal.txt\>\""}], "*)"}],
   FontColor->GrayLevel[0.5]]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"OpenRead", "[", "\"\<input_centralesfinal.txt\>\"", "]"}], ";"}], 
  " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y", "=", 
    RowBox[{"Import", "[", 
     RowBox[{
     "\"\<input_centralesfinal.txt\>\"", ",", " ", "\"\<TSV\>\"", ",", " ", 
      RowBox[{"RecordLists", "\[Rule]", "True"}]}], "]"}]}], ";"}], 
  " "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Close", "[", "\"\<input_centralesfinal.txt\>\"", "]"}], ";"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"nx", "=", 
    RowBox[{"Length", "[", "y", "]"}]}], ";"}], "\[IndentingNewLine]", 
  StyleBox[
   RowBox[{"(*", " ", 
    RowBox[{
    "Define", " ", "el", " ", "n\[UAcute]mero", " ", "de", " ", "datos", " ", 
     "que", " ", "contiene", " ", "la", " ", "matriz", " ", "z"}], " ", "*)"}],
   FontColor->RGBColor[1, 0, 0]], "\n"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"idx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "1"}], "\[RightDoubleBracket]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Pos", "[", "i_", "]"}], ":=", 
   RowBox[{"Plus", "@@", 
    RowBox[{"Flatten", "[", 
     RowBox[{"Position", "[", 
      RowBox[{"idx", ",", "i"}], "]"}], "]"}]}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"deptx", "=", 
   RowBox[{"ToExpression", "[", 
    RowBox[{"StringReplace", "[", 
     RowBox[{
      RowBox[{"y", "\[LeftDoubleBracket]", 
       RowBox[{"All", ",", "4"}], "\[RightDoubleBracket]"}], ",", 
      RowBox[{"\"\< \>\"", "\[Rule]", "\"\<\>\""}]}], "]"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"tandemd", "=", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{"Min", "[", 
       RowBox[{"Pick", "[", 
        RowBox[{
         RowBox[{"Range", "[", "nx", "]"}], ",", "deptx", ",", "id"}], "]"}], 
       "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"id", ",", "nd"}], "}"}]}], "]"}]}], ";"}], 
  "\n"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"longdegx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "6"}], "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"longminx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "8"}], "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"longsecx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "10"}], "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"latdegx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "7"}], "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"latminx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "9"}], "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"latsecx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "11"}], "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"linesOrigx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "12"}], "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"lprix", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "13"}], "\[RightDoubleBracket]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"lbrix", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "14"}], "\[RightDoubleBracket]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"systemx", "=", 
   RowBox[{"ToExpression", "[", 
    RowBox[{"y", "\[LeftDoubleBracket]", 
     RowBox[{"All", ",", "15"}], "\[RightDoubleBracket]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"transtechx", "=", 
   RowBox[{"ToExpression", "[", 
    RowBox[{"y", "\[LeftDoubleBracket]", 
     RowBox[{"All", ",", "2"}], "\[RightDoubleBracket]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"esAnillopx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "17"}], "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"Do", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{
         "esAnillopx", "\[LeftDoubleBracket]", "ix", 
          "\[RightDoubleBracket]"}], "\[Equal]", "1"}], "\[And]", 
        RowBox[{
         RowBox[{
         "transtechx", "\[LeftDoubleBracket]", "ix", 
          "\[RightDoubleBracket]"}], "\[NotEqual]", "Urbana"}]}], ",", 
       RowBox[{
        RowBox[{
        "transtechx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}],
         "=", "Urbana"}]}], "]"}], ";"}], ",", 
    RowBox[{"{", 
     RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ";"}], "\n", 
 RowBox[{
  RowBox[{"esAnillodx", "=", 
   RowBox[{"y", "\[LeftDoubleBracket]", 
    RowBox[{"All", ",", "18"}], "\[RightDoubleBracket]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"CentralRef", "=", 
   RowBox[{"Pos", "[", "249", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"PosTandemLima2", "=", 
   RowBox[{"Pos", "[", "461", "]"}]}], ";"}]}], "Input",
 CellChangeTimes->{
  3.632145354978815*^9, {3.632154591271107*^9, 3.63215459164207*^9}, {
   3.6321554379187145`*^9, 3.6321554443323145`*^9}, 3.6322332082433147`*^9, 
   3.6326577721206045`*^9}]
}, Closed]],

Cell[CellGroupData[{

Cell["Funciones Auxiliares", "Subsection",
 CellChangeTimes->{
  3.632145354978815*^9, {3.632154591271107*^9, 3.63215459164207*^9}, {
   3.6321554379187145`*^9, 3.6321554443323145`*^9}, 3.6322332082433147`*^9, {
   3.6322394843452*^9, 3.6322394960382*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Coord", "[", "x1_", "]"}], ":=", 
   RowBox[{"N", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"-", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
         "longdegx", "\[LeftDoubleBracket]", "x1", "\[RightDoubleBracket]"}], 
         "+", 
         FractionBox[
          RowBox[{
           RowBox[{
           "longminx", "\[LeftDoubleBracket]", "x1", 
            "\[RightDoubleBracket]"}], "+", 
           FractionBox[
            RowBox[{
            "longsecx", "\[LeftDoubleBracket]", "x1", 
             "\[RightDoubleBracket]"}], "60"]}], "60"]}], ")"}]}], ",", 
      RowBox[{"-", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
         "latdegx", "\[LeftDoubleBracket]", "x1", "\[RightDoubleBracket]"}], 
         "+", 
         FractionBox[
          RowBox[{
           RowBox[{
           "latminx", "\[LeftDoubleBracket]", "x1", "\[RightDoubleBracket]"}],
            "+", 
           FractionBox[
            RowBox[{
            "latsecx", "\[LeftDoubleBracket]", "x1", 
             "\[RightDoubleBracket]"}], "60"]}], "60"]}], ")"}]}]}], "}"}], 
    "]"}]}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"distance", "[", 
    RowBox[{"ix1_", ",", "ix2_"}], "]"}], ":=", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"vect1", ",", "vect2", ",", "dist"}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"vect1", "=", 
       RowBox[{"-", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{
           RowBox[{
           "latdegx", "\[LeftDoubleBracket]", "ix1", 
            "\[RightDoubleBracket]"}], "+", 
           FractionBox[
            RowBox[{
             RowBox[{
             "latminx", "\[LeftDoubleBracket]", "ix1", 
              "\[RightDoubleBracket]"}], "+", 
             FractionBox[
              RowBox[{
              "latsecx", "\[LeftDoubleBracket]", "ix1", 
               "\[RightDoubleBracket]"}], "60"]}], "60"]}], ",", 
          RowBox[{
           RowBox[{
           "longdegx", "\[LeftDoubleBracket]", "ix1", 
            "\[RightDoubleBracket]"}], "+", 
           FractionBox[
            RowBox[{
             RowBox[{
             "longminx", "\[LeftDoubleBracket]", "ix1", 
              "\[RightDoubleBracket]"}], "+", 
             FractionBox[
              RowBox[{
              "longsecx", "\[LeftDoubleBracket]", "ix1", 
               "\[RightDoubleBracket]"}], "60"]}], "60"]}]}], "}"}]}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"vect2", "=", 
       RowBox[{"-", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{
           RowBox[{
           "latdegx", "\[LeftDoubleBracket]", "ix2", 
            "\[RightDoubleBracket]"}], "+", 
           FractionBox[
            RowBox[{
             RowBox[{
             "latminx", "\[LeftDoubleBracket]", "ix2", 
              "\[RightDoubleBracket]"}], "+", 
             FractionBox[
              RowBox[{
              "latsecx", "\[LeftDoubleBracket]", "ix2", 
               "\[RightDoubleBracket]"}], "60"]}], "60"]}], ",", 
          RowBox[{
           RowBox[{
           "longdegx", "\[LeftDoubleBracket]", "ix2", 
            "\[RightDoubleBracket]"}], "+", 
           FractionBox[
            RowBox[{
             RowBox[{
             "longminx", "\[LeftDoubleBracket]", "ix2", 
              "\[RightDoubleBracket]"}], "+", 
             FractionBox[
              RowBox[{
              "longsecx", "\[LeftDoubleBracket]", "ix2", 
               "\[RightDoubleBracket]"}], "60"]}], "60"]}]}], "}"}]}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"dist", "=", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"vect1", "\[Equal]", "vect2"}], ",", "0", ",", 
         RowBox[{
          RowBox[{"GeoDistance", "[", 
           RowBox[{"vect1", ",", "vect2", ",", "  ", 
            RowBox[{"UnitSystem", "\[Rule]", "\"\<km\>\""}]}], "]"}], " ", 
          "[", 
          RowBox[{"[", "1", "]"}], "]"}]}], "    ", "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"N", "[", "dist", "]"}]}]}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.632145803259902*^9, 3.6321458035251036`*^9}, {
   3.6322332139735146`*^9, 3.6322332177331147`*^9}, 3.6322395109342003`*^9, {
   3.6322405290390673`*^9, 3.6322405352836914`*^9}, {3.632240933533512*^9, 
   3.6322409376729264`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"distancep", "[", 
    RowBox[{"ix_", ",", "Lat_", ",", "Lon_"}], "]"}], ":=", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"vect1", ",", "vect2", ",", "dist"}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"vect1", "=", 
       RowBox[{"-", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{
           RowBox[{
           "latdegx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}],
            "+", 
           FractionBox[
            RowBox[{
             RowBox[{
             "latminx", "\[LeftDoubleBracket]", "ix", 
              "\[RightDoubleBracket]"}], "+", 
             FractionBox[
              RowBox[{
              "latsecx", "\[LeftDoubleBracket]", "ix", 
               "\[RightDoubleBracket]"}], "60"]}], "60"]}], ",", 
          RowBox[{
           RowBox[{
           "longdegx", "\[LeftDoubleBracket]", "ix", 
            "\[RightDoubleBracket]"}], "+", 
           FractionBox[
            RowBox[{
             RowBox[{
             "longminx", "\[LeftDoubleBracket]", "ix", 
              "\[RightDoubleBracket]"}], "+", 
             FractionBox[
              RowBox[{
              "longsecx", "\[LeftDoubleBracket]", "ix", 
               "\[RightDoubleBracket]"}], "60"]}], "60"]}]}], "}"}]}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"vect2", "=", 
       RowBox[{"{", 
        RowBox[{"Lat", ",", "Lon"}], "}"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"dist", "=", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"vect1", "\[Equal]", "vect2"}], ",", "0", ",", 
         RowBox[{
          RowBox[{"GeoDistance", "[", 
           RowBox[{"vect1", ",", "vect2", " ", ",", " ", 
            RowBox[{"UnitSystem", "\[Rule]", "\"\<km\>\""}]}], "]"}], " ", 
          "[", 
          RowBox[{"[", "1", "]"}], "]"}]}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"N", "[", "dist", "]"}]}]}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.632145803259902*^9, 3.6321458035251036`*^9}, {
   3.6322332139735146`*^9, 3.6322332177331147`*^9}, 3.6322395109342003`*^9, {
   3.632240542589422*^9, 3.6322405524294057`*^9}, {3.6322409438895483`*^9, 
   3.6322409465838175`*^9}}]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Procesamiento", "Section",
 CellChangeTimes->{{3.6322227625505886`*^9, 3.6322227674497304`*^9}}],

Cell[CellGroupData[{

Cell["Proceso", "Subsection",
 CellChangeTimes->{{3.632655989168327*^9, 3.6326559953149414`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", " ", 
    RowBox[{
    "Para", " ", "aquellas", " ", "centrales", " ", "que", " ", "son", " ", 
     "Tandem", " ", "las", " ", "identifica", " ", "con", " ", "\"\<1\>\"", 
     " ", "y", " ", "las", " ", "que", " ", "no", " ", "son", " ", "con", 
     " ", "\"\<0\>\""}], " ", "*)"}],
   FontColor->GrayLevel[0.5]], "\n", 
  RowBox[{
   StyleBox[
    RowBox[{
     RowBox[{"host1x", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{
           "systemx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}],
            "\[Equal]", "2"}], ",", "0", ",", 
          RowBox[{
          "systemx", "\[LeftDoubleBracket]", "ix", 
           "\[RightDoubleBracket]"}]}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}],
    FontColor->GrayLevel[0]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"remote1x", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
          RowBox[{
          "systemx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
          "\[Equal]", "0"}], ",", "1", ",", "0"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"hostx", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
        "host1x", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
        "\[Equal]", "1"}], ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}], "\n", 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{
      RowBox[{
      "Identificaci\[OAcute]n", " ", "de", " ", "Nodos", " ", "que", " ", 
       "utilizan", " ", "tecnolog\[IAcute]a", " ", "satelital", " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"variables", " ", "satx"}], ",", "sat1x"}], ")"}]}], ",", 
      RowBox[{"fibra", " ", "optica", " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"variables", " ", "fiberx"}], ",", "fibert1x"}], ")"}]}]}], 
     "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"satx", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
        "transtechx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}],
         "\[Equal]", "Satelite"}], ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}], "\n", 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{
      RowBox[{
      "Identifica", " ", "los", " ", "nodos", " ", "que", " ", "usan", " ", 
       "tecnolog\[IAcute]a", " ", "de", " ", "Tx", " ", "satelital", " ", 
       "con", " ", "\"\<True\>\"", " ", "y", " ", "los", " ", "dem\[AAcute]s",
        " ", "con", " ", "\"\<False\>\""}], ",", 
      RowBox[{
      "ojo", " ", "que", " ", "en", " ", "Lima", " ", "no", " ", "pueden", 
       " ", "haber", " ", "nodos", " ", "que", " ", "usen", " ", 
       "tecnolog\[IAcute]a", " ", "satelital"}]}], "*)"}],
    FontColor->GrayLevel[0.5]], "\n", 
   RowBox[{
    RowBox[{"sat1x", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
         "satx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], ",",
          "1", ",", "0"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.632153390371439*^9, 3.632153391469548*^9}, {
   3.632155469752714*^9, 3.6321554699397144`*^9}, {3.6321564966141453`*^9, 
   3.6321565216245966`*^9}, {3.632157606007285*^9, 3.63215760685637*^9}, {
   3.632233068298915*^9, 3.632233079221915*^9}, 3.632233223494915*^9, 
   3.6322396288492002`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", 
    RowBox[{
    "Identifica", " ", "los", " ", "nodos", " ", "que", " ", "usan", " ", 
     "fibra", " ", "como", " ", "tecnolog\[IAcute]a", " ", "de", " ", "Tx", 
     " ", "con", " ", "\"\<1\>\"", " ", "y", " ", "los", " ", "dem\[AAcute]s",
      " ", "con", " ", "\"\<0\>\""}], "*)"}],
   FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
  RowBox[{
   StyleBox[
    RowBox[{
     RowBox[{"tandemx", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"tandemd", "\[LeftDoubleBracket]", 
         RowBox[{
         "deptx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
         "\[RightDoubleBracket]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}],
    FontColor->GrayLevel[0]], "\n", 
   StyleBox[
    RowBox[{"(*", " ", 
     RowBox[{
     "Para", " ", "cada", " ", "central", " ", "se", " ", "especifica", " ", 
      "cu\[AAcute]l", " ", "es", " ", "la", " ", "Tandem", " ", "de", " ", 
      "su", " ", "departamento"}], " ", "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
   StyleBox[
    RowBox[{
     RowBox[{"tandem1x", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{
           "tandemx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}],
            "\[Equal]", "ix"}], ",", "1", ",", "0"}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}],
    FontColor->GrayLevel[0]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"DropLastCharacter", "[", "String1_", "]"}], ":=", 
     RowBox[{"StringJoin", "[", 
      RowBox[{"Delete", "[", 
       RowBox[{
        RowBox[{"Characters", "[", "String1", "]"}], ",", 
        RowBox[{"-", "1"}]}], "]"}], "]"}]}], ";"}], 
   StyleBox["\[IndentingNewLine]",
    FontColor->GrayLevel[0]], 
   RowBox[{
    RowBox[{"provTXTp", "=", 
     RowBox[{"Sort", "[", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"StringJoin", "[", 
         RowBox[{
          RowBox[{"y", "\[LeftDoubleBracket]", 
           RowBox[{"ix", ",", "16"}], "\[RightDoubleBracket]"}], ",", 
          "\"\<P\>\""}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ix", ",", 
          RowBox[{"Pick", "[", 
           RowBox[{
            RowBox[{"Range", "[", "nx", "]"}], ",", "host1x", ",", "1"}], 
           "]"}]}], "}"}]}], "]"}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"np", "=", 
     RowBox[{"Length", "[", "provTXTp", "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"hostp", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Plus", "@@", 
        RowBox[{"Flatten", "[", 
         RowBox[{"Position", "[", 
          RowBox[{
           RowBox[{"y", "\[LeftDoubleBracket]", 
            RowBox[{"All", ",", "16"}], "\[RightDoubleBracket]"}], ",", 
           RowBox[{"DropLastCharacter", "[", 
            RowBox[{
            "provTXTp", "\[LeftDoubleBracket]", "ip", 
             "\[RightDoubleBracket]"}], "]"}]}], "]"}], "]"}]}], ",", 
       RowBox[{"{", 
        RowBox[{"ip", ",", "np"}], "}"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"provTXTp", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"y", "\[LeftDoubleBracket]", 
        RowBox[{
         RowBox[{
         "hostp", "\[LeftDoubleBracket]", "ip", "\[RightDoubleBracket]"}], 
         ",", "5"}], "\[RightDoubleBracket]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ip", ",", "np"}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"deptp", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"deptx", "\[LeftDoubleBracket]", 
        RowBox[{
        "hostp", "\[LeftDoubleBracket]", "ip", "\[RightDoubleBracket]"}], 
        "\[RightDoubleBracket]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ip", ",", "np"}], "}"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"provx", "=", 
     RowBox[{"Table", "[", 
      RowBox[{"0", ",", 
       RowBox[{"{", "nx", "}"}]}], "]"}]}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.632153390371439*^9, 3.632153391469548*^9}, {
   3.632155469752714*^9, 3.6321554699397144`*^9}, {3.6321564966141453`*^9, 
   3.6321565216245966`*^9}, {3.632157606007285*^9, 3.63215760685637*^9}, {
   3.632233068298915*^9, 3.632233079221915*^9}, 3.632233223494915*^9, 
   3.6322396288492002`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Do", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"host1x", "[", 
         RowBox[{"[", "ix", "]"}], "]"}], "\[Equal]", "1"}], ",", 
       RowBox[{
        RowBox[{
         RowBox[{"provx", "[", 
          RowBox[{"[", "ix", "]"}], "]"}], "=", 
         RowBox[{"Plus", "@@", 
          RowBox[{"Flatten", "[", 
           RowBox[{"Position", "[", 
            RowBox[{"hostp", ",", "ix"}], "]"}], "]"}]}]}], ";"}], ",", 
       RowBox[{
        RowBox[{"hostdept", "=", 
         RowBox[{"Select", "[", 
          RowBox[{"hostp", ",", 
           RowBox[{
            RowBox[{
             RowBox[{"deptx", "[", 
              RowBox[{"[", "#", "]"}], "]"}], "\[Equal]", 
             RowBox[{"deptx", "[", 
              RowBox[{"[", "ix", "]"}], "]"}]}], "&"}]}], "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"Plus", "@@", 
            RowBox[{"Flatten", "[", 
             RowBox[{"Position", "[", 
              RowBox[{"hostdept", ",", "CentralRef"}], "]"}], "]"}]}], ">", 
           "0"}], ",", 
          RowBox[{
           RowBox[{"hostdept", "=", 
            RowBox[{"Delete", "[", 
             RowBox[{"hostdept", ",", 
              RowBox[{"Plus", "@@", 
               RowBox[{"Flatten", "[", 
                RowBox[{"Position", "[", 
                 RowBox[{"hostdept", ",", "CentralRef"}], "]"}], "]"}]}]}], 
             "]"}]}], ";"}]}], "]"}], ";", "\[IndentingNewLine]", 
        RowBox[{"distancesp", "=", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"distancep", "[", 
            RowBox[{
             RowBox[{"hostdept", "[", 
              RowBox[{"[", "i", "]"}], "]"}], ",", 
             RowBox[{
              RowBox[{"Coord", "[", "ix", "]"}], "[", 
              RowBox[{"[", "2", "]"}], "]"}], ",", 
             RowBox[{
              RowBox[{"Coord", "[", "ix", "]"}], "[", 
              RowBox[{"[", "1", "]"}], "]"}]}], "]"}], ",", 
           RowBox[{"{", 
            RowBox[{"i", ",", 
             RowBox[{"Length", "[", "hostdept", "]"}]}], "}"}]}], "]"}]}], 
        ";", "\[IndentingNewLine]", 
        RowBox[{"MinPos", "=", 
         RowBox[{"Flatten", "[", 
          RowBox[{"Position", "[", 
           RowBox[{"distancesp", ",", 
            RowBox[{"Min", "[", "distancesp", "]"}]}], "]"}], "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"Length", "[", "MinPos", "]"}], ">", "1"}], ",", 
          RowBox[{
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"MemberQ", "[", 
              RowBox[{
               RowBox[{"Table", "[", 
                RowBox[{
                 RowBox[{"hostdept", "[", 
                  RowBox[{"[", "i", "]"}], "]"}], ",", 
                 RowBox[{"{", 
                  RowBox[{"i", ",", "MinPos"}], "}"}]}], "]"}], ",", 
               RowBox[{"hostp", "[", 
                RowBox[{"[", 
                 RowBox[{"Plus", "@@", 
                  RowBox[{"Flatten", "[", 
                   RowBox[{"Position", "[", 
                    RowBox[{"provTXTp", ",", 
                    RowBox[{"y", "[", 
                    RowBox[{"[", 
                    RowBox[{"ix", ",", "5"}], "]"}], "]"}]}], "]"}], "]"}]}], 
                 "]"}], "]"}]}], "]"}], ",", 
             RowBox[{
              RowBox[{
               RowBox[{"provx", "[", 
                RowBox[{"[", "ix", "]"}], "]"}], "=", 
               RowBox[{"Plus", "@@", 
                RowBox[{"Flatten", "[", 
                 RowBox[{"Position", "[", 
                  RowBox[{"provTXTp", ",", 
                   RowBox[{"y", "[", 
                    RowBox[{"[", 
                    RowBox[{"ix", ",", "5"}], "]"}], "]"}]}], "]"}], 
                 "]"}]}]}], ";"}], ",", 
             RowBox[{
              RowBox[{
               RowBox[{"provx", "[", 
                RowBox[{"[", "ix", "]"}], "]"}], "=", 
               RowBox[{"Plus", "@@", 
                RowBox[{"Flatten", "[", 
                 RowBox[{"Position", "[", 
                  RowBox[{"hostp", ",", 
                   RowBox[{"hostdept", "[", 
                    RowBox[{"[", 
                    RowBox[{"MinPos", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "]"}]}], "]"}], 
                 "]"}]}]}], ";"}]}], "]"}], ";"}], ",", 
          RowBox[{
           RowBox[{
            RowBox[{"provx", "[", 
             RowBox[{"[", "ix", "]"}], "]"}], "=", 
            RowBox[{"Plus", "@@", 
             RowBox[{"Flatten", "[", 
              RowBox[{"Position", "[", 
               RowBox[{"hostp", ",", 
                RowBox[{"hostdept", "[", 
                 RowBox[{"[", 
                  RowBox[{"Plus", "@@", "MinPos"}], "]"}], "]"}]}], "]"}], 
              "]"}]}]}], ";"}]}], "]"}], ";"}]}], "]"}], ";"}], ",", 
    RowBox[{"{", 
     RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ";"}]], "Input",
 CellChangeTimes->{{3.6322397984582*^9, 3.6322397984611998`*^9}, {
  3.632239989675136*^9, 3.632239997189887*^9}, {3.63265596339675*^9, 
  3.632655963969807*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "Las", " ", "Satelitales", " ", "las", " ", "considera", " ", "asociadas", 
    " ", "a", " ", "las", " ", "T\[AAcute]ndems"}], "*)"}], "\n", 
  RowBox[{
   RowBox[{
    RowBox[{"Do", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
          RowBox[{
          "transtechx", "\[LeftDoubleBracket]", "ix", 
           "\[RightDoubleBracket]"}], "\[Equal]", "Satelite"}], ",", 
         RowBox[{
          RowBox[{
           RowBox[{
           "provx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
           "=", 
           RowBox[{"provx", "\[LeftDoubleBracket]", 
            RowBox[{
             RowBox[{"tandemd", "\[LeftDoubleBracket]", 
              RowBox[{
              "deptx", "\[LeftDoubleBracket]", "ix", 
               "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "+", 
             RowBox[{"If", "[", 
              RowBox[{
               RowBox[{
                RowBox[{
                "deptx", "\[LeftDoubleBracket]", "ix", 
                 "\[RightDoubleBracket]"}], "\[Equal]", "LIMA"}], ",", "9", 
               ",", "0"}], "]"}]}], "\[RightDoubleBracket]"}]}], ";"}]}], 
        "\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]", ",", 
      RowBox[{"{", 
       RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{
    "Correcci\[OAcute]n", " ", "de", " ", "Moyopampa", " ", "hacia", " ", 
     "Monterrico"}], "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Do", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
        "provx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], "=", 
        RowBox[{"Plus", "@@", 
         RowBox[{"Flatten", "[", 
          RowBox[{"Position", "[", 
           RowBox[{"provTXTp", ",", "\"\<MONTERRICOIIIP\>\""}], "]"}], 
          "]"}]}]}], ";"}], "\[IndentingNewLine]", ",", 
      RowBox[{"{", 
       RowBox[{"ix", ",", 
        RowBox[{"Select", "[", 
         RowBox[{
          RowBox[{"Range", "[", "nx", "]"}], ",", 
          RowBox[{
           RowBox[{
            RowBox[{"StringTake", "[", 
             RowBox[{
              RowBox[{"y", "\[LeftDoubleBracket]", 
               RowBox[{"#", ",", "16"}], "\[RightDoubleBracket]"}], ",", 
              RowBox[{"Min", "[", 
               RowBox[{"5", ",", 
                RowBox[{"StringLength", "[", 
                 RowBox[{"y", "\[LeftDoubleBracket]", 
                  RowBox[{"#", ",", "16"}], "\[RightDoubleBracket]"}], 
                 "]"}]}], "]"}]}], "]"}], "\[Equal]", "\"\<MOYOP\>\""}], 
           "&"}]}], "]"}]}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"allhostx", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Pos", "[", 
        RowBox[{
        "tandemx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
        "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"Do", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
          RowBox[{
          "host1x", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
          "\[Equal]", "0"}], ",", 
         RowBox[{
          RowBox[{"Do", "[", 
           RowBox[{
            RowBox[{
             RowBox[{"If", "[", 
              RowBox[{
               RowBox[{
                RowBox[{
                "hostx", "\[LeftDoubleBracket]", "jx", 
                 "\[RightDoubleBracket]"}], "\[And]", 
                RowBox[{
                 RowBox[{
                 "provx", "\[LeftDoubleBracket]", "jx", 
                  "\[RightDoubleBracket]"}], "\[Equal]", 
                 RowBox[{
                 "provx", "\[LeftDoubleBracket]", "ix", 
                  "\[RightDoubleBracket]"}]}]}], ",", 
               RowBox[{
                RowBox[{
                 RowBox[{
                 "allhostx", "\[LeftDoubleBracket]", "ix", 
                  "\[RightDoubleBracket]"}], "=", "jx"}], ";"}]}], "]"}], 
             ";"}], ",", 
            RowBox[{"{", 
             RowBox[{"jx", ",", "nx"}], "}"}]}], "]"}], ";"}]}], "]"}], ";"}],
       ",", 
      RowBox[{"{", 
       RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ";"}], 
   StyleBox["\[IndentingNewLine]",
    FontColor->GrayLevel[0]], 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{
      RowBox[{
      "Creaci\[OAcute]n", " ", "de", " ", "\"\<Provincias de Anillos\>\""}], 
      ",", " ", 
      RowBox[{
       RowBox[{
       "une", " ", "en", " ", "s\[OAcute]lo", " ", "un", " ", "grupo", " ", 
        "a", " ", "las", " ", "uras", " ", "conectadas", " ", "a", " ", "las",
         " ", "cabeceras", " ", "co"}], "-", "ubicadas"}]}], "*)"}],
    FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ProvAnillosa", "=", 
     RowBox[{"DeleteDuplicates", "[", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"hostp", "\[LeftDoubleBracket]", 
         RowBox[{"Select", "[", 
          RowBox[{
           RowBox[{"Range", "[", "np", "]"}], ",", 
           RowBox[{
            RowBox[{
             RowBox[{"Coord", "[", 
              RowBox[{
              "hostp", "\[LeftDoubleBracket]", "ip", 
               "\[RightDoubleBracket]"}], "]"}], "\[Equal]", 
             RowBox[{"Coord", "[", 
              RowBox[{
              "hostp", "\[LeftDoubleBracket]", "#", "\[RightDoubleBracket]"}],
               "]"}]}], "&"}]}], "]"}], "\[RightDoubleBracket]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ip", ",", "np"}], "}"}]}], "]"}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"na", "=", 
     RowBox[{"Length", "[", "ProvAnillosa", "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"NombreAnillosa", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"y", "\[LeftDoubleBracket]", 
          RowBox[{
           RowBox[{"ProvAnillosa", "\[LeftDoubleBracket]", 
            RowBox[{"ia", ",", "ja"}], "\[RightDoubleBracket]"}], ",", "16"}],
           "\[RightDoubleBracket]"}], ",", 
         RowBox[{"{", 
          RowBox[{"ja", ",", 
           RowBox[{"Length", "[", 
            RowBox[{
            "ProvAnillosa", "\[LeftDoubleBracket]", "ia", 
             "\[RightDoubleBracket]"}], "]"}]}], "}"}]}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ia", ",", "na"}], "}"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"LongNombreAnillosa", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"StringLength", "[", 
          RowBox[{"NombreAnillosa", "\[LeftDoubleBracket]", 
           RowBox[{"ia", ",", "ja"}], "\[RightDoubleBracket]"}], "]"}], ",", 
         RowBox[{"{", 
          RowBox[{"ja", ",", 
           RowBox[{"Length", "[", 
            RowBox[{
            "ProvAnillosa", "\[LeftDoubleBracket]", "ia", 
             "\[RightDoubleBracket]"}], "]"}]}], "}"}]}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ia", ",", "na"}], "}"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"MinLongNombreAnillosa", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Min", "[", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"LongNombreAnillosa", "\[LeftDoubleBracket]", 
           RowBox[{"ia", ",", "ja"}], "\[RightDoubleBracket]"}], ",", 
          RowBox[{"{", 
           RowBox[{"ja", ",", 
            RowBox[{"Length", "[", 
             RowBox[{
             "ProvAnillosa", "\[LeftDoubleBracket]", "ia", 
              "\[RightDoubleBracket]"}], "]"}]}], "}"}]}], "]"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ia", ",", "na"}], "}"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"PosMinLongNombreAnillosa", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Min", "[", 
        RowBox[{"Position", "[", 
         RowBox[{
          RowBox[{
          "LongNombreAnillosa", "\[LeftDoubleBracket]", "ia", 
           "\[RightDoubleBracket]"}], ",", 
          RowBox[{
          "MinLongNombreAnillosa", "\[LeftDoubleBracket]", "ia", 
           "\[RightDoubleBracket]"}]}], "]"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ia", ",", "na"}], "}"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"provTXTa", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"StringJoin", "[", 
        RowBox[{
         RowBox[{"NombreAnillosa", "\[LeftDoubleBracket]", 
          RowBox[{"ia", ",", 
           RowBox[{
           "PosMinLongNombreAnillosa", "\[LeftDoubleBracket]", "ia", 
            "\[RightDoubleBracket]"}]}], "\[RightDoubleBracket]"}], ",", 
         "\"\<P\>\""}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ia", ",", "na"}], "}"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"provax", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"Position", "[", 
         RowBox[{"ProvAnillosa", ",", 
          RowBox[{"hostp", "\[LeftDoubleBracket]", 
           RowBox[{
           "provx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
           "\[RightDoubleBracket]"}]}], "]"}], "\[LeftDoubleBracket]", 
        RowBox[{"1", ",", "1"}], "\[RightDoubleBracket]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]"}]}]], "Input",
 CellChangeTimes->{{3.632153390371439*^9, 3.632153391469548*^9}, {
  3.632155469752714*^9, 3.6321554699397144`*^9}, {3.6321564966141453`*^9, 
  3.6321565216245966`*^9}, {3.632157606007285*^9, 3.63215760685637*^9}, {
  3.632233068298915*^9, 3.632233079221915*^9}, {3.632233223494915*^9, 
  3.632233230671915*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", 
    RowBox[{"Vectores", " ", "Cero", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"variables", " ", "auxiliares", " ", "\"\<zerox\>\""}], ",", 
       "\"\<zerop\>\"", ",", "\"\<zerod\>\""}], ")"}]}], "*)"}],
   FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"zerox", "=", 
     RowBox[{"Table", "[", 
      RowBox[{"0", ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}], 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{"vector", " ", "de", " ", "muchos", " ", 
      RowBox[{"ceros", ":", 
       RowBox[{"N\[UAcute]mero", " ", "de", " ", "centrales"}]}]}], "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"zerop", "=", 
     RowBox[{"Table", "[", 
      RowBox[{"0", ",", 
       RowBox[{"{", 
        RowBox[{"ip", ",", "np"}], "}"}]}], "]"}]}], ";"}], 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{"vector", " ", "de", " ", "muchos", " ", 
      RowBox[{"ceros", ":", 
       RowBox[{"N\[UAcute]mero", " ", "de", " ", "provincias"}]}]}], "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"zerod", "=", 
     RowBox[{"Table", "[", 
      RowBox[{"0", ",", 
       RowBox[{"{", 
        RowBox[{"id", ",", "nd"}], "}"}]}], "]"}]}], ";"}], 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{"vector", " ", "de", " ", "24", " ", 
      RowBox[{"ceros", ":", 
       RowBox[{"N\[UAcute]mero", " ", "de", " ", "departamentos"}]}]}], "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"onex", "=", 
     RowBox[{"Table", "[", 
      RowBox[{"1", ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}], 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{"vector", " ", "de", " ", "muchos", " ", 
      RowBox[{"unos", ":", 
       RowBox[{"N\[UAcute]mero", " ", "de", " ", "centrales"}]}]}], "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"onep", "=", 
     RowBox[{"Table", "[", 
      RowBox[{"1", ",", 
       RowBox[{"{", 
        RowBox[{"ip", ",", "np"}], "}"}]}], "]"}]}], ";"}], 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{"vector", " ", "de", " ", "muchos", " ", 
      RowBox[{"unos", ":", 
       RowBox[{"N\[UAcute]mero", " ", "de", " ", "provincias"}]}]}], "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"oned", "=", 
     RowBox[{"Table", "[", 
      RowBox[{"1", ",", 
       RowBox[{"{", 
        RowBox[{"id", ",", "nd"}], "}"}]}], "]"}]}], ";"}], 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{"vector", " ", "de", " ", "24", " ", 
      RowBox[{"unos", ":", 
       RowBox[{"N\[UAcute]mero", " ", "de", " ", "departamentos"}]}]}], "*)"}],
    FontColor->GrayLevel[0.5]], "\[IndentingNewLine]", 
   StyleBox[
    RowBox[{"(*", 
     RowBox[{
     "Identifica", " ", "los", " ", "nodos", " ", "que", " ", "usan", " ", 
      "fibra", " ", "como", " ", "tecnolog\[IAcute]a", " ", "de", " ", "Tx", 
      " ", "con", " ", "\"\<1\>\"", " ", "y", " ", "los", " ", 
      "dem\[AAcute]s", " ", "con", " ", "\"\<0\>\""}], "*)"}],
    FontColor->GrayLevel[0.5]], "\n", 
   StyleBox[
    RowBox[{
     RowBox[{"tandemx", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"tandemd", "\[LeftDoubleBracket]", 
         RowBox[{
         "deptx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
         "\[RightDoubleBracket]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}],
    FontColor->GrayLevel[0]], "\[IndentingNewLine]"}]}]], "Input",
 CellChangeTimes->{{3.6321534289142923`*^9, 3.632153442032604*^9}, 
   3.6321534763090315`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", " ", 
    RowBox[{
    "Identificamos", " ", "el", " ", "host", " ", "por", " ", "cada", " ", 
     "provincia"}], " ", "*)"}],
   FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"AnilloCabeceras", "=", "hostp"}], ";"}], "\n", 
   StyleBox[
    RowBox[{"(*", " ", 
     RowBox[{
      RowBox[{"Anillos", " ", "Cabeceras"}], ",", " ", 
      RowBox[{"marca", " ", "las", " ", "cabeceras", " ", "provinciales"}]}], 
     " ", "*)"}],
    FontColor->RGBColor[1, 0, 0]], "\n", 
   RowBox[{
    RowBox[{"ConexionProv", "=", 
     RowBox[{"Range", "[", "np", "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"Do", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
        "ConexionProv", "\[LeftDoubleBracket]", "ip", 
         "\[RightDoubleBracket]"}], "=", 
        RowBox[{"provx", "\[LeftDoubleBracket]", 
         RowBox[{"tandemx", "\[LeftDoubleBracket]", 
          RowBox[{
          "AnilloCabeceras", "\[LeftDoubleBracket]", "ip", 
           "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
         "\[RightDoubleBracket]"}]}], ";"}], "\[IndentingNewLine]", ",", 
      RowBox[{"{", 
       RowBox[{"ip", ",", "np"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Conexion", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"hostp", "\[LeftDoubleBracket]", 
        RowBox[{
        "provx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
        "\[RightDoubleBracket]"}], ",", 
       RowBox[{"{", 
        RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Do", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
          RowBox[{
          "host1x", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
          "\[Equal]", "1"}], ",", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{
           RowBox[{
           "Conexion", "\[LeftDoubleBracket]", "ix", 
            "\[RightDoubleBracket]"}], "=", "ix"}], ";"}], ",", 
         "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{
           RowBox[{
           "Conexion", "\[LeftDoubleBracket]", "ix", 
            "\[RightDoubleBracket]"}], "=", 
           RowBox[{
           "allhostx", "\[LeftDoubleBracket]", "ix", 
            "\[RightDoubleBracket]"}]}], ";"}]}], "\[IndentingNewLine]", 
        "]"}], ";"}], "\[IndentingNewLine]", ",", 
      RowBox[{"{", 
       RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.632153531957596*^9, 3.632153532263626*^9}, {
  3.6321552365220146`*^9, 3.632155236794015*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"factorNoLinealx", "=", "onex"}], ";"}], "\n", 
  StyleBox[
   RowBox[{"(*", 
    RowBox[{
     RowBox[{
     "Este", " ", "listado", " ", "corresponde", " ", "a", " ", "los", " ", 
      "enlaces", " ", "que", " ", "siendo", " ", "de", " ", 
      "Tecnolog\[IAcute]a", " ", "Urbana", " ", 
      RowBox[{"(", "Canalizada", ")"}]}], ",", " ", 
     RowBox[{"son", " ", "tramos", " ", "inter", " ", "urbanos"}]}], "*)"}],
   FontColor->RGBColor[1, 0, 0]]}], "\n", 
 RowBox[{
  RowBox[{"Do", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{
         "transtechx", "\[LeftDoubleBracket]", "ix", 
          "\[RightDoubleBracket]"}], "\[Equal]", "Enterrado"}], "\[Or]", 
        RowBox[{
         RowBox[{
         "transtechx", "\[LeftDoubleBracket]", "ix", 
          "\[RightDoubleBracket]"}], "\[Equal]", "Aereo"}]}], ",", 
       RowBox[{
        RowBox[{
        "factorNoLinealx", "\[LeftDoubleBracket]", "ix", 
         "\[RightDoubleBracket]"}], "=", "factorNoLinealNoUrban"}]}], "]"}], 
     ";", "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
        "transtechx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}],
         "\[Equal]", "Urbana"}], ",", 
       RowBox[{
        RowBox[{
        "factorNoLinealx", "\[LeftDoubleBracket]", "ix", 
         "\[RightDoubleBracket]"}], "=", "factorNoLinealUrban"}]}], "]"}], 
     ";", "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
        "transtechx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}],
         "\[Equal]", "Radio"}], ",", 
       RowBox[{
        RowBox[{
        "factorNoLinealx", "\[LeftDoubleBracket]", "ix", 
         "\[RightDoubleBracket]"}], "=", "factorNoLinealRadio"}]}], "]"}], 
     ";"}], "\[IndentingNewLine]", ",", 
    RowBox[{"{", 
     RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ";"}], "\n", 
 RowBox[{
  StyleBox[
   RowBox[{"(*", " ", 
    RowBox[{
    "Para", " ", "cada", " ", "central", " ", "se", " ", "especifica", " ", 
     "cu\[AAcute]l", " ", "es", " ", "el", " ", "factor", " ", "de", " ", 
     "ajuste", " ", "por", " ", "no", " ", "linealidad", " ", "dependiendo", 
     " ", "de", " ", "la", " ", "tecnolog\[IAcute]a", " ", "de", " ", 
     "transmisi\[OAcute]n", " ", "que", " ", "se", " ", "usa", " ", "en", " ",
      "dicho", " ", "nodo"}], " ", "*)"}],
   FontColor->RGBColor[1, 0, 0]]}]}], "Input"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"disthost1x", "=", 
   RowBox[{"Abs", "[", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{"distance", "[", 
       RowBox[{"ix", ",", 
        RowBox[{"Pos", "[", 
         RowBox[{
         "allhostx", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
         "]"}]}], "   ", "]"}], ",", 
      RowBox[{"{", 
       RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"disthostx", "=", 
   FractionBox["disthost1x", "factorNoLinealx"]}], ";"}]}], "Input",
 CellChangeTimes->{{3.632164240409089*^9, 3.6321642409238954`*^9}, {
  3.632241295016657*^9, 3.63224129694485*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Funcion Auxiliar", "Subsection",
 CellChangeTimes->{{3.632241384067561*^9, 3.632241390245179*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"DataCoord", "[", "TCoord_", "]"}], ":=", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"Max", ",", "Min", ",", "n", ",", "Dif"}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"n", "=", 
       RowBox[{"Length", "[", "TCoord", "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"Min", "=", 
       RowBox[{
       "TCoord", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{"Max", "=", "Min"}], ";", "\[IndentingNewLine]", 
      RowBox[{"Do", "[", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"TCoord", "\[LeftDoubleBracket]", 
             RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}], ">", 
            RowBox[{
            "Max", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], 
           ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{
             RowBox[{
             "Max", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], 
             "=", 
             RowBox[{"TCoord", "\[LeftDoubleBracket]", 
              RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}]}], ";"}]}], 
          "]"}], ";", "\[IndentingNewLine]", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"TCoord", "\[LeftDoubleBracket]", 
             RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}], ">", 
            RowBox[{
            "Max", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], 
           ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{
             RowBox[{
             "Max", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], 
             "=", 
             RowBox[{"TCoord", "\[LeftDoubleBracket]", 
              RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}]}], ";"}]}], 
          "]"}], ";", "\[IndentingNewLine]", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"TCoord", "\[LeftDoubleBracket]", 
             RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}], "<", 
            RowBox[{
            "Min", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], 
           ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{
             RowBox[{
             "Min", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], 
             "=", 
             RowBox[{"TCoord", "\[LeftDoubleBracket]", 
              RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}]}], ";"}]}], 
          "]"}], ";", "\[IndentingNewLine]", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"TCoord", "\[LeftDoubleBracket]", 
             RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}], "<", 
            RowBox[{
            "Min", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], 
           ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{
             RowBox[{
             "Min", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], 
             "=", 
             RowBox[{"TCoord", "\[LeftDoubleBracket]", 
              RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}]}], ";"}]}], 
          "]"}], ";"}], "\[IndentingNewLine]", ",", 
        RowBox[{"{", 
         RowBox[{"i", ",", "2", ",", "n"}], "}"}]}], "]"}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"Dif", "=", 
       RowBox[{"Max", "-", "Min"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"Join", "[", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{
            RowBox[{
            "Dif", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], 
            "\[Equal]", "0"}], ",", "0", ",", 
           FractionBox[
            RowBox[{
            "Dif", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], 
            RowBox[{
            "Dif", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]]}], 
          "]"}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{
             "Min", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], 
             ",", 
             RowBox[{
             "Max", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], 
            "}"}], ",", 
           RowBox[{"{", 
            RowBox[{
             RowBox[{
             "Min", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], 
             ",", 
             RowBox[{
             "Max", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], 
            "}"}]}], "}"}], "}"}]}], "]"}]}]}], "\[IndentingNewLine]", 
    "]"}]}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Definicion de Algoritmo de Vendedor Viajero", "Subsection",
 CellChangeTimes->{{3.632222918859342*^9, 3.632222934140565*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"VendedorViajero", "[", 
    RowBox[{"Elementos_", ",", "DI_", ",", "SOrden_"}], "]"}], ":=", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "nN", ",", "COrden", ",", "TOrden", ",", "KOrden", ",", "DIx", ",", "d",
        ",", "T", ",", "StillDo", ",", "dist", ",", "i", ",", "j", ",", "ik", 
       ",", "jk", ",", "dp", ",", "di", ",", "x", ",", "csup", ",", "cont", 
       ",", "NConexion", ",", "ElemAct", ",", "ElemSig", ",", "IndAct", ",", 
       "IndSig", ",", "Coords", ",", "DCoords", ",", "AspectRt", ",", 
       "CrdRange", ",", "MidSumX", ",", "MidDifX", ",", "MidSumY", ",", 
       "MidDifY", ",", "ListaLineas", ",", "ListaLineasO", ",", 
       "ListaLineasOp", ",", "chgcount", ",", "countofZero", ",", "lastchg", 
       ",", "S1Orden", ",", "succ"}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"nN", "=", 
       RowBox[{"Length", "[", "Elementos", "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"lastchg", "=", "1"}], ";", "\[IndentingNewLine]", 
      RowBox[{"DIx", "=", "DI"}], ";", "\[IndentingNewLine]", 
      RowBox[{"KOrden", "=", "SOrden"}], ";", "\[IndentingNewLine]", 
      RowBox[{"S1Orden", "=", 
       RowBox[{"Table", "[", 
        RowBox[{"k", ",", 
         RowBox[{"{", 
          RowBox[{"k", ",", "nN"}], "}"}]}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"Coords", "=", 
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"Coord", "[", "i", "]"}], ",", 
         RowBox[{"{", 
          RowBox[{"i", ",", "Elementos"}], "}"}]}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"DCoords", "=", 
       RowBox[{"DataCoord", "[", "Coords", "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"AspectRt", "=", 
       RowBox[{
       "DCoords", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{"CrdRange", "=", 
       RowBox[{
       "DCoords", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{"If", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"AspectRt", ">", "2"}], "\[Or]", 
         RowBox[{"AspectRt", "<", 
          FractionBox["1", "2"]}]}], ",", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"MidSumX", "=", 
          FractionBox[
           RowBox[{"Plus", "@@", 
            RowBox[{
            "CrdRange", "\[LeftDoubleBracket]", "1", 
             "\[RightDoubleBracket]"}]}], "2"]}], ";", "\[IndentingNewLine]", 
         RowBox[{"MidDifX", "=", 
          FractionBox[
           RowBox[{
            RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
             RowBox[{"1", ",", "2"}], "\[RightDoubleBracket]"}], "-", 
            RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
             RowBox[{"1", ",", "1"}], "\[RightDoubleBracket]"}]}], "2"]}], 
         ";", "\[IndentingNewLine]", 
         RowBox[{"MidSumY", "=", 
          FractionBox[
           RowBox[{"Plus", "@@", 
            RowBox[{
            "CrdRange", "\[LeftDoubleBracket]", "2", 
             "\[RightDoubleBracket]"}]}], "2"]}], ";", "\[IndentingNewLine]", 
         RowBox[{"MidDifY", "=", 
          FractionBox[
           RowBox[{
            RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
             RowBox[{"2", ",", "2"}], "\[RightDoubleBracket]"}], "-", 
            RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
             RowBox[{"2", ",", "1"}], "\[RightDoubleBracket]"}]}], "2"]}], 
         ";", "\[IndentingNewLine]", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{"AspectRt", ">", "2"}], ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"MidDifX", "=", 
             FractionBox["MidDifY", "2"]}], ";", "\[IndentingNewLine]", 
            RowBox[{
             RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
              RowBox[{"1", ",", "1"}], "\[RightDoubleBracket]"}], "=", 
             RowBox[{"MidSumX", "-", "MidDifX"}]}], ";", 
            "\[IndentingNewLine]", 
            RowBox[{
             RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
              RowBox[{"1", ",", "2"}], "\[RightDoubleBracket]"}], "=", 
             RowBox[{"MidSumX", "+", "MidDifX"}]}], ";"}], ",", 
           "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"MidDifY", "=", 
             FractionBox["MidDifX", "2"]}], ";", "\[IndentingNewLine]", 
            RowBox[{
             RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
              RowBox[{"2", ",", "1"}], "\[RightDoubleBracket]"}], "=", 
             RowBox[{"MidSumY", "-", "MidDifY"}]}], ";", 
            "\[IndentingNewLine]", 
            RowBox[{
             RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
              RowBox[{"2", ",", "2"}], "\[RightDoubleBracket]"}], "=", 
             RowBox[{"MidSumY", "+", "MidDifY"}]}], ";"}]}], 
          "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}],
       ";", "\[IndentingNewLine]", 
      RowBox[{"MidSumX", "=", 
       FractionBox[
        RowBox[{"Plus", "@@", 
         RowBox[{
         "CrdRange", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}],
         "2"]}], ";", "\[IndentingNewLine]", 
      RowBox[{"MidDifX", "=", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "+", 
          FractionBox["1", "10"]}], ")"}], 
        FractionBox[
         RowBox[{
          RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
           RowBox[{"1", ",", "2"}], "\[RightDoubleBracket]"}], "-", 
          RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
           RowBox[{"1", ",", "1"}], "\[RightDoubleBracket]"}]}], "2"]}]}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{"MidSumY", "=", 
       FractionBox[
        RowBox[{"Plus", "@@", 
         RowBox[{
         "CrdRange", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}],
         "2"]}], ";", "\[IndentingNewLine]", 
      RowBox[{"MidDifY", "=", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "+", 
          FractionBox["1", "10"]}], ")"}], 
        FractionBox[
         RowBox[{
          RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
           RowBox[{"2", ",", "2"}], "\[RightDoubleBracket]"}], "-", 
          RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
           RowBox[{"2", ",", "1"}], "\[RightDoubleBracket]"}]}], "2"]}]}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
        RowBox[{"1", ",", "1"}], "\[RightDoubleBracket]"}], "=", 
       RowBox[{"MidSumX", "-", "MidDifX"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
        RowBox[{"1", ",", "2"}], "\[RightDoubleBracket]"}], "=", 
       RowBox[{"MidSumX", "+", "MidDifX"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
        RowBox[{"2", ",", "1"}], "\[RightDoubleBracket]"}], "=", 
       RowBox[{"MidSumY", "-", "MidDifY"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"CrdRange", "\[LeftDoubleBracket]", 
        RowBox[{"2", ",", "2"}], "\[RightDoubleBracket]"}], "=", 
       RowBox[{"MidSumY", "+", "MidDifY"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"AspectRt", "=", 
       FractionBox["MidDifY", "MidDifX"]}], ";", "\[IndentingNewLine]", 
      RowBox[{"TOrden", "=", 
       RowBox[{"Table", "[", 
        RowBox[{"k", ",", 
         RowBox[{"{", 
          RowBox[{"k", ",", "nN"}], "}"}]}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"(*", 
       RowBox[{
        RowBox[{"SOrden", "=", 
         RowBox[{"Table", "[", 
          RowBox[{"k", ",", 
           RowBox[{"{", 
            RowBox[{"k", ",", "nN"}], "}"}]}], "]"}]}], ";", " ", "Inicial"}],
        "*)"}], "\[IndentingNewLine]", 
      RowBox[{"COrden", "=", "SOrden"}], ";", " ", 
      RowBox[{"(*", "Actual", "*)"}], "\[IndentingNewLine]", 
      RowBox[{"d", "=", 
       RowBox[{"Plus", "@@", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"distance", "[", 
           RowBox[{
            RowBox[{"Elementos", "\[LeftDoubleBracket]", 
             RowBox[{
             "SOrden", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}],
              "\[RightDoubleBracket]"}], ",", 
            RowBox[{"Elementos", "\[LeftDoubleBracket]", 
             RowBox[{"SOrden", "\[LeftDoubleBracket]", 
              RowBox[{"If", "[", 
               RowBox[{
                RowBox[{"k", "<", "nN"}], ",", 
                RowBox[{"k", "+", "1"}], ",", "1"}], "]"}], 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], "]"}], 
          ",", 
          RowBox[{"{", 
           RowBox[{"k", ",", "nN"}], "}"}]}], "]"}]}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"di", "=", "d"}], ";", "\[IndentingNewLine]", 
      RowBox[{"T", "=", "1"}], ";", " ", 
      RowBox[{"(*", " ", 
       RowBox[{"Temperatura", " ", "Inicial"}], " ", "*)"}], 
      "\[IndentingNewLine]", 
      RowBox[{"i", "=", "1"}], ";", "\[IndentingNewLine]", 
      RowBox[{"StillDo", "=", "True"}], ";", "\[IndentingNewLine]", 
      RowBox[{"cont", "=", "0"}], ";", "\[IndentingNewLine]", 
      RowBox[{"csup", "=", "0"}], ";", "\[IndentingNewLine]", 
      RowBox[{"ListaLineasO", "=", 
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"Dashed", ",", 
           RowBox[{"RGBColor", "[", 
            RowBox[{
             FractionBox["7", "8"], ",", 
             FractionBox["7", "8"], ",", 
             FractionBox["7", "8"]}], "]"}], ",", 
           RowBox[{"Arrow", "[", 
            RowBox[{"{", 
             RowBox[{
              RowBox[{"Coords", "\[LeftDoubleBracket]", 
               RowBox[{
               "S1Orden", "\[LeftDoubleBracket]", "i", 
                "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", 
              RowBox[{"Coords", "\[LeftDoubleBracket]", 
               RowBox[{"If", "[", 
                RowBox[{
                 RowBox[{"i", "\[Equal]", 
                  RowBox[{"Length", "[", "Elementos", "]"}]}], ",", 
                 RowBox[{
                 "S1Orden", "\[LeftDoubleBracket]", "1", 
                  "\[RightDoubleBracket]"}], ",", 
                 RowBox[{"S1Orden", "\[LeftDoubleBracket]", 
                  RowBox[{"i", "+", "1"}], "\[RightDoubleBracket]"}]}], "]"}],
                "\[RightDoubleBracket]"}]}], "}"}], "]"}]}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"i", ",", 
           RowBox[{"Length", "[", "Elementos", "]"}]}], "}"}]}], "]"}]}], ";",
       "\[IndentingNewLine]", 
      RowBox[{"ListaLineasOp", "=", 
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"Dotted", ",", 
           RowBox[{"RGBColor", "[", 
            RowBox[{"1", ",", 
             FractionBox["1", "2"], ",", 
             FractionBox["1", "2"]}], "]"}], ",", 
           RowBox[{"Arrow", "[", 
            RowBox[{"{", 
             RowBox[{
              RowBox[{"Coords", "\[LeftDoubleBracket]", 
               RowBox[{
               "SOrden", "\[LeftDoubleBracket]", "i", 
                "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", 
              RowBox[{"Coords", "\[LeftDoubleBracket]", 
               RowBox[{"If", "[", 
                RowBox[{
                 RowBox[{"i", "\[Equal]", 
                  RowBox[{"Length", "[", "Elementos", "]"}]}], ",", 
                 RowBox[{
                 "SOrden", "\[LeftDoubleBracket]", "1", 
                  "\[RightDoubleBracket]"}], ",", 
                 RowBox[{"SOrden", "\[LeftDoubleBracket]", 
                  RowBox[{"i", "+", "1"}], "\[RightDoubleBracket]"}]}], "]"}],
                "\[RightDoubleBracket]"}]}], "}"}], "]"}]}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{"i", ",", 
           RowBox[{"Length", "[", "Elementos", "]"}]}], "}"}]}], "]"}]}], ";",
       "\[IndentingNewLine]", 
      RowBox[{"Print", "[", 
       RowBox[{"Graphics", "[", 
        RowBox[{
         RowBox[{"Dynamic", "[", 
          RowBox[{"Append", "[", 
           RowBox[{
            RowBox[{"Append", "[", 
             RowBox[{"ListaLineasOp", ",", "ListaLineasO"}], "]"}], ",", 
            "ListaLineas"}], "]"}], "]"}], ",", 
         RowBox[{"AspectRatio", "\[Rule]", "AspectRt"}], ",", 
         RowBox[{"Axes", "\[Rule]", "False"}], ",", 
         RowBox[{"Frame", "\[Rule]", "True"}], ",", 
         RowBox[{"GridLines", "\[Rule]", "Automatic"}], ",", 
         RowBox[{"GridLinesStyle", "\[Rule]", 
          RowBox[{"Directive", "[", 
           RowBox[{
            RowBox[{"RGBColor", "[", 
             RowBox[{
              FractionBox["31", "32"], ",", 
              FractionBox["31", "32"], ",", 
              FractionBox["31", "32"]}], "]"}], ",", "Dotted"}], "]"}]}], ",", 
         RowBox[{"PlotLabel", "\[Rule]", 
          RowBox[{"Style", "[", 
           RowBox[{
            RowBox[{"provTXTp", "\[LeftDoubleBracket]", 
             RowBox[{"provx", "\[LeftDoubleBracket]", 
              RowBox[{
              "Elementos", "\[LeftDoubleBracket]", "1", 
               "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
             "\[RightDoubleBracket]"}], ",", "12", ",", "Bold", ",", 
            RowBox[{"FormatType", "\[Rule]", "TraditionalForm"}]}], "]"}]}], 
         ",", 
         RowBox[{"AxesLabel", "\[Rule]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"Style", "[", 
             RowBox[{"\"\<Longitud\>\"", ",", "10", ",", "Bold", ",", 
              RowBox[{"FormatType", "\[Rule]", "TraditionalForm"}]}], "]"}], 
            ",", 
            RowBox[{"Style", "[", 
             RowBox[{"\"\<Latitud\>\"", ",", "10", ",", "Bold", ",", 
              RowBox[{"FormatType", "\[Rule]", "TraditionalForm"}]}], "]"}]}],
            "}"}]}], ",", 
         RowBox[{"FrameLabel", "\[Rule]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"Style", "[", 
             RowBox[{"\"\<Longitud\>\"", ",", "10", ",", "Bold", ",", 
              RowBox[{"FormatType", "\[Rule]", "TraditionalForm"}]}], "]"}], 
            ",", 
            RowBox[{"Style", "[", 
             RowBox[{"\"\<Latitud\>\"", ",", "10", ",", "Bold", ",", 
              RowBox[{"FormatType", "\[Rule]", "TraditionalForm"}]}], "]"}]}],
            "}"}]}], ",", 
         RowBox[{"Background", "\[Rule]", "White"}], ",", 
         RowBox[{"ImageMargins", "\[Rule]", "10"}], ",", 
         RowBox[{"PlotRange", "\[Rule]", "CrdRange"}], ",", 
         RowBox[{"TicksStyle", "\[Rule]", 
          RowBox[{"Directive", "[", 
           RowBox[{
            RowBox[{"FontSize", "\[Rule]", "10"}], ",", 
            RowBox[{"FormatType", "\[Rule]", "TraditionalForm"}]}], "]"}]}]}],
         "]"}], "]"}], ";", "\[IndentingNewLine]", 
      RowBox[{"Print", "[", 
       RowBox[{"\"\<Temperatura=\>\"", ",", 
        RowBox[{"Dynamic", "[", 
         RowBox[{"N", "[", 
          RowBox[{"1000", "T"}], "]"}], "]"}], ",", "\"\< K\>\""}], "]"}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{"Print", "[", 
       RowBox[{"\"\<Distancia Inicial=\>\"", ",", "di", ",", "\"\< Km\>\""}], 
       "]"}], ";", "\[IndentingNewLine]", 
      RowBox[{"Print", "[", 
       RowBox[{"\"\<Distancia Actual=\>\"", ",", 
        RowBox[{"Dynamic", "[", "d", "]"}], ",", "\"\< Km\>\""}], "]"}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"countofZero", "=", "0"}], ";", "\[IndentingNewLine]", 
      RowBox[{"While", "[", 
       RowBox[{"StillDo", ",", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"chgcount", "=", "0"}], ";", "\[IndentingNewLine]", 
         RowBox[{"succ", "=", "0"}], ";", "\[IndentingNewLine]", 
         RowBox[{"ListaLineas", "=", 
          RowBox[{"Table", "[", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
              RowBox[{"If", "[", 
               RowBox[{
                RowBox[{
                 RowBox[{"transtechx", "\[LeftDoubleBracket]", 
                  RowBox[{
                  "Elementos", "\[LeftDoubleBracket]", "i", 
                   "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
                 "\[Equal]", "Radio"}], ",", "Red", ",", 
                RowBox[{"RGBColor", "[", 
                 RowBox[{"0", ",", 
                  FractionBox["1", "2"], ",", "0"}], "]"}]}], "]"}], ",", 
              RowBox[{"Arrow", "[", 
               RowBox[{"{", 
                RowBox[{
                 RowBox[{"Coords", "\[LeftDoubleBracket]", 
                  RowBox[{
                  "COrden", "\[LeftDoubleBracket]", "i", 
                   "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", 
                 RowBox[{"Coords", "\[LeftDoubleBracket]", 
                  RowBox[{"If", "[", 
                   RowBox[{
                    RowBox[{"i", "\[Equal]", 
                    RowBox[{"Length", "[", "Elementos", "]"}]}], ",", 
                    RowBox[{
                    "COrden", "\[LeftDoubleBracket]", "1", 
                    "\[RightDoubleBracket]"}], ",", 
                    RowBox[{"COrden", "\[LeftDoubleBracket]", 
                    RowBox[{"i", "+", "1"}], "\[RightDoubleBracket]"}]}], 
                   "]"}], "\[RightDoubleBracket]"}]}], "}"}], "]"}], ",", 
              RowBox[{"Inset", "[", 
               RowBox[{
                RowBox[{"Style", "[", 
                 RowBox[{
                  RowBox[{"If", "[", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"Elementos", "\[LeftDoubleBracket]", 
                    RowBox[{
                    "COrden", "\[LeftDoubleBracket]", "i", 
                    "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
                    "\[Equal]", 
                    RowBox[{"(*", 
                    RowBox[{"hostp", "\[LeftDoubleBracket]", 
                    RowBox[{"provx", "\[LeftDoubleBracket]", 
                    RowBox[{"Elementos", "\[LeftDoubleBracket]", 
                    RowBox[{
                    "COrden", "\[LeftDoubleBracket]", "1", 
                    "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
                    "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
                    "*)"}], 
                    RowBox[{"Plus", "@@", 
                    RowBox[{"Pick", "[", 
                    RowBox[{"Elementos", ",", 
                    RowBox[{
                    "host1x", "\[LeftDoubleBracket]", "Elementos", 
                    "\[RightDoubleBracket]"}], ",", "1"}], "]"}]}]}], ",", 
                    
                    Graphics3DBox[
                    GraphicsComplex3DBox[
                    NCache[{{
                    0, 0, (Rational[9, 8] + Rational[3, 8] 5^Rational[1, 2])^
                    Rational[1, 2]}, {
                    0, 0, Rational[-1, 2] (
                    Rational[3, 2] (3 + 5^Rational[1, 2]))^Rational[1, 2]}, {(
                    Rational[1, 8] + Rational[-1, 24] 5^Rational[1, 2])^
                    Rational[1, 2], 
                    Rational[1, 4] (-3 - 5^Rational[1, 2]), (Rational[1, 8] + 
                    Rational[1, 24] 5^Rational[1, 2])^
                    Rational[1, 2]}, {(Rational[1, 8] + 
                    Rational[-1, 24] 5^Rational[1, 2])^Rational[1, 2], 
                    Rational[1, 4] (3 + 5^Rational[1, 2]), (Rational[1, 8] + 
                    Rational[1, 24] 5^Rational[1, 2])^
                    Rational[1, 2]}, {(Rational[1, 8] + 
                    Rational[1, 24] 5^Rational[1, 2])^Rational[1, 2], 
                    Rational[1, 4] (-1 - 5^Rational[1, 2]), 
                    Rational[-1, 2] (Rational[5, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}, {(Rational[1, 8] + 
                    Rational[1, 24] 5^Rational[1, 2])^Rational[1, 2], 
                    Rational[1, 4] (1 + 5^Rational[1, 2]), 
                    Rational[-1, 2] (Rational[5, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}, {(Rational[5, 8] + 
                    Rational[5, 24] 5^Rational[1, 2])^Rational[1, 2], 
                    Rational[1, 4] (-1 - 5^Rational[1, 2]), (Rational[1, 8] + 
                    Rational[1, 24] 5^Rational[1, 2])^
                    Rational[1, 2]}, {(Rational[5, 8] + 
                    Rational[5, 24] 5^Rational[1, 2])^Rational[1, 2], 
                    Rational[1, 4] (1 + 5^Rational[1, 2]), (Rational[1, 8] + 
                    Rational[1, 24] 5^Rational[1, 2])^
                    Rational[
                    1, 2]}, {-(Rational[3, 4] + 
                    Rational[1, 3] 5^Rational[1, 2])^Rational[1, 2], 
                    Rational[-1, 2], (Rational[1, 8] + 
                    Rational[1, 24] 5^Rational[1, 2])^
                    Rational[
                    1, 2]}, {-(Rational[3, 4] + 
                    Rational[1, 3] 5^Rational[1, 2])^Rational[1, 2], Rational[
                    1, 2], (Rational[1, 8] + 
                    Rational[1, 24] 5^Rational[1, 2])^
                    Rational[1, 2]}, {(Rational[3, 4] + 
                    Rational[1, 3] 5^Rational[1, 2])^Rational[1, 2], 
                    Rational[-1, 2], 
                    Rational[-1, 2] (Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}, {(Rational[3, 4] + 
                    Rational[1, 3] 5^Rational[1, 2])^Rational[1, 2], Rational[
                    1, 2], Rational[-1, 2] (
                    Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}, {-(
                    Rational[1, 6] (3 + 5^Rational[1, 2]))^Rational[1, 2], 0, 
                    Rational[-1, 2] (Rational[5, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}, {
                    Rational[-1, 2] (Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2], 
                    Rational[1, 4] (-1 - 5^Rational[1, 2]), (Rational[5, 8] + 
                    Rational[5, 24] 5^Rational[1, 2])^Rational[1, 2]}, {
                    Rational[-1, 2] (Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2], 
                    Rational[1, 4] (1 + 5^Rational[1, 2]), (Rational[5, 8] + 
                    Rational[5, 24] 5^Rational[1, 2])^
                    Rational[1, 2]}, {(Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2], 
                    0, (Rational[5, 8] + Rational[5, 24] 5^Rational[1, 2])^
                    Rational[1, 2]}, {
                    Rational[-1, 2] (Rational[5, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2], Rational[1, 4] (-1 - 5^Rational[1, 2]), 
                    Rational[-1, 2] (Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}, {
                    Rational[-1, 2] (Rational[5, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2], Rational[1, 4] (1 + 5^Rational[1, 2]), 
                    Rational[-1, 2] (Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}, {
                    Root[1 - 36 #^2 + 144 #^4& , 2, 0], 
                    Rational[1, 4] (-3 - 5^Rational[1, 2]), 
                    Rational[-1, 2] (Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}, {
                    Root[1 - 36 #^2 + 144 #^4& , 2, 0], 
                    Rational[1, 4] (3 + 5^Rational[1, 2]), 
                    Rational[-1, 2] (Rational[1, 6] (3 + 5^Rational[1, 2]))^
                    Rational[1, 2]}}, {{0, 0, 1.4012585384440737`}, {
                    0, 0, -1.4012585384440737`}, {
                    0.17841104488654497`, -1.3090169943749475`, 
                    0.46708617948135783`}, {0.17841104488654497`, 
                    1.3090169943749475`, 0.46708617948135783`}, {
                    0.46708617948135783`, -0.8090169943749475, \
-1.0444364486709836`}, {0.46708617948135783`, 
                    0.8090169943749475, -1.0444364486709836`}, {
                    1.0444364486709836`, -0.8090169943749475, 
                    0.46708617948135783`}, {1.0444364486709836`, 
                    0.8090169943749475, 
                    0.46708617948135783`}, {-1.2228474935575286`, -0.5, 
                    0.46708617948135783`}, {-1.2228474935575286`, 0.5, 
                    0.46708617948135783`}, {
                    1.2228474935575286`, -0.5, -0.46708617948135783`}, {
                    1.2228474935575286`, 
                    0.5, -0.46708617948135783`}, {-0.9341723589627157, 
                    0, -1.0444364486709836`}, {-0.46708617948135783`, \
-0.8090169943749475, 1.0444364486709836`}, {-0.46708617948135783`, 
                    0.8090169943749475, 1.0444364486709836`}, {
                    0.9341723589627157, 0, 
                    1.0444364486709836`}, {-1.0444364486709836`, \
-0.8090169943749475, -0.46708617948135783`}, {-1.0444364486709836`, 
                    0.8090169943749475, -0.46708617948135783`}, \
{-0.17841104488654494`, -1.3090169943749475`, -0.46708617948135783`}, \
{-0.17841104488654494`, 1.3090169943749475`, -0.46708617948135783`}}], 
                    Polygon3DBox[{{15, 10, 9, 14, 1}, {2, 6, 12, 11, 5}, {5, 
                    11, 7, 3, 19}, {11, 12, 8, 16, 7}, {12, 6, 20, 4, 8}, {6, 
                    2, 13, 18, 20}, {2, 5, 19, 17, 13}, {4, 20, 18, 10, 15}, {
                    18, 13, 17, 9, 10}, {17, 19, 3, 14, 9}, {3, 7, 16, 1, 
                    14}, {16, 8, 4, 15, 1}}]],
                    Boxed->False,
                    ImageSize->30], ",", 
                    RowBox[{"Elementos", "\[LeftDoubleBracket]", 
                    RowBox[{
                    "COrden", "\[LeftDoubleBracket]", "i", 
                    "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], 
                   "]"}], ",", "8", ",", "Bold", ",", 
                  RowBox[{"FormatType", "\[Rule]", "TraditionalForm"}]}], 
                 "]"}], ",", 
                RowBox[{"Coords", "\[LeftDoubleBracket]", 
                 RowBox[{
                 "COrden", "\[LeftDoubleBracket]", "i", 
                  "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], 
               "]"}]}], "}"}], ",", 
            RowBox[{"{", 
             RowBox[{"i", ",", 
              RowBox[{"Length", "[", "Elementos", "]"}]}], "}"}]}], "]"}]}], 
         ";", "\[IndentingNewLine]", 
         RowBox[{"cont", "=", 
          RowBox[{"cont", "+", "1"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"j", "=", "i"}], ";", "\[IndentingNewLine]", 
         RowBox[{"While", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"j", "\[Equal]", "i"}], "\[Or]", 
            RowBox[{"j", "\[Equal]", "0"}]}], ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"j", "=", 
             RowBox[{"RandomInteger", "[", "nN", "]"}]}], ";"}]}], 
          "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", 
         RowBox[{"ik", "=", 
          RowBox[{"Min", "[", 
           RowBox[{"i", ",", "j"}], "]"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"jk", "=", 
          RowBox[{"Max", "[", 
           RowBox[{"i", ",", "j"}], "]"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"Do", "[", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{
            RowBox[{
             RowBox[{
             "TOrden", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}],
              "=", 
             RowBox[{
             "COrden", "\[LeftDoubleBracket]", "k", 
              "\[RightDoubleBracket]"}]}], ";"}], "\[IndentingNewLine]", ",", 
           RowBox[{"{", 
            RowBox[{"k", ",", "1", ",", 
             RowBox[{"ik", "-", "1"}]}], "}"}]}], "]"}], ";", 
         "\[IndentingNewLine]", 
         RowBox[{"Do", "[", 
          RowBox[{
           RowBox[{
            RowBox[{
             RowBox[{"TOrden", "\[LeftDoubleBracket]", 
              RowBox[{"ik", "+", "k"}], "\[RightDoubleBracket]"}], "=", 
             RowBox[{"COrden", "\[LeftDoubleBracket]", 
              RowBox[{"jk", "-", "k"}], "\[RightDoubleBracket]"}]}], ";"}], 
           "\[IndentingNewLine]", "\[IndentingNewLine]", ",", 
           RowBox[{"{", 
            RowBox[{"k", ",", "0", ",", 
             RowBox[{"jk", "-", "ik"}]}], "}"}]}], "]"}], ";", 
         "\[IndentingNewLine]", 
         RowBox[{"Do", "[", 
          RowBox[{
           RowBox[{
            RowBox[{
             RowBox[{
             "TOrden", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}],
              "=", 
             RowBox[{
             "COrden", "\[LeftDoubleBracket]", "k", 
              "\[RightDoubleBracket]"}]}], ";"}], "\[IndentingNewLine]", ",", 
           RowBox[{"{", 
            RowBox[{"k", ",", 
             RowBox[{"jk", "+", "1"}], ",", "nN"}], "}"}]}], "]"}], ";", 
         "\[IndentingNewLine]", 
         RowBox[{"dist", "=", 
          RowBox[{"Table", "[", 
           RowBox[{"0", ",", 
            RowBox[{"{", 
             RowBox[{"k", ",", "nN"}], "}"}]}], "]"}]}], ";", 
         "\[IndentingNewLine]", 
         RowBox[{"Do", "[", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{
            RowBox[{"IndAct", "=", 
             RowBox[{
             "TOrden", "\[LeftDoubleBracket]", "k", 
              "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
            RowBox[{"ElemAct", "=", 
             RowBox[{
             "Elementos", "\[LeftDoubleBracket]", "IndAct", 
              "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
            RowBox[{"IndSig", "=", 
             RowBox[{"If", "[", 
              RowBox[{
               RowBox[{"k", "<", "nN"}], ",", 
               RowBox[{"TOrden", "\[LeftDoubleBracket]", 
                RowBox[{"k", "+", "1"}], "\[RightDoubleBracket]"}], ",", 
               RowBox[{
               "TOrden", "\[LeftDoubleBracket]", "1", 
                "\[RightDoubleBracket]"}]}], "]"}]}], ";", 
            "\[IndentingNewLine]", 
            RowBox[{"ElemSig", "=", 
             RowBox[{
             "Elementos", "\[LeftDoubleBracket]", "IndSig", 
              "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
            RowBox[{
             RowBox[{
             "dist", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}], 
             "=", 
             RowBox[{"distance", "[", 
              RowBox[{"ElemAct", ",", "ElemSig"}], "]"}]}], ";"}], 
           "\[IndentingNewLine]", ",", 
           RowBox[{"{", 
            RowBox[{"k", ",", "nN"}], "}"}]}], "]"}], ";", 
         "\[IndentingNewLine]", 
         RowBox[{"dp", "=", 
          RowBox[{"Plus", "@@", "dist"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{"dp", "<", "d"}], ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"COrden", "=", "TOrden"}], ";", "\[IndentingNewLine]", 
            RowBox[{"lastchg", "=", 
             RowBox[{"Sign", "[", 
              RowBox[{"dp", "-", "d"}], "]"}]}], ";", "\[IndentingNewLine]", 
            RowBox[{"d", "=", "dp"}], ";", "\[IndentingNewLine]", 
            RowBox[{"cont", "=", 
             RowBox[{"cont", "-", "1"}]}], ";", "\[IndentingNewLine]", 
            RowBox[{"chgcount", "=", 
             RowBox[{"chgcount", "+", "1"}]}], ";", "\[IndentingNewLine]", 
            RowBox[{"If", "[", 
             RowBox[{
              RowBox[{"d", "<", "DIx"}], ",", "\[IndentingNewLine]", 
              RowBox[{
               RowBox[{"KOrden", "=", "TOrden"}], ";", "\[IndentingNewLine]", 
               RowBox[{"DIx", "=", "d"}], ";", "\[IndentingNewLine]", 
               RowBox[{"succ", "=", 
                RowBox[{"succ", "+", "1"}]}], ";"}]}], "\[IndentingNewLine]", 
             "]"}], ";"}], ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"If", "[", 
             RowBox[{
              RowBox[{"d", "\[NotEqual]", "dp"}], ",", 
              RowBox[{"(*", 
               RowBox[{"Para", " ", "evitar", " ", "los", " ", "lazos"}], 
               "*)"}], "\[IndentingNewLine]", 
              RowBox[{
               RowBox[{"x", "=", 
                RowBox[{"RandomReal", "[", 
                 RowBox[{"{", 
                  RowBox[{"0", ",", "1"}], "}"}], "]"}]}], ";", 
               "\[IndentingNewLine]", 
               RowBox[{"If", "[", 
                RowBox[{
                 RowBox[{"x", "<", 
                  SuperscriptBox["\[ExponentialE]", 
                   FractionBox[
                    RowBox[{"d", "-", "dp"}], "T"]]}], 
                 RowBox[{"(*", 
                  RowBox[{"\[And]", 
                   RowBox[{"(", 
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{"dp", "\[LessEqual]", 
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{"1", "+", 
                    FractionBox["T", "100"]}], ")"}], "d"}]}], "\[And]", 
                    RowBox[{"lastchg", "\[Equal]", 
                    RowBox[{"-", "1"}]}]}], ")"}], "\[Or]", 
                    RowBox[{"dp", "\[LessEqual]", "DI"}]}]}]}], "*)"}], ",", 
                 "\[IndentingNewLine]", 
                 RowBox[{
                  RowBox[{"COrden", "=", "TOrden"}], ";", 
                  "\[IndentingNewLine]", 
                  RowBox[{"lastchg", "=", 
                   RowBox[{"Sign", "[", 
                    RowBox[{"dp", "-", "d"}], "]"}]}], ";", 
                  "\[IndentingNewLine]", 
                  RowBox[{"d", "=", "dp"}], ";", "\[IndentingNewLine]", 
                  RowBox[{"cont", "=", 
                   RowBox[{"cont", "-", "1"}]}], ";", "\[IndentingNewLine]", 
                  RowBox[{"chgcount", "=", 
                   RowBox[{"chgcount", "+", "1"}]}], ";"}]}], 
                "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", 
             "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", 
         "\[IndentingNewLine]", 
         RowBox[{"i", "=", 
          RowBox[{"i", "+", "1"}]}], ";", "\[IndentingNewLine]", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{"i", ">", "nN"}], ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"i", "=", "1"}], ";", "\[IndentingNewLine]", " ", 
            RowBox[{"T", " ", "=", " ", 
             RowBox[{"T", 
              FractionBox["999", "1000"]}]}], ";", "\[IndentingNewLine]", 
            RowBox[{"If", "[", 
             RowBox[{
              RowBox[{"succ", "\[Equal]", "0"}], ",", 
              RowBox[{
               RowBox[{"Break", "[", "]"}], ";"}]}], "]"}], ";"}]}], 
          "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{"chgcount", "\[Equal]", "0"}], ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"countofZero", "=", 
             RowBox[{"countofZero", "+", "1"}]}], ";"}], ",", 
           "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"countofZero", "=", "0"}], ";"}]}], "\[IndentingNewLine]",
           "]"}], ";", "\[IndentingNewLine]", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"cont", ">", 
             RowBox[{"500", "*", "nN"}]}], "\[Or]", 
            RowBox[{"countofZero", ">", "1000"}], "\[Or]", 
            RowBox[{"T", "<", 
             FractionBox["1", "10000"]}]}], ",", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"StillDo", "=", "False"}], ";"}]}], "\[IndentingNewLine]",
           "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"If", "[", 
       RowBox[{
        RowBox[{"d", ">", "DI"}], ",", "\[IndentingNewLine]", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{"DIx", "<", "DI"}], ",", "\[IndentingNewLine]", "KOrden", 
          ",", "\[IndentingNewLine]", "SOrden"}], "\[IndentingNewLine]", 
         "]"}], ",", "\[IndentingNewLine]", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{"DIx", "<", "d"}], ",", "\[IndentingNewLine]", "KOrden", 
          ",", "\[IndentingNewLine]", "COrden"}], "\[IndentingNewLine]", 
         "]"}]}], "\[IndentingNewLine]", "]"}]}]}], "\[IndentingNewLine]", 
    "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.6321452744047585`*^9, 3.6321452759209104`*^9}, {
   3.63214582782146*^9, 3.6321458287574663`*^9}, 3.6326560243578453`*^9}]
}, Closed]],

Cell[CellGroupData[{

Cell["Ejecuci\[OAcute]n de Algoritmo a nivel provincial", "Subsection",
 CellChangeTimes->{{3.6322230129868717`*^9, 3.6322230219000845`*^9}, {
  3.632223089520494*^9, 3.6322230939520984`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Print", "[", 
   RowBox[{"Style", "[", 
    RowBox[{"\"\<A NIVEL PROVINCIAL\>\"", ",", "Underlined", ",", "16", ",", 
     RowBox[{"Background", "\[Rule]", "Blue"}], ",", "White", ",", "Bold"}], 
    "]"}], "]"}], ";"}]], "Input",
 CellChangeTimes->{{3.6321459340613456`*^9, 3.6321459371345654`*^9}, {
   3.632236701259224*^9, 3.6322367153886366`*^9}, 3.6322414403571897`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"(*", 
    RowBox[{
     RowBox[{
     "Cada", " ", "provincia", " ", "puede", " ", "tener", " ", "un", " ", 
      "anillo", " ", "de", " ", "Remotas"}], "-", "Cabeceras"}], "*)"}],
   FontColor->RGBColor[0, 0, 1]], "\[IndentingNewLine]", 
  StyleBox[
   RowBox[{"(*", 
    RowBox[{"Inicializacion", " ", "de", " ", "variables"}], "*)"}],
   FontColor->RGBColor[0, 0, 1]], "\n", 
  RowBox[{
   RowBox[{
    RowBox[{"ProvConAnillo", "=", 
     RowBox[{"Select", "[", 
      RowBox[{
       RowBox[{"Range", "[", "na", "]"}], ",", 
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"Table", "[", 
           RowBox[{
            RowBox[{"Plus", "@@", 
             RowBox[{"Pick", "[", 
              RowBox[{"esAnillopx", " ", ",", "provax", ",", "ia"}], "]"}]}], 
            ",", 
            RowBox[{"{", 
             RowBox[{"ia", ",", "na"}], "}"}]}], "]"}], 
          "\[LeftDoubleBracket]", "#", "\[RightDoubleBracket]"}], ">", "2"}], 
        "&"}]}], "]"}]}], ";"}], "\n", 
   RowBox[{
    RowBox[{"ElemAnillo", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Select", "[", 
        RowBox[{
         RowBox[{"Range", "[", "nx", "]"}], ",", 
         RowBox[{
          RowBox[{
           RowBox[{
            RowBox[{
            "provax", "\[LeftDoubleBracket]", "#", "\[RightDoubleBracket]"}], 
            "\[Equal]", 
            RowBox[{
            "ProvConAnillo", "\[LeftDoubleBracket]", "iap", 
             "\[RightDoubleBracket]"}]}], "\[And]", 
           RowBox[{
            RowBox[{
            "esAnillopx", "\[LeftDoubleBracket]", "#", 
             "\[RightDoubleBracket]"}], "\[Equal]", "1"}]}], "&"}]}], "]"}], 
       ",", 
       RowBox[{"{", 
        RowBox[{"iap", ",", 
         RowBox[{"Length", "[", "ProvConAnillo", "]"}]}], "}"}]}], "]"}]}], 
    ";"}], "\n", 
   RowBox[{
    RowBox[{"RepresElemAnillo", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"Abs", "[", 
          RowBox[{"Min", "[", 
           RowBox[{
            RowBox[{"(", 
             RowBox[{"1", "-", 
              RowBox[{"2", 
               RowBox[{"host1x", "\[LeftDoubleBracket]", 
                RowBox[{"Select", "[", 
                 RowBox[{
                  RowBox[{
                  "ElemAnillo", "\[LeftDoubleBracket]", "i", 
                   "\[RightDoubleBracket]"}], ",", 
                  RowBox[{
                   RowBox[{
                    RowBox[{"Coord", "[", "#", "]"}], "\[Equal]", 
                    RowBox[{"Coord", "[", 
                    RowBox[{"ElemAnillo", "\[LeftDoubleBracket]", 
                    RowBox[{"i", ",", "j"}], "\[RightDoubleBracket]"}], 
                    "]"}]}], "&"}]}], "]"}], "\[RightDoubleBracket]"}]}]}], 
             " ", ")"}], 
            RowBox[{"Select", "[", 
             RowBox[{
              RowBox[{
              "ElemAnillo", "\[LeftDoubleBracket]", "i", 
               "\[RightDoubleBracket]"}], ",", 
              RowBox[{
               RowBox[{
                RowBox[{"Coord", "[", "#", "]"}], "\[Equal]", 
                RowBox[{"Coord", "[", 
                 RowBox[{"ElemAnillo", "\[LeftDoubleBracket]", 
                  RowBox[{"i", ",", "j"}], "\[RightDoubleBracket]"}], "]"}]}],
                "&"}]}], "]"}]}], "]"}], "]"}], ",", 
         RowBox[{"{", 
          RowBox[{"j", ",", 
           RowBox[{"Length", "[", 
            RowBox[{
            "ElemAnillo", "\[LeftDoubleBracket]", "i", 
             "\[RightDoubleBracket]"}], "]"}]}], "}"}]}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", 
         RowBox[{"Length", "[", "ElemAnillo", "]"}]}], "}"}]}], "]"}]}], 
    ";"}], "\n", 
   RowBox[{
    RowBox[{"RepresentanteAnillox", "=", 
     RowBox[{"Range", "[", "nx", "]"}]}], ";"}], " ", 
   "\[IndentingNewLine]"}]}]], "Input",
 CellChangeTimes->{{3.6321459340613456`*^9, 3.6321459371345654`*^9}, {
  3.632236701259224*^9, 3.6322367153886366`*^9}, {3.6322414403571897`*^9, 
  3.632241449701124*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "A", " ", "nivel", " ", "de", " ", "transmisi\[OAcute]n", " ", "es", " ", 
    "quien", " ", "finalmente", " ", "representar\[AAcute]", " ", "al", " ", 
    "nodo", " ", "del", " ", "\[IAcute]ndice"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"Do", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"MemberQ", "[", 
          RowBox[{
           RowBox[{"Flatten", "[", "ElemAnillo", "]"}], ",", "ix"}], "]"}], 
         ",", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{"PosAux", "=", 
           RowBox[{"Flatten", "[", 
            RowBox[{"Position", "[", 
             RowBox[{"ElemAnillo", ",", "ix"}], "]"}], "]"}]}], ";", 
          "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{
           "RepresentanteAnillox", "\[LeftDoubleBracket]", "ix", 
            "\[RightDoubleBracket]"}], "=", 
           RowBox[{"RepresElemAnillo", "\[LeftDoubleBracket]", 
            RowBox[{
             RowBox[{
             "PosAux", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}],
              ",", 
             RowBox[{
             "PosAux", "\[LeftDoubleBracket]", "2", 
              "\[RightDoubleBracket]"}]}], "\[RightDoubleBracket]"}]}], 
          ";"}]}], "\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]",
       ",", 
      RowBox[{"{", 
       RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ElemAnilloDepurado", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Sort", "[", 
        RowBox[{"DeleteDuplicates", "[", 
         RowBox[{
         "RepresElemAnillo", "\[LeftDoubleBracket]", "i", 
          "\[RightDoubleBracket]"}], "]"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", 
         RowBox[{"Length", "[", "RepresElemAnillo", "]"}]}], "}"}]}], "]"}]}],
     ";"}], "\n", 
   RowBox[{
    RowBox[{"CabAnillosp", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Max", "[", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"host1x", "\[LeftDoubleBracket]", 
            RowBox[{"ElemAnilloDepurado", "\[LeftDoubleBracket]", 
             RowBox[{"i", ",", "j"}], "\[RightDoubleBracket]"}], 
            "\[RightDoubleBracket]"}], 
           RowBox[{"ElemAnilloDepurado", "\[LeftDoubleBracket]", 
            RowBox[{"i", ",", "j"}], "\[RightDoubleBracket]"}]}], ",", 
          RowBox[{"{", 
           RowBox[{"j", ",", 
            RowBox[{"Length", "[", 
             RowBox[{
             "ElemAnilloDepurado", "\[LeftDoubleBracket]", "i", 
              "\[RightDoubleBracket]"}], "]"}]}], "}"}]}], "]"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", 
         RowBox[{"Length", "[", "ElemAnilloDepurado", "]"}]}], "}"}]}], 
      "]"}]}], ";"}]}]}]], "Input",
 CellChangeTimes->{{3.6321459340613456`*^9, 3.6321459371345654`*^9}, {
  3.632236701259224*^9, 3.6322367153886366`*^9}, {3.6322414403571897`*^9, 
  3.6322414591870728`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"nap", "=", 
    RowBox[{"Length", "[", "CabAnillosp", "]"}]}], ";"}], " ", 
  RowBox[{"(*", 
   RowBox[{"Anillos", " ", "Verdaderos"}], "*)"}]}], "\n", 
 RowBox[{
  RowBox[{"TamAnilloa", "=", 
   RowBox[{"Table", "[", 
    RowBox[{"0", ",", 
     RowBox[{"{", 
      RowBox[{"ia", ",", "na"}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SumaCabecerax", "=", "zerox"}], ";"}]}], "Input",
 CellChangeTimes->{{3.6321459340613456`*^9, 3.6321459371345654`*^9}, {
  3.632236701259224*^9, 3.6322367153886366`*^9}, {3.6322414403571897`*^9, 
  3.6322414628664403`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"If", "[", 
   RowBox[{
    RowBox[{"FileExistsQ", "[", "\"\<TAMANILLOSP.CSV\>\"", "]"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"OpenRead", "[", "\"\<TAMANILLOSP.CSV\>\"", "]"}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"GuardarDistAnillos", "=", 
      RowBox[{"Import", "[", 
       RowBox[{"\"\<TAMANILLOSP.CSV\>\"", ",", "\"\<CSV\>\""}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"Close", "[", "\"\<TAMANILLOSP.CSV\>\"", "]"}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"Print", "[", "\"\<Importando\>\"", "]"}], ";"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"GuardarDistAnillos", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Join", "[", 
         RowBox[{
          RowBox[{"{", "\[Infinity]", "}"}], ",", 
          RowBox[{"Table", "[", 
           RowBox[{"i", ",", 
            RowBox[{"{", 
             RowBox[{"i", ",", 
              RowBox[{"Length", "[", "\[IndentingNewLine]", 
               RowBox[{"If", "[", 
                RowBox[{
                 RowBox[{"MemberQ", "[", 
                  RowBox[{"ProvConAnillo", ",", "ia"}], "]"}], ",", 
                 RowBox[{"ElemAnilloDepurado", "\[LeftDoubleBracket]", 
                  RowBox[{"Plus", "@@", 
                   RowBox[{"Flatten", "[", 
                    RowBox[{"Position", "[", 
                    RowBox[{"ProvConAnillo", ",", "ia"}], "]"}], "]"}]}], 
                  "\[RightDoubleBracket]"}], ",", 
                 RowBox[{"{", "}"}]}], "]"}], "]"}]}], "}"}]}], "]"}]}], 
         "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ia", ",", "na"}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"Print", "[", "\"\<Creando\>\"", "]"}], ";"}]}], 
   "\[IndentingNewLine]", "]"}], ";"}]], "Input",
 CellChangeTimes->{{3.6321459340613456`*^9, 3.6321459371345654`*^9}, {
  3.632236701259224*^9, 3.6322367153886366`*^9}, {3.6322414403571897`*^9, 
  3.632241466194773*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Do", "[", "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{"Inicializa", " ", "Conexiones"}], "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"ElementosAnillo", "=", 
      RowBox[{
      "ElemAnilloDepurado", "\[LeftDoubleBracket]", "iap", 
       "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"ActOrden", "=", 
      RowBox[{"Delete", "[", 
       RowBox[{
        RowBox[{"GuardarDistAnillos", "\[LeftDoubleBracket]", 
         RowBox[{
         "ProvConAnillo", "\[LeftDoubleBracket]", "iap", 
          "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", "1"}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"Print", "[", 
      RowBox[{
      "\"\<Vendedor Viajero \>\"", ",", "iap", ",", "\"\< de \>\"", ",", 
       "nap"}], "]"}], ";", "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"Length", "[", "ElementosAnillo", "]"}], ">", "2"}], ",", 
       "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"Length", "[", "ElementosAnillo", "]"}], ">", "3"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{"NuevoOrden", "=", 
            RowBox[{"VendedorViajero", "[", 
             RowBox[{"ElementosAnillo", ",", 
              RowBox[{"GuardarDistAnillos", "\[LeftDoubleBracket]", 
               RowBox[{
                RowBox[{
                "ProvConAnillo", "\[LeftDoubleBracket]", "iap", 
                 "\[RightDoubleBracket]"}], ",", "1"}], 
               "\[RightDoubleBracket]"}], ",", "ActOrden"}], "]"}]}], ";"}], 
          ",", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{"NuevoOrden", "=", "ActOrden"}], ";"}]}], 
         "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", 
        RowBox[{"NuevaConexion", "=", 
         RowBox[{"Table", "[", 
          RowBox[{"0", ",", 
           RowBox[{"{", 
            RowBox[{"k", ",", 
             RowBox[{"Length", "[", "NuevoOrden", "]"}]}], "}"}]}], "]"}]}], 
        ";", "\[IndentingNewLine]", 
        RowBox[{"Do", "[", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"k", "<", 
              RowBox[{"Length", "[", "NuevoOrden", "]"}]}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{"NuevaConexion", "\[LeftDoubleBracket]", 
                RowBox[{
                "NuevoOrden", "\[LeftDoubleBracket]", "k", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
               RowBox[{"ElementosAnillo", "\[LeftDoubleBracket]", 
                RowBox[{"NuevoOrden", "\[LeftDoubleBracket]", 
                 RowBox[{"k", "+", "1"}], "\[RightDoubleBracket]"}], 
                "\[RightDoubleBracket]"}]}], ";"}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{"NuevaConexion", "\[LeftDoubleBracket]", 
                RowBox[{
                "NuevoOrden", "\[LeftDoubleBracket]", "k", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
               RowBox[{"ElementosAnillo", "\[LeftDoubleBracket]", 
                RowBox[{
                "NuevoOrden", "\[LeftDoubleBracket]", "1", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], 
              ";"}]}], "\[IndentingNewLine]", "]"}], ";"}], 
          "\[IndentingNewLine]", ",", 
          RowBox[{"{", 
           RowBox[{"k", ",", 
            RowBox[{"Length", "[", "NuevoOrden", "]"}]}], "}"}]}], "]"}], ";",
         "\[IndentingNewLine]", 
        RowBox[{"AuxDistAnillo", "=", "0"}], ";", "\[IndentingNewLine]", 
        RowBox[{"Do", "[", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{
           RowBox[{
            RowBox[{"Conexion", "\[LeftDoubleBracket]", 
             RowBox[{
             "ElementosAnillo", "\[LeftDoubleBracket]", "i", 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
            RowBox[{
            "NuevaConexion", "\[LeftDoubleBracket]", "i", 
             "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"TamAnilloa", "\[LeftDoubleBracket]", 
             RowBox[{
             "ProvConAnillo", "\[LeftDoubleBracket]", "iap", 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
            RowBox[{
             RowBox[{"TamAnilloa", "\[LeftDoubleBracket]", 
              RowBox[{
              "ProvConAnillo", "\[LeftDoubleBracket]", "iap", 
               "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "+", 
             RowBox[{"distance", "[", 
              RowBox[{
               RowBox[{
               "ElementosAnillo", "\[LeftDoubleBracket]", "i", 
                "\[RightDoubleBracket]"}], ",", 
               RowBox[{
               "NuevaConexion", "\[LeftDoubleBracket]", "i", 
                "\[RightDoubleBracket]"}]}], "]"}]}]}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"AuxDistAnillo", "=", 
            RowBox[{"AuxDistAnillo", "+", 
             RowBox[{"Abs", "[", 
              RowBox[{"distance", "[", 
               RowBox[{
                RowBox[{
                "ElementosAnillo", "\[LeftDoubleBracket]", "i", 
                 "\[RightDoubleBracket]"}], ",", 
                RowBox[{
                "NuevaConexion", "\[LeftDoubleBracket]", "i", 
                 "\[RightDoubleBracket]"}]}], "]"}], "]"}]}]}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"i", "\[Equal]", 
              RowBox[{"Length", "[", "ElementosAnillo", "]"}]}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{"SumaCabecerax", "\[LeftDoubleBracket]", 
                RowBox[{
                "ElementosAnillo", "\[LeftDoubleBracket]", "i", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
               FractionBox[
                RowBox[{"Abs", "[", 
                 RowBox[{"distance", "[", 
                  RowBox[{
                   RowBox[{
                   "ElementosAnillo", "\[LeftDoubleBracket]", "i", 
                    "\[RightDoubleBracket]"}], ",", 
                   RowBox[{
                   "NuevaConexion", "\[LeftDoubleBracket]", "i", 
                    "\[RightDoubleBracket]"}]}], "]"}], "]"}], 
                RowBox[{"factorNoLinealx", "\[LeftDoubleBracket]", 
                 RowBox[{
                 "ElementosAnillo", "\[LeftDoubleBracket]", "i", 
                  "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]]}], 
              ";"}]}], "\[IndentingNewLine]", "]"}], ";"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{"i", ",", 
            RowBox[{"Length", "[", "ElementosAnillo", "]"}]}], "}"}]}], "]"}],
         ";", "\[IndentingNewLine]", 
        RowBox[{"Do", "[", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"\[Not]", 
              RowBox[{"MemberQ", "[", 
               RowBox[{"ElementosAnillo", ",", 
                RowBox[{"ElemAnillo", "\[LeftDoubleBracket]", 
                 RowBox[{"iap", ",", "j"}], "\[RightDoubleBracket]"}]}], 
               "]"}]}], ",", "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{"Conexion", "\[LeftDoubleBracket]", 
                RowBox[{"ElemAnillo", "\[LeftDoubleBracket]", 
                 RowBox[{"iap", ",", "j"}], "\[RightDoubleBracket]"}], 
                "\[RightDoubleBracket]"}], "=", 
               RowBox[{"Conexion", "\[LeftDoubleBracket]", 
                RowBox[{"RepresElemAnillo", "\[LeftDoubleBracket]", 
                 RowBox[{"iap", ",", "j"}], "\[RightDoubleBracket]"}], 
                "\[RightDoubleBracket]"}]}], ";"}]}], "\[IndentingNewLine]", 
            "]"}], ";"}], "\[IndentingNewLine]", ",", 
          RowBox[{"{", 
           RowBox[{"j", ",", 
            RowBox[{"Length", "[", 
             RowBox[{
             "ElemAnillo", "\[LeftDoubleBracket]", "iap", 
              "\[RightDoubleBracket]"}], "]"}]}], "}"}]}], "]"}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"GuardarDistAnillos", "\[LeftDoubleBracket]", 
          RowBox[{
          "ProvConAnillo", "\[LeftDoubleBracket]", "iap", 
           "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
         RowBox[{"Join", "[", 
          RowBox[{
           RowBox[{"{", "AuxDistAnillo", "}"}], ",", "NuevoOrden"}], "]"}]}], 
        ";", "\[IndentingNewLine]", 
        RowBox[{"Print", "[", 
         RowBox[{"\"\<Anillo a Guardar:\>\"", ",", 
          RowBox[{"GuardarDistAnillos", "\[LeftDoubleBracket]", 
           RowBox[{
           "ProvConAnillo", "\[LeftDoubleBracket]", "iap", 
            "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], "]"}], 
        ";", "\[IndentingNewLine]", 
        RowBox[{"PlotAnilloProva", "[", 
         RowBox[{"provax", "\[LeftDoubleBracket]", 
          RowBox[{
          "CabAnillosp", "\[LeftDoubleBracket]", "iap", 
           "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "]"}], 
        ";"}]}], "\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]", 
    ",", 
    RowBox[{"{", 
     RowBox[{"iap", ",", "nap"}], "}"}]}], "]"}], ";"}]], "Input",
 CellChangeTimes->{{3.6321459340613456`*^9, 3.6321459371345654`*^9}, {
  3.632236701259224*^9, 3.6322367153886366`*^9}, {3.6322414403571897`*^9, 
  3.632241476482802*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"OpenWrite", "[", "\"\<TAMANILLOSP.CSV\>\"", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Export", "[", 
   RowBox[{
   "\"\<TAMANILLOSP.CSV\>\"", ",", "GuardarDistAnillos", ",", "\"\<CSV\>\""}],
    "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Close", "[", "\"\<TAMANILLOSP.CSV\>\"", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.6321459340613456`*^9, 3.6321459371345654`*^9}, {
  3.632236701259224*^9, 3.6322367153886366`*^9}, {3.6322414403571897`*^9, 
  3.632241476482802*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Ejecuci\[OAcute]n de algoritmo a nivel departamental", "Subsection",
 CellChangeTimes->{{3.632223066958689*^9, 3.6322230795659475`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"Print", "[", 
    RowBox[{"Style", "[", 
     RowBox[{
     "\"\<A NIVEL DEPARTAMENTAL\>\"", ",", "Underlined", ",", "16", ",", 
      RowBox[{"Background", "\[Rule]", "Blue"}], ",", "White", ",", "Bold"}], 
     "]"}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  StyleBox[
   RowBox[{"(*", 
    RowBox[{"Inicializacion", " ", "de", " ", "variables"}], "*)"}],
   FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", 
 StyleBox[
  RowBox[{
   RowBox[{"Print", "[", "\"\<TamAnillod\>\"", "]"}], ";"}],
  FontColor->RGBColor[0, 0, 1]], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"DeptConAnillo", "=", 
   RowBox[{"Select", "[", 
    RowBox[{
     RowBox[{"Range", "[", "nd", "]"}], ",", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Plus", "@@", 
           RowBox[{"Pick", "[", 
            RowBox[{
             RowBox[{"Table", "[", 
              RowBox[{
               RowBox[{
               "esAnillodx", "\[LeftDoubleBracket]", "ix", 
                "\[RightDoubleBracket]"}], ",", 
               RowBox[{"{", 
                RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ",", "deptx", ",", 
             "id"}], "]"}]}], ",", 
          RowBox[{"{", 
           RowBox[{"id", ",", "nd"}], "}"}]}], "]"}], "\[LeftDoubleBracket]", 
        "#", "\[RightDoubleBracket]"}], ">", "2"}], "&"}]}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"ElemAnillod", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"Select", "[", 
      RowBox[{
       RowBox[{"Range", "[", "nx", "]"}], ",", 
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{
          "deptx", "\[LeftDoubleBracket]", "#", "\[RightDoubleBracket]"}], 
          "\[Equal]", 
          RowBox[{
          "DeptConAnillo", "\[LeftDoubleBracket]", "iad", 
           "\[RightDoubleBracket]"}]}], "\[And]", 
         RowBox[{
          RowBox[{
          "esAnillodx", "\[LeftDoubleBracket]", "#", 
           "\[RightDoubleBracket]"}], "\[Equal]", "1"}]}], "&"}]}], "]"}], 
     ",", 
     RowBox[{"{", 
      RowBox[{"iad", ",", 
       RowBox[{"Length", "[", "DeptConAnillo", "]"}]}], "}"}]}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"RepresElemAnillod", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"Abs", "[", 
        RowBox[{"Min", "[", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{"1", "-", 
            RowBox[{"2", 
             RowBox[{"tandem1x", "\[LeftDoubleBracket]", 
              RowBox[{"Select", "[", 
               RowBox[{
                RowBox[{
                "ElemAnillod", "\[LeftDoubleBracket]", "i", 
                 "\[RightDoubleBracket]"}], ",", 
                RowBox[{
                 RowBox[{
                  RowBox[{"Coord", "[", "#", "]"}], "\[Equal]", 
                  RowBox[{"Coord", "[", 
                   RowBox[{"ElemAnillod", "\[LeftDoubleBracket]", 
                    RowBox[{"i", ",", "j"}], "\[RightDoubleBracket]"}], 
                   "]"}]}], "&"}]}], "]"}], "\[RightDoubleBracket]"}]}]}], 
           " ", ")"}], 
          RowBox[{"Select", "[", 
           RowBox[{
            RowBox[{
            "ElemAnillod", "\[LeftDoubleBracket]", "i", 
             "\[RightDoubleBracket]"}], ",", 
            RowBox[{
             RowBox[{
              RowBox[{"Coord", "[", "#", "]"}], "\[Equal]", 
              RowBox[{"Coord", "[", 
               RowBox[{"ElemAnillod", "\[LeftDoubleBracket]", 
                RowBox[{"i", ",", "j"}], "\[RightDoubleBracket]"}], "]"}]}], 
             "&"}]}], "]"}]}], "]"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"j", ",", 
         RowBox[{"Length", "[", 
          RowBox[{
          "ElemAnillod", "\[LeftDoubleBracket]", "i", 
           "\[RightDoubleBracket]"}], "]"}]}], "}"}]}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{"i", ",", 
       RowBox[{"Length", "[", "ElemAnillod", "]"}]}], "}"}]}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"RepresentanteAnillodx", "=", 
    RowBox[{
     RowBox[{"Range", "[", "nx", "]"}], " ", "host1x"}]}], ";"}], " ", 
  RowBox[{"(*", 
   RowBox[{
   "A", " ", "nivel", " ", "de", " ", "transmisi\[OAcute]n", " ", "es", " ", 
    "quien", " ", "finalmente", " ", "representar\[AAcute]", " ", "al", " ", 
    "nodo", " ", "del", " ", "\[IAcute]ndice"}], 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Do", "[", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"MemberQ", "[", 
        RowBox[{
         RowBox[{"Flatten", "[", "ElemAnillod", "]"}], ",", "ix"}], "]"}], 
       ",", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"PosAux", "=", 
         RowBox[{"Flatten", "[", 
          RowBox[{"Position", "[", 
           RowBox[{"ElemAnillod", ",", "ix"}], "]"}], "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{
         "RepresentanteAnillodx", "\[LeftDoubleBracket]", "ix", 
          "\[RightDoubleBracket]"}], "=", 
         RowBox[{"RepresElemAnillod", "\[LeftDoubleBracket]", 
          RowBox[{
           RowBox[{
           "PosAux", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], 
           ",", 
           RowBox[{
           "PosAux", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}],
           "\[RightDoubleBracket]"}]}], ";"}]}], "\[IndentingNewLine]", "]"}],
      ";"}], "\[IndentingNewLine]", ",", 
    RowBox[{"{", 
     RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ElemAnilloDepuradod", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"Sort", "[", 
      RowBox[{"DeleteDuplicates", "[", 
       RowBox[{
       "RepresElemAnillod", "\[LeftDoubleBracket]", "i", 
        "\[RightDoubleBracket]"}], "]"}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{"i", ",", 
       RowBox[{"Length", "[", "RepresElemAnillod", "]"}]}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nad", "=", 
   RowBox[{"Length", "[", "DeptConAnillo", "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"TandAnillosd", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"tandemd", "\[LeftDoubleBracket]", 
      RowBox[{
      "DeptConAnillo", "\[LeftDoubleBracket]", "iad", 
       "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", 
     RowBox[{"{", 
      RowBox[{"iad", ",", "nad"}], "}"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"TamAnillod", "=", "zerod"}], ";"}], "\n", 
 RowBox[{
  RowBox[{"If", "[", 
   RowBox[{
    RowBox[{"FileExistsQ", "[", "\"\<TAMANILLOSD.CSV\>\"", "]"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"OpenRead", "[", "\"\<TAMANILLOSD.CSV\>\"", "]"}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"GuardarDistAnillosd", "=", 
      RowBox[{"Import", "[", 
       RowBox[{"\"\<TAMANILLOSD.CSV\>\"", ",", "\"\<CSV\>\""}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"Close", "[", "\"\<TAMANILLOSD.CSV\>\"", "]"}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"Print", "[", "\"\<Importando\>\"", "]"}], ";"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"GuardarDistAnillosd", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Join", "[", 
         RowBox[{
          RowBox[{"{", "\[Infinity]", "}"}], ",", 
          RowBox[{"Table", "[", 
           RowBox[{"i", ",", 
            RowBox[{"{", 
             RowBox[{"i", ",", 
              RowBox[{"Length", "[", "\[IndentingNewLine]", 
               RowBox[{"If", "[", 
                RowBox[{
                 RowBox[{"MemberQ", "[", 
                  RowBox[{"DeptConAnillo", ",", "id"}], "]"}], ",", 
                 RowBox[{"ElemAnilloDepuradod", "\[LeftDoubleBracket]", 
                  RowBox[{"Plus", "@@", 
                   RowBox[{"Flatten", "[", 
                    RowBox[{"Position", "[", 
                    RowBox[{"DeptConAnillo", ",", "id"}], "]"}], "]"}]}], 
                  "\[RightDoubleBracket]"}], ",", 
                 RowBox[{"{", "}"}]}], "]"}], "]"}]}], "}"}]}], "]"}]}], 
         "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"id", ",", "nd"}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"Print", "[", "\"\<Creando\>\"", "]"}], ";"}]}], 
   "\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Do", "[", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"ElementosAnillod", "=", 
      RowBox[{
      "ElemAnilloDepuradod", "\[LeftDoubleBracket]", "iad", 
       "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"ActOrden", "=", 
      RowBox[{"Delete", "[", 
       RowBox[{
        RowBox[{"GuardarDistAnillosd", "\[LeftDoubleBracket]", 
         RowBox[{
         "DeptConAnillo", "\[LeftDoubleBracket]", "iad", 
          "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", "1"}], 
       "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"NuevoOrden", "=", 
      RowBox[{"VendedorViajero", "[", 
       RowBox[{"ElementosAnillod", ",", 
        RowBox[{"GuardarDistAnillosd", "\[LeftDoubleBracket]", 
         RowBox[{
          RowBox[{
          "DeptConAnillo", "\[LeftDoubleBracket]", "iad", 
           "\[RightDoubleBracket]"}], ",", "1"}], "\[RightDoubleBracket]"}], 
        ",", "ActOrden"}], "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"NuevaConexion", "=", 
      RowBox[{"Table", "[", 
       RowBox[{"0", ",", 
        RowBox[{"{", 
         RowBox[{"k", ",", 
          RowBox[{"Length", "[", "NuevoOrden", "]"}]}], "}"}]}], "]"}]}], ";",
      "\[IndentingNewLine]", 
     RowBox[{"Do", "[", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{"k", "<", 
           RowBox[{"Length", "[", "NuevoOrden", "]"}]}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{
            RowBox[{"NuevaConexion", "\[LeftDoubleBracket]", 
             RowBox[{
             "NuevoOrden", "\[LeftDoubleBracket]", "k", 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
            RowBox[{"ElementosAnillod", "\[LeftDoubleBracket]", 
             RowBox[{"NuevoOrden", "\[LeftDoubleBracket]", 
              RowBox[{"k", "+", "1"}], "\[RightDoubleBracket]"}], 
             "\[RightDoubleBracket]"}]}], ";"}], ",", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{
            RowBox[{"NuevaConexion", "\[LeftDoubleBracket]", 
             RowBox[{
             "NuevoOrden", "\[LeftDoubleBracket]", "k", 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
            RowBox[{"ElementosAnillod", "\[LeftDoubleBracket]", 
             RowBox[{
             "NuevoOrden", "\[LeftDoubleBracket]", "1", 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], ";"}]}],
          "\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]", ",", 
       RowBox[{"{", 
        RowBox[{"k", ",", 
         RowBox[{"Length", "[", "NuevoOrden", "]"}]}], "}"}]}], "]"}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"AuxDistAnillo", "=", "0"}], ";", "\[IndentingNewLine]", 
     RowBox[{"Do", "[", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"ConexionProv", "\[LeftDoubleBracket]", 
          RowBox[{"provx", "\[LeftDoubleBracket]", 
           RowBox[{
           "ElementosAnillod", "\[LeftDoubleBracket]", "i", 
            "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
          "\[RightDoubleBracket]"}], "=", 
         RowBox[{"provx", "\[LeftDoubleBracket]", 
          RowBox[{
          "NuevaConexion", "\[LeftDoubleBracket]", "i", 
           "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{"TamAnillod", "\[LeftDoubleBracket]", 
          RowBox[{
          "DeptConAnillo", "\[LeftDoubleBracket]", "iad", 
           "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
         RowBox[{
          RowBox[{"TamAnillod", "\[LeftDoubleBracket]", 
           RowBox[{
           "DeptConAnillo", "\[LeftDoubleBracket]", "iad", 
            "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "+", 
          FractionBox[
           RowBox[{"distance", "[", 
            RowBox[{
             RowBox[{
             "ElementosAnillod", "\[LeftDoubleBracket]", "i", 
              "\[RightDoubleBracket]"}], ",", 
             RowBox[{
             "NuevaConexion", "\[LeftDoubleBracket]", "i", 
              "\[RightDoubleBracket]"}]}], "]"}], 
           RowBox[{"factorNoLinealx", "\[LeftDoubleBracket]", 
            RowBox[{
            "ElementosAnillod", "\[LeftDoubleBracket]", "i", 
             "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]]}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"AuxDistAnillo", "=", 
         RowBox[{"AuxDistAnillo", "+", 
          RowBox[{"Abs", "[", 
           RowBox[{"distance", "[", 
            RowBox[{
             RowBox[{
             "ElementosAnillod", "\[LeftDoubleBracket]", "i", 
              "\[RightDoubleBracket]"}], ",", 
             RowBox[{
             "NuevaConexion", "\[LeftDoubleBracket]", "i", 
              "\[RightDoubleBracket]"}]}], "]"}], "]"}]}]}], ";"}], 
       "\[IndentingNewLine]", ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", 
         RowBox[{"Length", "[", "ElementosAnillod", "]"}]}], "}"}]}], "]"}], 
     ";", "\[IndentingNewLine]", 
     RowBox[{"Do", "[", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{"\[Not]", 
           RowBox[{"MemberQ", "[", 
            RowBox[{"ElementosAnillod", ",", 
             RowBox[{"ElemAnillod", "\[LeftDoubleBracket]", 
              RowBox[{"iad", ",", "j"}], "\[RightDoubleBracket]"}]}], "]"}]}],
           ",", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{
            RowBox[{"ConexionProv", "\[LeftDoubleBracket]", 
             RowBox[{"provx", "\[LeftDoubleBracket]", 
              RowBox[{"ElemAnillod", "\[LeftDoubleBracket]", 
               RowBox[{"iad", ",", "j"}], "\[RightDoubleBracket]"}], 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
            RowBox[{"ConexionProv", "\[LeftDoubleBracket]", 
             RowBox[{"provx", "\[LeftDoubleBracket]", 
              RowBox[{"RepresElemAnillod", "\[LeftDoubleBracket]", 
               RowBox[{"iad", ",", "j"}], "\[RightDoubleBracket]"}], 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], ";"}]}],
          "\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]", ",", 
       RowBox[{"{", 
        RowBox[{"j", ",", 
         RowBox[{"Length", "[", 
          RowBox[{
          "ElemAnillod", "\[LeftDoubleBracket]", "iad", 
           "\[RightDoubleBracket]"}], "]"}]}], "}"}]}], "]"}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"GuardarDistAnillosd", "\[LeftDoubleBracket]", 
       RowBox[{
       "DeptConAnillo", "\[LeftDoubleBracket]", "iad", 
        "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
      RowBox[{"Join", "[", 
       RowBox[{
        RowBox[{"{", "AuxDistAnillo", "}"}], ",", "NuevoOrden"}], "]"}]}], 
     ";", "\[IndentingNewLine]", 
     RowBox[{"Print", "[", 
      RowBox[{"\"\<Anillo a Guardar:\>\"", ",", 
       RowBox[{"GuardarDistAnillosd", "\[LeftDoubleBracket]", 
        RowBox[{
        "DeptConAnillo", "\[LeftDoubleBracket]", "iad", 
         "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], "]"}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"Print", "[", 
      RowBox[{"PlotAnilloDept", "[", 
       RowBox[{"deptx", "\[LeftDoubleBracket]", 
        RowBox[{
        "CabAnillosd", "\[LeftDoubleBracket]", "iad", 
         "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "]"}], "]"}], 
     ";"}], "\[IndentingNewLine]", ",", 
    RowBox[{"{", 
     RowBox[{"iad", ",", "nad"}], "}"}]}], "]"}], ";"}], "\n", 
 RowBox[{
  RowBox[{"OpenWrite", "[", "\"\<TAMANILLOSD.CSV\>\"", "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Export", "[", 
   RowBox[{
   "\"\<TAMANILLOSD.CSV\>\"", ",", "GuardarDistAnillosd", ",", 
    "\"\<CSV\>\""}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Close", "[", "\"\<TAMANILLOSD.CSV\>\"", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.632236891982294*^9, 3.632236899932089*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Algoritmo de Prim", "Subsection",
 CellChangeTimes->{{3.6322231312463317`*^9, 3.6322231383806524`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"Print", "[", 
    RowBox[{"Style", "[", 
     RowBox[{
     "\"\<ALGORITMO DE PRIM\>\"", ",", "Bold", ",", "16", ",", "Underlined", 
      ",", "White", ",", 
      RowBox[{"Background", "\[Rule]", 
       RowBox[{"RGBColor", "[", 
        RowBox[{"0", ",", 
         RowBox[{"1", "/", "2"}], ",", "0"}], "]"}]}]}], "]"}], "]"}], ";"}], 
  "\[IndentingNewLine]", 
  StyleBox[
   RowBox[{"(*", 
    RowBox[{
     RowBox[{"**", "**", "**", "**", "**", "**", " ", "en"}], " ", "estrella",
      " ", "con", " ", "fibra", " ", "enterrada"}], " ", "*************)"}],
   FontColor->RGBColor[1, 0, 0],
   Background->None]}], "\n", 
 RowBox[{
  RowBox[{"If", "[", 
   RowBox[{
    RowBox[{"ConsideraPRIM", "\[NotEqual]", "0"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"nodo", "=", "zerox"}], ";", "\[IndentingNewLine]", 
     RowBox[{"nodonoradio", "=", "zerox"}], ";", "\[IndentingNewLine]", 
     RowBox[{"numeronodos", "=", "0"}], ";", "\[IndentingNewLine]", 
     RowBox[{"numeronodosnoradio", "=", "0"}], ";", "\[IndentingNewLine]", 
     RowBox[{"NodosporProvincia", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Select", "[", 
         RowBox[{
          RowBox[{"Pick", "[", 
           RowBox[{
            RowBox[{"Range", "[", "nx", "]"}], ",", "provx", ",", "ip"}], 
           "]"}], ",", 
          RowBox[{
           RowBox[{
            RowBox[{"(", 
             RowBox[{
              RowBox[{
               RowBox[{
               "systemx", "\[LeftDoubleBracket]", "#", 
                "\[RightDoubleBracket]"}], "\[NotEqual]", "2"}], "\[And]", 
              RowBox[{
               RowBox[{
               "esAnillopx", "\[LeftDoubleBracket]", "#", 
                "\[RightDoubleBracket]"}], "\[Equal]", "0"}], "\[And]", 
              RowBox[{
               RowBox[{
               "sat1x", "\[LeftDoubleBracket]", "#", 
                "\[RightDoubleBracket]"}], "\[Equal]", "0"}]}], ")"}], 
            "\[Or]", 
            RowBox[{
            "hostx", "\[LeftDoubleBracket]", "#", "\[RightDoubleBracket]"}]}],
            "&"}]}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ip", ",", "np"}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"NodosNoRadioporProvincia", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"Select", "[", 
         RowBox[{
          RowBox[{"Pick", "[", 
           RowBox[{
            RowBox[{"Range", "[", "nx", "]"}], ",", "provx", ",", "ip"}], 
           "]"}], ",", 
          RowBox[{
           RowBox[{
            RowBox[{"(", 
             RowBox[{
              RowBox[{
               RowBox[{
               "systemx", "\[LeftDoubleBracket]", "#", 
                "\[RightDoubleBracket]"}], "\[NotEqual]", "2"}], "\[And]", 
              RowBox[{
               RowBox[{
               "esAnillopx", "\[LeftDoubleBracket]", "#", 
                "\[RightDoubleBracket]"}], "\[Equal]", "0"}], "\[And]", 
              RowBox[{"MemberQ", "[", 
               RowBox[{
                RowBox[{"{", 
                 RowBox[{"Enterrado", ",", " ", "Aereo", ",", " ", "Urbana"}],
                  "}"}], ",", 
                RowBox[{
                "transtechx", "\[LeftDoubleBracket]", "#", 
                 "\[RightDoubleBracket]"}]}], "]"}]}], ")"}], "\[Or]", 
            RowBox[{
            "hostx", "\[LeftDoubleBracket]", "#", "\[RightDoubleBracket]"}]}],
            "&"}]}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"ip", ",", "np"}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"PosHostp", "=", 
      RowBox[{"Flatten", "[", 
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"Position", "[", 
          RowBox[{
           RowBox[{"Select", "[", 
            RowBox[{
             RowBox[{"Pick", "[", 
              RowBox[{
               RowBox[{"Range", "[", "nx", "]"}], ",", "provx", ",", "ip"}], 
              "]"}], ",", 
             RowBox[{
              RowBox[{
               RowBox[{"(", 
                RowBox[{
                 RowBox[{
                  RowBox[{
                  "systemx", "\[LeftDoubleBracket]", "#", 
                   "\[RightDoubleBracket]"}], "\[NotEqual]", "2"}], "\[And]", 
                 RowBox[{
                  RowBox[{
                  "esAnillopx", "\[LeftDoubleBracket]", "#", 
                   "\[RightDoubleBracket]"}], "\[Equal]", "0"}], "\[And]", 
                 RowBox[{
                  RowBox[{
                  "sat1x", "\[LeftDoubleBracket]", "#", 
                   "\[RightDoubleBracket]"}], "\[Equal]", "0"}]}], ")"}], 
               "\[Or]", 
               RowBox[{
               "hostx", "\[LeftDoubleBracket]", "#", 
                "\[RightDoubleBracket]"}]}], "&"}]}], "]"}], ",", 
           RowBox[{
           "hostp", "\[LeftDoubleBracket]", "ip", "\[RightDoubleBracket]"}]}],
           "]"}], ",", 
         RowBox[{"{", 
          RowBox[{"ip", ",", "np"}], "}"}]}], "]"}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"PosHostnrp", "=", 
      RowBox[{"Flatten", "[", 
       RowBox[{"Table", "[", 
        RowBox[{
         RowBox[{"Position", "[", 
          RowBox[{
           RowBox[{"Select", "[", 
            RowBox[{
             RowBox[{"Pick", "[", 
              RowBox[{
               RowBox[{"Range", "[", "nx", "]"}], ",", "provx", ",", "ip"}], 
              "]"}], ",", 
             RowBox[{
              RowBox[{
               RowBox[{"(", 
                RowBox[{
                 RowBox[{
                  RowBox[{
                  "systemx", "\[LeftDoubleBracket]", "#", 
                   "\[RightDoubleBracket]"}], "\[NotEqual]", "2"}], "\[And]", 
                 RowBox[{
                  RowBox[{
                  "esAnillopx", "\[LeftDoubleBracket]", "#", 
                   "\[RightDoubleBracket]"}], "\[Equal]", "0"}], "\[And]", 
                 RowBox[{"MemberQ", "[", 
                  RowBox[{
                   RowBox[{"{", 
                    RowBox[{
                    "Enterrado", ",", " ", "Aereo", ",", " ", "Urbana"}], 
                    "}"}], ",", 
                   RowBox[{
                   "transtechx", "\[LeftDoubleBracket]", "#", 
                    "\[RightDoubleBracket]"}]}], "]"}]}], ")"}], "\[Or]", 
               RowBox[{
               "hostx", "\[LeftDoubleBracket]", "#", 
                "\[RightDoubleBracket]"}]}], "&"}]}], "]"}], ",", 
           RowBox[{
           "hostp", "\[LeftDoubleBracket]", "ip", "\[RightDoubleBracket]"}]}],
           "]"}], ",", 
         RowBox[{"{", 
          RowBox[{"ip", ",", "np"}], "}"}]}], "]"}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"ProvinciasPrim", "=", 
      RowBox[{"Select", "[", 
       RowBox[{
        RowBox[{"Range", "[", "np", "]"}], ",", 
        RowBox[{
         RowBox[{
          RowBox[{
           RowBox[{"Table", "[", 
            RowBox[{
             RowBox[{"Plus", "@@", 
              RowBox[{"Pick", "[", 
               RowBox[{
                RowBox[{"onex", "-", "esAnillopx"}], ",", "provx", ",", 
                "ip"}], "]"}]}], ",", 
             RowBox[{"{", 
              RowBox[{"ip", ",", "np"}], "}"}]}], "]"}], 
           "\[LeftDoubleBracket]", "#", "\[RightDoubleBracket]"}], ">", "0"}],
          "&"}]}], "]"}]}], ";", "\n", 
     RowBox[{"Do", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"ip", "=", 
         RowBox[{
         "ProvinciasPrim", "\[LeftDoubleBracket]", "jp", 
          "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
        RowBox[{"hostPrimp", "=", 
         RowBox[{
         "PosHostp", "\[LeftDoubleBracket]", "ip", 
          "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
        RowBox[{"hostnrPrimp", "=", 
         RowBox[{
         "PosHostnrp", "\[LeftDoubleBracket]", "ip", 
          "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
        RowBox[{"numeronodos", "=", 
         RowBox[{"Length", "[", 
          RowBox[{
          "NodosporProvincia", "\[LeftDoubleBracket]", "ip", 
           "\[RightDoubleBracket]"}], "]"}]}], ";", "\[IndentingNewLine]", 
        RowBox[{"numeronodosnoradio", "=", 
         RowBox[{"Length", "[", 
          RowBox[{
          "NodosNoRadioporProvincia", "\[LeftDoubleBracket]", "ip", 
           "\[RightDoubleBracket]"}], "]"}]}], ";", "\[IndentingNewLine]", 
        RowBox[{"nodo", "=", 
         RowBox[{
         "NodosporProvincia", "\[LeftDoubleBracket]", "ip", 
          "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
        RowBox[{"nodonoradio", "=", 
         RowBox[{
         "NodosNoRadioporProvincia", "\[LeftDoubleBracket]", "ip", 
          "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", 
        StyleBox[
         RowBox[{"(*", 
          RowBox[{
          "Inicio", " ", "de", " ", "Cambios", " ", "en", " ", "el", " ", 
           "Algoritmo", " ", "de", " ", "PRIM", " ", "para", " ", "que", " ", 
           "sea", " ", "similar", " ", "al", " ", "del", " ", "modelo", " ", 
           "en", " ", "access"}], "*)"}],
         FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", 
        StyleBox[
         RowBox[{"Print", "[", 
          RowBox[{"\"\<Prim de Provincia: \>\"", ",", 
           RowBox[{
           "provTXTp", "\[LeftDoubleBracket]", "ip", 
            "\[RightDoubleBracket]"}], ",", "\"\< con \>\"", ",", 
           "numeronodos", ",", "\"\< nodos (\>\"", ",", "jp", ",", 
           "\"\< de \>\"", ",", 
           RowBox[{"Length", "[", "ProvinciasPrim", "]"}], ",", "\"\<)\>\""}],
           "]"}],
         FontColor->RGBColor[0, 0, 1]], 
        StyleBox[";",
         FontColor->RGBColor[0, 0, 1]], 
        StyleBox["\[IndentingNewLine]",
         FontColor->RGBColor[1, 0, 0]], 
        StyleBox[
         RowBox[{"(*", 
          RowBox[{"Todos", " ", "los", " ", "nodos"}], "*)"}],
         FontColor->RGBColor[1, 0, 0]], 
        StyleBox["\[IndentingNewLine]",
         FontColor->RGBColor[0, 0, 1]], 
        RowBox[{"disttotal", "=", "0"}], ";", "\[IndentingNewLine]", 
        RowBox[{"nodoconectado", "=", 
         RowBox[{"Table", "[", 
          RowBox[{"0", ",", 
           RowBox[{"{", 
            RowBox[{"ix", ",", "numeronodos"}], "}"}]}], "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{
         "nodoconectado", "\[LeftDoubleBracket]", "hostPrimp", 
          "\[RightDoubleBracket]"}], "=", "1"}], ";", "\[IndentingNewLine]", 
        StyleBox[
         RowBox[{"(*", " ", 
          RowBox[{
          "vale", " ", "1", " ", "si", " ", "ya", " ", "forma", " ", "parte", 
           " ", "del", " ", "grafo"}], " ", "*)"}],
         FontColor->RGBColor[1, 0, 0]], 
        StyleBox["\[IndentingNewLine]",
         FontColor->RGBColor[1, 0, 0]], 
        RowBox[{"aquienmeconecto", "=", "zerox"}], ";", "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{
         "aquienmeconecto", "\[LeftDoubleBracket]", "hostPrimp", 
          "\[RightDoubleBracket]"}], "=", "hostPrimp"}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"nodoencontrado", "=", "hostPrimp"}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"While", "[", 
         RowBox[{
          RowBox[{"nodoencontrado", "\[NotEqual]", "0"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{"distaux", "=", "\[Infinity]"}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"nodoencontrado", "=", "0"}], ";", "\[IndentingNewLine]", 
           RowBox[{"nodoalqueseconecta", "=", "0"}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"For", "[", 
            RowBox[{
             RowBox[{"iinod", "=", "1"}], ",", 
             RowBox[{"iinod", "<", "numeronodos"}], ",", 
             RowBox[{"iinod", "++"}], ",", "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{"For", "[", 
               RowBox[{
                RowBox[{"jjnod", "=", 
                 RowBox[{"iinod", "+", "1"}]}], ",", 
                RowBox[{"jjnod", "<", 
                 RowBox[{"numeronodos", "+", "1"}]}], ",", 
                RowBox[{"jjnod", "++"}], ",", 
                RowBox[{
                 RowBox[{"If", "[", 
                  RowBox[{
                   RowBox[{
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"distance", "[", 
                    RowBox[{
                    RowBox[{
                    "nodo", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], ",", 
                    RowBox[{
                    "nodo", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}]}], "]"}], "<", "distaux"}], 
                    "\[Or]", 
                    RowBox[{"nodoencontrado", "\[Equal]", "0"}]}], ")"}], 
                    "\[And]", 
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    "nodoconectado", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "1"}], "\[And]", 
                    RowBox[{
                    RowBox[{
                    "nodoconectado", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "0"}]}], ")"}], 
                    "\[Or]", 
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    "nodoconectado", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "1"}], "\[And]", 
                    RowBox[{
                    RowBox[{
                    "nodoconectado", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "0"}]}], ")"}]}], 
                    ")"}]}], ",", "\[IndentingNewLine]", 
                   RowBox[{
                    RowBox[{"distaux", "=", 
                    RowBox[{"distance", "[", 
                    RowBox[{
                    RowBox[{
                    "nodo", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], ",", 
                    RowBox[{
                    "nodo", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}]}], "]"}]}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{"nodoencontrado", "=", 
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    "nodoconectado", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "0"}], ",", 
                    "iinod", ",", "jjnod"}], "]"}]}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{"nodoalqueseconecta", "=", 
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    "nodoconectado", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "0"}], ",", 
                    "iinod", ",", "jjnod"}], "]"}]}], ";"}]}], 
                  "\[IndentingNewLine]", "]"}], ";"}]}], 
               "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", 
            "]"}], ";", "\[IndentingNewLine]", 
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"nodoencontrado", "\[NotEqual]", "0"}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{
               "nodoconectado", "\[LeftDoubleBracket]", "nodoencontrado", 
                "\[RightDoubleBracket]"}], "=", "1"}], ";", 
              "\[IndentingNewLine]", 
              RowBox[{
               RowBox[{
               "aquienmeconecto", "\[LeftDoubleBracket]", "nodoencontrado", 
                "\[RightDoubleBracket]"}], "=", "nodoalqueseconecta"}], 
              ";"}]}], "\[IndentingNewLine]", "]"}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"disttotal", "=", 
            RowBox[{"disttotal", "+", 
             FractionBox["distaux", "factorNoLinealNoUrban"]}]}], ";"}]}], 
         "]"}], ";", "\[IndentingNewLine]", 
        StyleBox[
         RowBox[{"(*", 
          RowBox[{"Nodos", " ", "de", " ", "Fibra"}], "*)"}],
         FontColor->RGBColor[1, 0, 0]], 
        StyleBox["\[IndentingNewLine]",
         FontColor->RGBColor[1, 0, 0]], 
        RowBox[{"disttotalnoradio", "=", "0"}], ";", "\[IndentingNewLine]", 
        RowBox[{"nodoconectadonoradio", "=", 
         RowBox[{"Table", "[", 
          RowBox[{"0", ",", 
           RowBox[{"{", 
            RowBox[{"ix", ",", "numeronodosnoradio"}], "}"}]}], "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{
         "nodoconectadonoradio", "\[LeftDoubleBracket]", "hostnrPrimp", 
          "\[RightDoubleBracket]"}], "=", "1"}], ";", "\[IndentingNewLine]", 
        StyleBox[
         RowBox[{"(*", " ", 
          RowBox[{
          "vale", " ", "1", " ", "si", " ", "ya", " ", "forma", " ", "parte", 
           " ", "del", " ", "grafo"}], " ", "*)"}],
         FontColor->RGBColor[1, 0, 0]], 
        StyleBox["\[IndentingNewLine]",
         FontColor->RGBColor[1, 0, 0]], 
        RowBox[{"aquienmeconectonoradio", "=", "zerox"}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{
         RowBox[{
         "aquienmeconectonoradio", "\[LeftDoubleBracket]", "hostnrPrimp", 
          "\[RightDoubleBracket]"}], "=", "hostnrPrimp"}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"nodoencontradonoradio", "=", "hostnrPrimp"}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"numeronodonormal", "=", 
         RowBox[{"Table", "[", 
          RowBox[{"0", ",", 
           RowBox[{"{", 
            RowBox[{"ix", ",", "numeronodosnoradio"}], "}"}]}], "]"}]}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"For", "[", 
         RowBox[{
          RowBox[{"ibx", "=", "1"}], ",", 
          RowBox[{"ibx", "\[LessEqual]", "numeronodosnoradio"}], ",", 
          RowBox[{"ibx", "++"}], ",", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{"For", "[", 
            RowBox[{
             RowBox[{"icx", "=", "1"}], ",", 
             RowBox[{"icx", "\[LessEqual]", "numeronodos"}], ",", 
             RowBox[{"icx", "++"}], ",", "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{"If", "[", 
               RowBox[{
                RowBox[{
                 RowBox[{
                 "nodonoradio", "\[LeftDoubleBracket]", "ibx", 
                  "\[RightDoubleBracket]"}], "\[Equal]", 
                 RowBox[{
                 "nodo", "\[LeftDoubleBracket]", "icx", 
                  "\[RightDoubleBracket]"}]}], ",", 
                RowBox[{
                 RowBox[{
                 "numeronodonormal", "\[LeftDoubleBracket]", "ibx", 
                  "\[RightDoubleBracket]"}], "=", "icx"}]}], "]"}], ";"}]}], 
            "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", 
         "]"}], ";", "\[IndentingNewLine]", 
        RowBox[{"While", "[", 
         RowBox[{
          RowBox[{"nodoencontradonoradio", "\[NotEqual]", "0"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{"distauxnoradio", "=", "\[Infinity]"}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"nodoencontradonoradio", "=", "0"}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"nodoalqueseconectanoradio", "=", "0"}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"For", "[", 
            RowBox[{
             RowBox[{"iinod", "=", "1"}], ",", 
             RowBox[{"iinod", "<", "numeronodosnoradio"}], ",", 
             RowBox[{"iinod", "++"}], ",", "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{"For", "[", 
               RowBox[{
                RowBox[{"jjnod", "=", 
                 RowBox[{"iinod", "+", "1"}]}], ",", 
                RowBox[{"jjnod", "<", 
                 RowBox[{"numeronodosnoradio", "+", "1"}]}], ",", 
                RowBox[{"jjnod", "++"}], ",", "\[IndentingNewLine]", 
                RowBox[{
                 RowBox[{"If", "[", 
                  RowBox[{
                   RowBox[{
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"distance", "[", 
                    RowBox[{
                    RowBox[{
                    "nodonoradio", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], ",", 
                    RowBox[{
                    "nodonoradio", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}]}], "]"}], "<", 
                    "distauxnoradio"}], "\[Or]", 
                    RowBox[{"nodoencontradonoradio", "\[Equal]", "0"}]}], 
                    ")"}], "\[And]", 
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    "nodoconectadonoradio", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "1"}], "\[And]", 
                    RowBox[{
                    RowBox[{
                    "nodoconectadonoradio", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "0"}]}], ")"}], 
                    "\[Or]", 
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    "nodoconectadonoradio", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "1"}], "\[And]", 
                    RowBox[{
                    RowBox[{
                    "nodoconectadonoradio", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "0"}]}], ")"}]}], 
                    ")"}]}], ",", 
                   RowBox[{
                    RowBox[{"distauxnoradio", "=", 
                    RowBox[{"distance", "[", 
                    RowBox[{
                    RowBox[{
                    "nodonoradio", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], ",", 
                    RowBox[{
                    "nodonoradio", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}]}], "]"}]}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{"nodoencontradonoradio", "=", 
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    "nodoconectadonoradio", "\[LeftDoubleBracket]", "iinod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "0"}], ",", 
                    "iinod", ",", "jjnod"}], "]"}]}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{"nodoalqueseconectanoradio", "=", 
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    "nodoconectadonoradio", "\[LeftDoubleBracket]", "jjnod", 
                    "\[RightDoubleBracket]"}], "\[Equal]", "0"}], ",", 
                    "iinod", ",", "jjnod"}], "]"}]}], ";"}]}], 
                  "\[IndentingNewLine]", "]"}], ";"}]}], 
               "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", 
            "]"}], ";", "\[IndentingNewLine]", 
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"nodoencontradonoradio", "\[NotEqual]", "0"}], ",", 
             RowBox[{
              RowBox[{
               RowBox[{
               "nodoconectadonoradio", "\[LeftDoubleBracket]", 
                "nodoencontradonoradio", "\[RightDoubleBracket]"}], "=", 
               "1"}], ";", "\[IndentingNewLine]", 
              RowBox[{
               RowBox[{
               "aquienmeconectonoradio", "\[LeftDoubleBracket]", 
                "nodoencontradonoradio", "\[RightDoubleBracket]"}], "=", 
               "nodoalqueseconectanoradio"}], ";"}]}], "\[IndentingNewLine]", 
            "]"}], ";", "\[IndentingNewLine]", 
           RowBox[{"disttotalnoradio", "=", 
            RowBox[{"disttotalnoradio", "+", 
             FractionBox["distauxnoradio", "factorNoLinealNoUrban"]}]}], 
           ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", 
        RowBox[{"For", "[", 
         RowBox[{
          RowBox[{"ibx", "=", "1"}], ",", 
          RowBox[{"ibx", "\[LessEqual]", "numeronodosnoradio"}], ",", 
          RowBox[{"ibx", "++"}], ",", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{
            RowBox[{"aquienmeconecto", "\[LeftDoubleBracket]", 
             RowBox[{
             "numeronodonormal", "\[LeftDoubleBracket]", "ibx", 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
            RowBox[{"numeronodonormal", "\[LeftDoubleBracket]", 
             RowBox[{
             "aquienmeconectonoradio", "\[LeftDoubleBracket]", "ibx", 
              "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], ";"}]}],
          "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", 
        RowBox[{"For", "[", 
         RowBox[{
          RowBox[{"ibx", "=", "1"}], ",", 
          RowBox[{"ibx", "\[LessEqual]", "numeronodos"}], ",", 
          RowBox[{"ibx", "++"}], ",", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{"distaux", "=", 
            RowBox[{"distance", "[", 
             RowBox[{
              RowBox[{
              "nodo", "\[LeftDoubleBracket]", "ibx", 
               "\[RightDoubleBracket]"}], ",", 
              RowBox[{"nodo", "\[LeftDoubleBracket]", 
               RowBox[{
               "aquienmeconecto", "\[LeftDoubleBracket]", "ibx", 
                "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], 
             "]"}]}], ";", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"disthostx", "\[LeftDoubleBracket]", 
             RowBox[{
             "nodo", "\[LeftDoubleBracket]", "ibx", "\[RightDoubleBracket]"}],
              "\[RightDoubleBracket]"}], "=", 
            FractionBox["distaux", 
             RowBox[{"factorNoLinealx", "\[LeftDoubleBracket]", 
              RowBox[{
              "nodo", "\[LeftDoubleBracket]", "ibx", 
               "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]]}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"ibx", "\[NotEqual]", "hostPrimp"}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{"Conexion", "\[LeftDoubleBracket]", 
                RowBox[{
                "nodo", "\[LeftDoubleBracket]", "ibx", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
               RowBox[{"nodo", "\[LeftDoubleBracket]", 
                RowBox[{
                "aquienmeconecto", "\[LeftDoubleBracket]", "ibx", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], 
              ";"}]}], "\[IndentingNewLine]", "]"}], ";", 
           "\[IndentingNewLine]", 
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{
              RowBox[{"(", 
               RowBox[{"ibx", "\[Equal]", "hostPrimp"}], ")"}], "\[And]", 
              RowBox[{"(", 
               RowBox[{"ConsideraPRIM", "\[Equal]", "2"}], ")"}], "\[And]", 
              RowBox[{"(", 
               RowBox[{
                RowBox[{"transtechx", "\[LeftDoubleBracket]", 
                 RowBox[{
                 "nodo", "\[LeftDoubleBracket]", "ibx", 
                  "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
                "\[Equal]", "Enterrado"}], ")"}]}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{"disthostx", "\[LeftDoubleBracket]", 
                RowBox[{
                "nodo", "\[LeftDoubleBracket]", "ibx", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
               RowBox[{"2", "*", 
                RowBox[{"disthostx", "\[LeftDoubleBracket]", 
                 RowBox[{
                 "nodo", "\[LeftDoubleBracket]", "ibx", 
                  "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}]}], 
              ";"}]}], "\[IndentingNewLine]", "]"}], ";", 
           "\[IndentingNewLine]", 
           StyleBox[
            RowBox[{"(*", 
             RowBox[{
             "Se", " ", "le", " ", "retira", " ", "el", " ", "producto", " ", 
              "por", " ", "2"}], "*)"}],
            FontColor->RGBColor[1, 0, 0]], 
           StyleBox["\[IndentingNewLine]",
            FontColor->RGBColor[1, 0, 0]], 
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{
              RowBox[{"(", 
               RowBox[{"ConsideraPRIM", "\[Equal]", "3"}], ")"}], "\[And]", 
              RowBox[{"(", 
               RowBox[{
                RowBox[{"transtechx", "\[LeftDoubleBracket]", 
                 RowBox[{
                 "nodo", "\[LeftDoubleBracket]", "ibx", 
                  "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], 
                "\[Equal]", "Enterrado"}], ")"}]}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{"disthostx", "\[LeftDoubleBracket]", 
                RowBox[{
                "nodo", "\[LeftDoubleBracket]", "ibx", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "=", 
               RowBox[{"2", "*", 
                RowBox[{"disthostx", "\[LeftDoubleBracket]", 
                 RowBox[{
                 "nodo", "\[LeftDoubleBracket]", "ibx", 
                  "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}]}], 
              ";"}]}], "\[IndentingNewLine]", "]"}], ";", 
           "\[IndentingNewLine]", 
           StyleBox[
            RowBox[{"(*", 
             RowBox[{
             "Se", " ", "le", " ", "retira", " ", "el", " ", "producto", " ", 
              "por", " ", "2"}], "*)"}],
            FontColor->RGBColor[1, 0, 0]], 
           StyleBox["\[IndentingNewLine]",
            FontColor->RGBColor[1, 0, 0]], 
           RowBox[{"disttotal", "=", 
            RowBox[{"disttotal", "+", 
             FractionBox["distaux", "factorNoLinealNoUrban"]}]}], ";"}]}], 
         "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", 
        StyleBox[
         RowBox[{"(*", " ", 
          RowBox[{
          "ahora", " ", "actualizar", " ", "numero", " ", "de", " ", "e1s"}], 
          " ", "*)"}],
         FontColor->RGBColor[1, 0, 0]], 
        StyleBox["\[IndentingNewLine]",
         FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", 
        RowBox[{"aquienmeconecto2", "=", "aquienmeconecto"}], ";", 
        "\[IndentingNewLine]", 
        RowBox[{"For", "[", 
         RowBox[{
          RowBox[{"iinod", "=", "1"}], ",", 
          RowBox[{"iinod", "<", 
           RowBox[{"numeronodos", "+", "1"}]}], ",", 
          RowBox[{"iinod", "++"}], ",", 
          RowBox[{
           RowBox[{"While", "[", 
            RowBox[{
             RowBox[{
              RowBox[{"(", 
               RowBox[{
                RowBox[{
                "aquienmeconecto2", "\[LeftDoubleBracket]", "iinod", 
                 "\[RightDoubleBracket]"}], "\[NotEqual]", "0"}], ")"}], 
              "\[And]", 
              RowBox[{"(", 
               RowBox[{
                RowBox[{
                "aquienmeconecto2", "\[LeftDoubleBracket]", "iinod", 
                 "\[RightDoubleBracket]"}], "\[NotEqual]", "hostPrimp"}], 
               ")"}]}], ",", "\[IndentingNewLine]", 
             RowBox[{
              RowBox[{
               RowBox[{
               "aquienmeconecto2", "\[LeftDoubleBracket]", "iinod", 
                "\[RightDoubleBracket]"}], "=", 
               RowBox[{"aquienmeconecto", "\[LeftDoubleBracket]", 
                RowBox[{
                "aquienmeconecto2", "\[LeftDoubleBracket]", "iinod", 
                 "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], 
              ";"}]}], "\[IndentingNewLine]", "]"}], ";"}]}], 
         "\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]", ",", 
       RowBox[{"{", 
        RowBox[{"jp", ",", 
         RowBox[{"Length", "[", "ProvinciasPrim", "]"}]}], "}"}]}], "]"}], 
     ";"}]}], "\[IndentingNewLine]", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.632236924352531*^9, 3.632236928122908*^9}}]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Resultados", "Section",
 CellChangeTimes->{{3.632223177941317*^9, 3.6322231831329823`*^9}}],

Cell[CellGroupData[{

Cell["Enlaces remota-cabecera", "Subsection",
 CellChangeTimes->{{3.632224139825013*^9, 3.6322241540411506`*^9}, {
  3.632224611463998*^9, 3.6322246144792395`*^9}}],

Cell[BoxData[
 RowBox[{"Print", "[", 
  RowBox[{
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"ix", ",", 
       RowBox[{"y", "\[LeftDoubleBracket]", 
        RowBox[{"ix", ",", "16"}], "\[RightDoubleBracket]"}], ",", 
       RowBox[{
       "Conexion", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
       ",", 
       RowBox[{"y", "\[LeftDoubleBracket]", 
        RowBox[{
         RowBox[{
         "Conexion", "\[LeftDoubleBracket]", "ix", "\[RightDoubleBracket]"}], 
         ",", "16"}], "\[RightDoubleBracket]"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"ix", ",", "nx"}], "}"}]}], "]"}], "//", "TableForm"}], 
  "]"}]], "Input",
 CellChangeTimes->{{3.632164376759048*^9, 3.632164456821479*^9}, {
  3.6322426236495075`*^9, 3.6322426265507975`*^9}, {3.632657879552346*^9, 
  3.6326578818965807`*^9}}]
}, Closed]],

Cell[CellGroupData[{

Cell["Enlaces cabecera-tandem y anillos", "Subsection",
 CellChangeTimes->{{3.632223227166505*^9, 3.632223240906354*^9}, {
  3.632224163925691*^9, 3.632224169273619*^9}, {3.632224618752081*^9, 
  3.6322246281603336`*^9}}],

Cell[BoxData[
 RowBox[{"Print", "[", 
  RowBox[{
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{
       "hostp", "\[LeftDoubleBracket]", "ip", "\[RightDoubleBracket]"}], ",", 
       RowBox[{"y", "\[LeftDoubleBracket]", 
        RowBox[{
         RowBox[{
         "hostp", "\[LeftDoubleBracket]", "ip", "\[RightDoubleBracket]"}], 
         ",", "16"}], "\[RightDoubleBracket]"}], ",", 
       RowBox[{"hostp", "\[LeftDoubleBracket]", 
        RowBox[{
        "ConexionProv", "\[LeftDoubleBracket]", "ip", 
         "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", 
       RowBox[{"y", "\[LeftDoubleBracket]", 
        RowBox[{
         RowBox[{"hostp", "\[LeftDoubleBracket]", 
          RowBox[{
          "ConexionProv", "\[LeftDoubleBracket]", "ip", 
           "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", "16"}], 
        "\[RightDoubleBracket]"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"ip", ",", "np"}], "}"}]}], "]"}], "//", "TableForm"}], 
  "]"}]], "Input",
 CellChangeTimes->{{3.63216473308838*^9, 3.6321647928773794`*^9}}]
}, Closed]]
}, Open  ]]
}, Open  ]]
}, Open  ]]
},
WindowToolbars->"EditBar",
WindowSize->{960, 750},
WindowMargins->{{Automatic, 177}, {71, Automatic}},
PrivateNotebookOptions->{"VersionedStylesheet"->{"Default.nb"[8.] -> False}},
FrontEndVersion->"10.0 for Microsoft Windows (64-bit) (September 9, 2014)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[567, 22, 165, 2, 101, "Title"],
Cell[735, 26, 167, 2, 56, "Subtitle"],
Cell[CellGroupData[{
Cell[927, 32, 112, 1, 72, "Chapter"],
Cell[CellGroupData[{
Cell[1064, 37, 112, 1, 70, "Section"],
Cell[CellGroupData[{
Cell[1201, 42, 115, 1, 49, "Subsection"],
Cell[1319, 45, 184, 5, 49, "Text"]
}, Closed]],
Cell[CellGroupData[{
Cell[1540, 55, 110, 1, 41, "Subsection"],
Cell[1653, 58, 959, 24, 132, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[2649, 87, 211, 3, 41, "Subsection"],
Cell[2863, 92, 419, 14, 72, "Input"],
Cell[3285, 108, 2287, 59, 266, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[5609, 172, 112, 1, 41, "Subsection"],
Cell[5724, 175, 1989, 50, 212, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[7750, 230, 119, 1, 41, "Subsection"],
Cell[7872, 233, 1803, 57, 332, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[9712, 295, 107, 1, 41, "Subsection"],
Cell[9822, 298, 5658, 162, 632, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[15517, 465, 256, 4, 41, "Subsection"],
Cell[15776, 471, 1170, 37, 63, "Input"],
Cell[16949, 510, 3229, 88, 181, "Input"],
Cell[20181, 600, 2260, 60, 154, "Input"]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[22490, 666, 102, 1, 70, "Section"],
Cell[CellGroupData[{
Cell[22617, 671, 97, 1, 49, "Subsection"],
Cell[22717, 674, 3832, 104, 212, "Input"],
Cell[26552, 780, 4438, 120, 232, "Input"],
Cell[30993, 902, 5257, 135, 272, "Input"],
Cell[36253, 1039, 9845, 262, 572, "Input"],
Cell[46101, 1303, 3767, 104, 212, "Input"],
Cell[49871, 1409, 2768, 77, 292, "Input"],
Cell[52642, 1488, 2545, 68, 192, "Input"],
Cell[55190, 1558, 679, 19, 67, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[55906, 1582, 104, 1, 41, "Subsection"],
Cell[56013, 1585, 4820, 123, 385, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[60870, 1713, 131, 1, 41, "Subsection"],
Cell[61004, 1716, 36422, 776, 3483, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[97463, 2497, 192, 2, 41, "Subsection"],
Cell[97658, 2501, 411, 8, 31, "Input"],
Cell[98072, 2511, 4094, 111, 272, "Input"],
Cell[102169, 2624, 3116, 81, 252, "Input"],
Cell[105288, 2707, 638, 18, 72, "Input"],
Cell[105929, 2727, 2013, 48, 212, "Input"],
Cell[107945, 2777, 9783, 220, 853, "Input"],
Cell[117731, 2999, 547, 13, 72, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[118315, 3017, 142, 1, 41, "Subsection"],
Cell[118460, 3020, 16525, 417, 1422, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[135022, 3442, 109, 1, 41, "Subsection"],
Cell[135134, 3445, 32789, 763, 2669, "Input"]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[167972, 4214, 97, 1, 70, "Section"],
Cell[CellGroupData[{
Cell[168094, 4219, 164, 2, 49, "Subsection"],
Cell[168261, 4223, 853, 22, 31, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[169151, 4250, 221, 3, 41, "Subsection"],
Cell[169375, 4255, 1111, 28, 52, "Input"]
}, Closed]]
}, Open  ]]
}, Open  ]]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
