(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 10416, 292] NotebookOptionsPosition[ 9992, 274] NotebookOutlinePosition[ 10400, 290] CellTagsIndexPosition[ 10357, 287] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Objective functions ", FontColor->RGBColor[1, 0, 0]]], "Subsubsection", CellChangeTimes->{{3.73112424028771*^9, 3.7311242546173754`*^9}, { 3.8106047392458076`*^9, 3.8106047456549196`*^9}, {3.820818867452566*^9, 3.820818868566964*^9}, {3.82082069093102*^9, 3.8208206918250113`*^9}}, ExpressionUUID -> "e66d6e93-d6b2-4c5b-9154-8959b5b959a5"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ StyleBox["Input", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"partition", " ", "\[CapitalPi]"}], FontColor->RGBColor[0, 0, 1]]}], StyleBox["=", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ SubscriptBox["\[Pi]", "1"], ",", "\[TripleDot]", ",", SubscriptBox["\[Pi]", "k"]}], "}"}], " ", "of", " ", "the", " ", "set", " ", "\[ScriptCapitalA]"}], " ", "\[Subset]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"(", RowBox[{"in", " ", "case", " ", "of", " ", RowBox[{"Fmin", "[", "]"}], " ", "only", " ", "the", " ", "set", " ", "\[ScriptCapitalA]"}], ")"}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"centers", " ", SubscriptBox["c", "1"]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox["\[TripleDot]", FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ SubscriptBox["c", "k"], " ", "\[Element]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{ RowBox[{"parameter", " ", "p"}], " ", "=", " ", RowBox[{"1", " ", "or", " ", "2"}]}], ";"}], FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["Output", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"objective", " ", "function", " ", "values"}], FontColor->RGBColor[0, 0, 1]], StyleBox[":", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"\[ScriptCapitalF]", RowBox[{"(", "\[CapitalPi]", ")"}]}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"\[FormalCapitalF]", RowBox[{"(", "c", ")"}]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{"or", " ", "\[ScriptCapitalG]", RowBox[{"(", "\[CapitalPi]", ")"}]}], ";"}], FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["Submodules", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"d", "[", "]"}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[" ", FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]"}], "Text", CellChangeTimes->{{3.7311239388490767`*^9, 3.7311241887665453`*^9}, { 3.731124262852821*^9, 3.7311242818390455`*^9}, {3.731124334688675*^9, 3.7311243931480875`*^9}, {3.731124464437002*^9, 3.7311245820590296`*^9}, { 3.731124626641944*^9, 3.7311246685996666`*^9}, 3.73112478187739*^9, 3.7311249716632557`*^9, 3.731125008229858*^9, {3.731131363164089*^9, 3.7311315307912507`*^9}, {3.8106047626816826`*^9, 3.810604763185858*^9}, { 3.810606445967278*^9, 3.810606530225013*^9}, {3.810606641466092*^9, 3.810606684833495*^9}, {3.810606749868683*^9, 3.810606752984932*^9}, { 3.8106068274532113`*^9, 3.810606866094061*^9}, {3.810606901083395*^9, 3.810607019637113*^9}, {3.810607054277118*^9, 3.8106071829172134`*^9}, { 3.8106072199097958`*^9, 3.8106072546405845`*^9}, 3.8106074697262*^9, { 3.8131282699269085`*^9, 3.813128270182798*^9}, {3.8131283217992973`*^9, 3.8131283433443713`*^9}, {3.8131285602764816`*^9, 3.813128631734671*^9}, { 3.820818897325577*^9, 3.8208189003135476`*^9}, {3.820818938286849*^9, 3.820818943227772*^9}, {3.820819014918785*^9, 3.8208190662244744`*^9}, { 3.82082070060423*^9, 3.8208207157889795`*^9}, {3.822308885875622*^9, 3.822308896014073*^9}, 3.8223089465967274`*^9}, FontSize->12, ExpressionUUID -> "a16ffa28-7742-4592-bcc2-c1a697822085"], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"FF", "[", RowBox[{"PI_", ",", "c_", ",", RowBox[{"p_:", "2"}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"k", "=", RowBox[{"Length", "[", "c", "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Sum", "[", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"d", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "s"}], "]"}], "]"}], ",", RowBox[{"c", "[", RowBox[{"[", "j", "]"}], "]"}], ",", "p"}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", RowBox[{"PI", "[", RowBox[{"[", "j", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Fmin", "[", RowBox[{"A_", ",", "c_", ",", RowBox[{"p_:", "2"}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"m", "=", RowBox[{"Length", "[", "A", "]"}]}], ",", RowBox[{"k", "=", RowBox[{"Length", "[", "c", "]"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Sum", "[", RowBox[{ RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"d", "[", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"c", "[", RowBox[{"[", "j", "]"}], "]"}], ",", "p"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "m"}], "}"}]}], "]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"G", "[", RowBox[{"PI_", ",", "c_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"k", "=", RowBox[{"Length", "[", "c", "]"}]}], ",", "cA"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"cA", "=", RowBox[{"Mean", "[", RowBox[{"Flatten", "[", RowBox[{ RowBox[{"Join", "[", "PI", "]"}], ",", "1"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Total", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", RowBox[{"PI", "[", RowBox[{"[", "j", "]"}], "]"}], "]"}], "*", RowBox[{"d", "[", RowBox[{"cA", ",", RowBox[{"c", "[", RowBox[{"[", "j", "]"}], "]"}], ",", "p"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "PI", "]"}]}], "}"}]}], "]"}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}]}]}]], "Input", CellChangeTimes->{{3.7311239388490767`*^9, 3.7311241887665453`*^9}, { 3.731124262852821*^9, 3.7311242818390455`*^9}, {3.731124334688675*^9, 3.7311243931480875`*^9}, {3.731124464437002*^9, 3.7311245820590296`*^9}, { 3.731124626641944*^9, 3.7311246685996666`*^9}, 3.73112478187739*^9, 3.7311249716632557`*^9, 3.731125008229858*^9, {3.731131363164089*^9, 3.7311315307912507`*^9}, {3.8106047626816826`*^9, 3.810604763185858*^9}, { 3.810606445967278*^9, 3.810606530225013*^9}, {3.810606641466092*^9, 3.810606684833495*^9}, {3.810606749868683*^9, 3.810606752984932*^9}, { 3.8106068274532113`*^9, 3.810606866094061*^9}, {3.810606901083395*^9, 3.810607019637113*^9}, {3.810607054277118*^9, 3.8106071829172134`*^9}, { 3.8106072199097958`*^9, 3.8106072546405845`*^9}, 3.8106074697262*^9, { 3.8131282699269085`*^9, 3.813128270182798*^9}, {3.8131283217992973`*^9, 3.8131283433443713`*^9}, {3.8131285602764816`*^9, 3.813128631734671*^9}, { 3.820818897325577*^9, 3.8208189003135476`*^9}, {3.820818938286849*^9, 3.820818943227772*^9}, {3.820819014918785*^9, 3.8208190662244744`*^9}, { 3.82082070060423*^9, 3.8208207157889795`*^9}, 3.822308885875622*^9}, ExpressionUUID -> "a16ffa28-7742-4592-bcc2-c1a697822085"] }, Open ]] }, WindowSize->{1536, 779}, WindowMargins->{{-8, Automatic}, {Automatic, -8}}, TaggingRules->{"SlideshowSettings" -> {"Toolbar" -> True}}, FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (September 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 371, 5, 39, "Subsubsection"], Cell[954, 29, 4600, 131, 85, "Text"], Cell[5557, 162, 4419, 109, 259, "Input"] }, Open ]] } ] *)