(* 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[ 13364, 367] NotebookOptionsPosition[ 12940, 349] NotebookOutlinePosition[ 13348, 365] CellTagsIndexPosition[ 13305, 362] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Weighted objective functions", FontColor->RGBColor[1, 0, 0]]], "Subsubsection", CellChangeTimes->{{3.73112424028771*^9, 3.7311242546173754`*^9}, { 3.8106047392458076`*^9, 3.8106047456549196`*^9}, {3.8131286886441045`*^9, 3.8131286920600576`*^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[{"WFmin", "[", "]"}], " ", "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[{ RowBox[{ SubscriptBox["c", "k"], " ", "\[Element]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], ";"}], 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[{"weighted", " ", "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[{"\[ScriptCapitalG]", RowBox[{"(", "\[CapitalPi]", ")"}]}], ";"}], FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ StyleBox["Submodules", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"none", " ", "needed", " "}], FontColor->RGBColor[0, 0, 1]]}]}], "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.813128716159551*^9, 3.8131287310664387`*^9}, {3.813128829720832*^9, 3.8131288437367177`*^9}, {3.8131288968861256`*^9, 3.8131288976456766`*^9}, {3.8208206004327154`*^9, 3.820820602339464*^9}, { 3.8208232348027654`*^9, 3.820823235970901*^9}, {3.822316945739644*^9, 3.8223169609999905`*^9}}, FontSize->12, ExpressionUUID -> "a16ffa28-7742-4592-bcc2-c1a697822085"], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"WF", "[", "PI_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"m", "=", RowBox[{"Length", "[", RowBox[{"Flatten", "[", RowBox[{"PI", ",", "1"}], "]"}], "]"}]}], ",", "c"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"c", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Mean", "[", RowBox[{"WeightedData", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "All", ",", "2"}], "]"}], "]"}], ",", RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "All", ",", "1"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "PI", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "s", ",", "1"}], "]"}], "]"}], "*", RowBox[{ RowBox[{"Norm", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "s", ",", "2"}], "]"}], "]"}], "-", RowBox[{"c", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], "^", "2"}]}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "PI", "]"}]}], "}"}], " ", ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", RowBox[{"PI", "[", RowBox[{"[", "j", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], " ", "]"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"WFmin", "[", "PI_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"A", "=", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"PI", ",", "1"}], "]"}], "[", RowBox[{"[", RowBox[{"All", ",", "2"}], "]"}], "]"}]}], ",", RowBox[{"k", "=", RowBox[{"Length", "[", "PI", "]"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"c", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Mean", "[", RowBox[{"WeightedData", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "All", ",", "2"}], "]"}], "]"}], ",", RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "All", ",", "1"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "PI", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"Flatten", "[", RowBox[{"PI", ",", "1"}], "]"}], "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}], "[", RowBox[{"[", "i", "]"}], "]"}], RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"Norm", "[", RowBox[{ RowBox[{"c", "[", RowBox[{"[", "j", "]"}], "]"}], "-", RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}], "^", "2"}], ",", RowBox[{"{", RowBox[{"j", ",", "k"}], "}"}]}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "A", "]"}]}], "}"}]}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"WG", "[", "PI_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"m", "=", RowBox[{"Length", "[", RowBox[{"Flatten", "[", RowBox[{"PI", ",", "1"}], "]"}], "]"}]}], ",", "c", ",", "set", ",", "cc"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"c", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Mean", "[", RowBox[{"WeightedData", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "All", ",", "2"}], "]"}], "]"}], ",", RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "All", ",", "1"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "PI", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"set", "=", RowBox[{"Flatten", "[", RowBox[{"PI", ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"cc", "=", RowBox[{"Mean", "[", RowBox[{"WeightedData", "[", RowBox[{ RowBox[{"set", "[", RowBox[{"[", RowBox[{"All", ",", "2"}], "]"}], "]"}], ",", RowBox[{"set", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", RowBox[{"PI", "[", RowBox[{"[", "j", "]"}], "]"}], "]"}], "*", RowBox[{ RowBox[{"Norm", "[", RowBox[{"cc", "-", RowBox[{"c", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], "^", "2"}]}], ",", 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.813128716159551*^9, 3.8131287310664387`*^9}, {3.813128829720832*^9, 3.8131288437367177`*^9}, {3.8131288968861256`*^9, 3.8131288976456766`*^9}, {3.8208206004327154`*^9, 3.820820602339464*^9}, { 3.8208232348027654`*^9, 3.820823235970901*^9}, 3.822316945739644*^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, 336, 5, 39, "Subsubsection"], Cell[919, 29, 4303, 120, 67, "Text"], Cell[5225, 151, 7699, 195, 335, "Input"] }, Open ]] } ] *)