(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 10.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 157467, 3690] NotebookOptionsPosition[ 151753, 3496] NotebookOutlinePosition[ 152165, 3514] CellTagsIndexPosition[ 152122, 3511] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Graph Theory with ", StyleBox["Mathematica\n", FontSlant->"Italic"], StyleBox["Construction and representation\nVisualization of graphs\n\ Properties of graphs\nConnectivity, strong connectivity\nAdjacency & \ Transition Matrices\nMaking interactive models", FontSize->24, FontSlant->"Italic", FontColor->GrayLevel[0]] }], "Title", CellChangeTimes->{{3.618738912487796*^9, 3.6187389299386044`*^9}, { 3.619324653486854*^9, 3.619324660533725*^9}, {3.619326731634856*^9, 3.619326739015965*^9}, {3.654480138918597*^9, 3.654480140310169*^9}}], Cell[CellGroupData[{ Cell["Graphs", "Section", CellChangeTimes->{{3.618759794835518*^9, 3.6187597958406773`*^9}}], Cell[TextData[{ StyleBox["Definition:", FontColor->GrayLevel[0]], " A graph G={V, E} consists of a set of vertices V (also called nodes) and a \ set of edges E. \n", StyleBox["\n", FontColor->GrayLevel[0]], "Graphs provide a structural model that makes it possible to analyze and \ understand how many separate systems act together. Systems with symmetric \ relations are represented by undirected graphs, while the others can be \ modeled using directed graphs.\n", StyleBox["Applications: ", FontColor->GrayLevel[0]], "\n\ttechnological networks (the internet, power grids, telephone networks, \ transportation networks, \[Ellipsis])\n\tsocial networks (social graphs, \ affiliation networks, \[Ellipsis])\n\tinformation networks (World Wide Web, \ citation graphs, patent networks, \[Ellipsis]),\n\tbiological networks \ (biochemical networks, neural networks, food webs, \[Ellipsis]), and many \ more." }], "Subsubsection", CellChangeTimes->{{3.618759858916441*^9, 3.618759952106493*^9}, { 3.619147218698917*^9, 3.619147228640794*^9}, 3.619147292270382*^9, { 3.61914767512869*^9, 3.61914770773326*^9}, {3.6191477555314703`*^9, 3.619147820568933*^9}, {3.6191478531588583`*^9, 3.619147860222921*^9}, { 3.619324266320711*^9, 3.6193246043367157`*^9}, 3.619333376258621*^9, { 3.6954717453205147`*^9, 3.695471745935412*^9}}, TextJustification->1.], Cell[TextData[{ StyleBox["In ", FontColor->GrayLevel[0]], StyleBox["Mathematica", FontSlant->"Italic", FontColor->GrayLevel[0]], StyleBox[", graphs are integrated in the Wolfram language", FontColor->GrayLevel[0]], ", so they can be used as input and output without importing any libraries. \ A graph is represented either by a list of rules of the form {vi->vj,...}, \ where vi and vj are vertices, and vi->vj is the edge between vi and vj, or by \ the adjacency matrix of the graph. In the", StyleBox[" ", FontSlant->"Italic"], StyleBox[ButtonBox["Mathematica", BaseStyle->"Hyperlink", ButtonData->{ URL["http://reference.wolfram.com/language/guide/GraphsAndNetworks.html"], None}, ButtonNote-> "http://reference.wolfram.com/language/guide/GraphsAndNetworks.html"], FontSlant->"Italic"], ButtonBox[" documentation (Graphs and Networks)", BaseStyle->"Hyperlink", ButtonData->{ URL["http://reference.wolfram.com/language/guide/GraphsAndNetworks.html"], None}, ButtonNote-> "http://reference.wolfram.com/language/guide/GraphsAndNetworks.html"], " you can find the graph representations, graph functions, algorithms and \ lots of examples. " }], "Subsubsection", CellChangeTimes->{{3.6187599877039003`*^9, 3.6187600951327353`*^9}, { 3.619147253295953*^9, 3.619147276119033*^9}, {3.619147868334352*^9, 3.619147916748233*^9}, {3.619324767828025*^9, 3.619324817407551*^9}, { 3.619330117567748*^9, 3.6193302506876907`*^9}, {3.619330285933531*^9, 3.619330285935377*^9}, {3.650883217188483*^9, 3.6508832316606493`*^9}, 3.6954710530288773`*^9}, TextJustification->1.] }, Open ]], Cell[CellGroupData[{ Cell["Graph definitions in Mathematica", "Section", CellChangeTimes->{{3.619334882377249*^9, 3.619334917559842*^9}, { 3.695471728439558*^9, 3.695471737774728*^9}}], Cell[BoxData[ RowBox[{"G", "=", RowBox[{"Graph", "[", RowBox[{"{", RowBox[{ RowBox[{"1", "->", "2"}], ",", RowBox[{"3", "\[Rule]", "2"}], ",", RowBox[{"3", "\[Rule]", "4"}], ",", RowBox[{"4", "\[Rule]", "1"}]}], "}"}], "]"}]}]], "Input", CellChangeTimes->{{3.6187601049800997`*^9, 3.618760186507193*^9}, { 3.618760621453705*^9, 3.618760623778625*^9}, {3.6191473342318563`*^9, 3.619147367686294*^9}}, FontSize->16, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ GraphicsBox[ NamespaceBox["NetworkGraphics", DynamicModuleBox[{Typeset`graph = HoldComplete[ Graph[{1, 2, 3, 4}, {{{1, 2}, {3, 2}, {3, 4}, {4, 1}}, Null}, { GraphLayout -> "SpringEmbedding", GraphStyle -> "SmallNetwork", GridLinesStyle -> Directive[ GrayLevel[0.5, 0.4]]}]], Typeset`boxes, Typeset`boxes$s2d = GraphicsGroupBox[{{ Directive[ Hue[0.625, 0.5, 0.7], Thickness[Large], Opacity[1]], { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$1", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$3", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$3", Automatic, Center], DynamicLocation["VertexID$4", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$1", Automatic, Center]}]}}, { Directive[ Hue[0.125, 0.7, 0.9], EdgeForm[]], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.3130697939258356`, 0.8636217372948511}, {1.356828929848904, 0.8636217372948511}, { 1.3787084978104385`, 0.8636217372948511}, {1.3787084978104385`, 0.8855013052563855}, {1.3787084978104385`, 0.9292604411794542}, { 1.3787084978104385`, 0.9511400091409885}, {1.356828929848904, 0.9511400091409885}, {1.3130697939258356`, 0.9511400091409885}, { 1.291190225964301, 0.9511400091409885}, {1.291190225964301, 0.9292604411794542}, {1.291190225964301, 0.8855013052563855}, { 1.291190225964301, 0.8636217372948511}, {1.3130697939258356`, 0.8636217372948511}}}], "DynamicName", BoxID -> "VertexID$1"], InsetBox[ FormBox["1", TraditionalForm], DynamicLocation["VertexID$1", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$1"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{0.38019600477555054`, 1.251089544577322}, {0.4239551406986192, 1.251089544577322}, { 0.4458347086601535, 1.251089544577322}, {0.4458347086601535, 1.2729691125388565`}, {0.4458347086601535, 1.316728248461925}, { 0.4458347086601535, 1.3386078164234594`}, {0.4239551406986192, 1.3386078164234594`}, {0.38019600477555054`, 1.3386078164234594`}, {0.35831643681401626`, 1.3386078164234594`}, {0.35831643681401626`, 1.316728248461925}, { 0.35831643681401626`, 1.2729691125388565`}, {0.35831643681401626`, 1.251089544577322}, {0.38019600477555054`, 1.251089544577322}}}], "DynamicName", BoxID -> "VertexID$2"], InsetBox[ FormBox["2", TraditionalForm], DynamicLocation["VertexID$2", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$2"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{-0.021879567961534323`, 0.35142043682518337`}, {0.021879567961534323`, 0.35142043682518337`}, {0.04375913592306865, 0.35142043682518337`}, {0.04375913592306865, 0.37330000478671765`}, {0.04375913592306865, 0.41705914070978634`}, {0.04375913592306865, 0.4389387086713206}, { 0.021879567961534323`, 0.4389387086713206}, {-0.021879567961534323`, 0.4389387086713206}, {-0.04375913592306865, 0.4389387086713206}, {-0.04375913592306865, 0.41705914070978634`}, {-0.04375913592306865, 0.37330000478671765`}, {-0.04375913592306865, 0.35142043682518337`}, {-0.021879567961534323`, 0.35142043682518337`}}}], "DynamicName", BoxID -> "VertexID$3"], InsetBox[ FormBox["3", TraditionalForm], DynamicLocation["VertexID$3", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$3"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{ 0.9082679884373125, -0.04375913592306865}, { 0.9520271243603812, -0.04375913592306865}, { 0.9739066923219155, -0.04375913592306865}, { 0.9739066923219155, -0.021879567961534323`}, {0.9739066923219155, 0.021879567961534323`}, {0.9739066923219155, 0.04375913592306865}, {0.9520271243603812, 0.04375913592306865}, { 0.9082679884373125, 0.04375913592306865}, {0.8863884204757781, 0.04375913592306865}, {0.8863884204757781, 0.021879567961534323`}, { 0.8863884204757781, -0.021879567961534323`}, { 0.8863884204757781, -0.04375913592306865}, { 0.9082679884373125, -0.04375913592306865}}}], "DynamicName", BoxID -> "VertexID$4"], InsetBox[ FormBox["4", TraditionalForm], DynamicLocation["VertexID$4", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$4"]}}], $CellContext`flag}, TagBox[ DynamicBox[GraphComputation`NetworkGraphicsBox[ 3, Typeset`graph, Typeset`boxes, $CellContext`flag], { CachedValue :> Typeset`boxes, SingleEvaluation -> True, SynchronousUpdating -> False, TrackedSymbols :> {$CellContext`flag}}, ImageSizeCache->{{3.760693309010094, 355.2393066909899}, {-173.2393066909899, 168.2393066909899}}], MouseAppearanceTag["NetworkGraphics"]], AllowKernelInitialization->False, UnsavedVariables:>{$CellContext`flag}]], DefaultBaseStyle->{ "NetworkGraphics", FrontEnd`GraphicsHighlightColor -> Hue[0.8, 1., 0.6]}, FrameTicks->None, GridLinesStyle->Directive[ GrayLevel[0.5, 0.4]]]], "Input", CellChangeTimes->{{3.619147566405169*^9, 3.619147589609886*^9}}], Cell[BoxData[ RowBox[{"G", "=", RowBox[{"Graph", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "->", "2"}], ",", RowBox[{"3", "\[Rule]", "2"}], ",", RowBox[{"3", "\[Rule]", "4"}], ",", RowBox[{"4", "\[Rule]", "1"}]}], "}"}], ",", " ", RowBox[{"GraphStyle", "\[Rule]", "\"\\""}]}], "]"}]}]], "Input", CellChangeTimes->{{3.650885716167404*^9, 3.650885753950897*^9}}, FontSize->16, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ StyleBox[ RowBox[{ "You", " ", "can", " ", "write", " ", "click", " ", "on", " ", "the", " ", "graph", " ", "to", " ", "set", " ", "the", " ", "display", " ", "properties", " ", "of", " ", "the", " ", "graph", " ", RowBox[{"(", RowBox[{"layout", ",", " ", "size", ",", " ", RowBox[{"arrow", " ", "shape"}], ",", " ", RowBox[{"vertex", " ", "shape"}], ",", " ", RowBox[{"etc", "."}]}], ")"}], " ", "You", " ", "can", " ", "also", " ", "plot", " ", "the", " ", "graph", " ", "by", " ", "explicitly", " ", "listed", " ", "the", " ", "display", " ", RowBox[{"options", "."}]}], "Subsubsection", FontWeight->"Plain"]], "Input", CellChangeTimes->{{3.618761075817481*^9, 3.6187610758190117`*^9}, { 3.6187611239342937`*^9, 3.6187611447076683`*^9}}], Cell[BoxData[ RowBox[{"GraphPlot", "[", RowBox[{"G", ",", RowBox[{"VertexLabeling", "->", "True"}], ",", " ", RowBox[{"DirectedEdges", "\[Rule]", RowBox[{"{", RowBox[{"True", ",", " ", RowBox[{"\"\\"", "->", "0.15"}]}], "}"}]}], ",", " ", RowBox[{"PlotStyle", "->", "Dashed"}]}], "]"}]], "Input", CellChangeTimes->{{3.618761481087357*^9, 3.618761495573592*^9}, { 3.618761580748555*^9, 3.618761633055382*^9}, {3.618761680948724*^9, 3.618761698569003*^9}}, FontSize->16, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[{ RowBox[{ RowBox[{"G", "=", RowBox[{"Graph", "[", RowBox[{"{", RowBox[{ RowBox[{"1", "->", "2"}], ",", RowBox[{"3", "\[Rule]", "2"}], ",", RowBox[{"3", "\[Rule]", "4"}], ",", RowBox[{"4", "\[Rule]", "1"}]}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Gplot", "=", RowBox[{"GraphPlot", "[", RowBox[{"G", ",", RowBox[{"VertexLabeling", "->", "True"}], ",", " ", RowBox[{"DirectedEdges", "\[Rule]", RowBox[{"{", RowBox[{"True", ",", " ", RowBox[{"\"\\"", "->", "0.15"}]}], "}"}]}], ",", " ", RowBox[{ "PlotLabel", "\[Rule]", "\"\\""}]}], "]"}]}]}], "Input", CellChangeTimes->{{3.6187601049800997`*^9, 3.618760186507193*^9}, { 3.618760621453705*^9, 3.618760623778625*^9}, {3.6191473342318563`*^9, 3.619147367686294*^9}, {3.61932486400638*^9, 3.619324890271306*^9}, { 3.619325011891796*^9, 3.619325013752577*^9}, {3.619329606071075*^9, 3.619329653833571*^9}, {3.6193297795113983`*^9, 3.619329799983629*^9}, { 3.6193298376698723`*^9, 3.619330022204933*^9}, {3.619330379681261*^9, 3.619330394051194*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]] }, Open ]], Cell[CellGroupData[{ Cell["Adjacency matrix", "Section", CellChangeTimes->{{3.618761733947825*^9, 3.6187617374816093`*^9}}], Cell[TextData[{ StyleBox["Definition:", FontColor->GrayLevel[0]], " The adjacency matrix of a graph G is built by the following rule : the (i, \ j) entry in the matrix is 1 if there is an edge between i and j in the graph \ G, and 0 otherwise. \n" }], "Subsubsection", CellChangeTimes->{{3.65022782951096*^9, 3.650227883029727*^9}, 3.650883565679541*^9, {3.650883965242947*^9, 3.6508839677354717`*^9}}], Cell[CellGroupData[{ Cell[TextData[{ "The adjacency matrix of the graph can be obtained using the function ", StyleBox["AdjacencyMatrix[...]", FontColor->GrayLevel[0]] }], "Subsubsection", CellChangeTimes->{{3.619325484517684*^9, 3.619325523321899*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"AdjacencyMatrix", "[", "G", "]"}]], "Input", CellChangeTimes->{{3.6187607723428297`*^9, 3.61876078288938*^9}, { 3.650883512590527*^9, 3.650883536857872*^9}}, FontSize->14, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ TagBox[ TemplateBox[{RowBox[{ StyleBox[ TagBox["SparseArray", "SummaryHead"], "NonInterpretableSummary"], StyleBox["[", "NonInterpretableSummary"], DynamicModuleBox[{Typeset`open$$ = False}, PanelBox[ PaneSelectorBox[{False -> GridBox[{{ PaneBox[ ButtonBox[ DynamicBox[ FEPrivate`FrontEndResource[ "FEBitmaps", "SquarePlusIconMedium"]], ButtonFunction :> (Typeset`open$$ = True), Appearance -> None, Evaluator -> Automatic, Method -> "Preemptive"], Alignment -> {Center, Center}, ImageSize -> Dynamic[{ Automatic, 3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[ Magnification])}]], GraphicsBox[ RasterBox[CompressedData[" 1:eJxTTMoPSmVmYGBggWIQe2e3gevOLS/sb7gvX1cz7a39yYjcf/Ff39tble+O m6V0zn6O8aIt5j+u2L9YpPg4cNUrqomTau9AuZPW7gEAf/nR/A== "], {{0, 0}, {4, 4}}, {0, 1}], AspectRatio -> 1, Axes -> False, Frame -> False, FrameLabel -> {None, None}, FrameStyle -> Directive[ Opacity[0.5], Thickness[Tiny], RGBColor[0.368417, 0.506779, 0.709798]], FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle -> Directive[ GrayLevel[0.5, 0.4]], ImageSize -> Dynamic[{ Automatic, 3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[ Magnification])}], Method -> { "AxisPadding" -> Scaled[0.02], "DefaultBoundaryStyle" -> Automatic, "DefaultPlotStyle" -> Automatic, "DomainPadding" -> Scaled[0.02], "RangePadding" -> Scaled[0.05]}], GridBox[{{ RowBox[{ TagBox[ "\"Specified elements: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["4", "SummaryItem"]}]}, { RowBox[{ TagBox["\"Dimensions: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox[ RowBox[{"{", RowBox[{"4", ",", "4"}], "}"}], "SummaryItem"]}]}}, GridBoxAlignment -> { "Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings -> { "Columns" -> {{2}}, "Rows" -> {{Automatic}}}, BaseStyle -> { ShowStringCharacters -> False, NumberMarks -> False, PrintPrecision -> 3, ShowSyntaxStyles -> False}]}}, GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, BaselinePosition -> {1, 1}], True -> GridBox[{{ PaneBox[ ButtonBox[ DynamicBox[ FEPrivate`FrontEndResource[ "FEBitmaps", "SquareMinusIconMedium"]], ButtonFunction :> (Typeset`open$$ = False), Appearance -> None, Evaluator -> Automatic, Method -> "Preemptive"], Alignment -> {Center, Center}, ImageSize -> Dynamic[{ Automatic, 3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[ Magnification])}]], GraphicsBox[ RasterBox[CompressedData[" 1:eJxTTMoPSmVmYGBggWIQe2e3gevOLS/sb7gvX1cz7a39yYjcf/Ff39tble+O m6V0zn6O8aIt5j+u2L9YpPg4cNUrqomTau9AuZPW7gEAf/nR/A== "], {{0, 0}, {4, 4}}, {0, 1}], AspectRatio -> 1, Axes -> False, Frame -> False, FrameLabel -> {None, None}, FrameStyle -> Directive[ Opacity[0.5], Thickness[Tiny], RGBColor[0.368417, 0.506779, 0.709798]], FrameTicks -> {{None, None}, {None, None}}, GridLinesStyle -> Directive[ GrayLevel[0.5, 0.4]], ImageSize -> Dynamic[{ Automatic, 3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[ Magnification])}], Method -> { "AxisPadding" -> Scaled[0.02], "DefaultBoundaryStyle" -> Automatic, "DefaultPlotStyle" -> Automatic, "DomainPadding" -> Scaled[0.02], "RangePadding" -> Scaled[0.05]}], GridBox[{{ RowBox[{ TagBox[ "\"Specified elements: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["4", "SummaryItem"]}]}, { RowBox[{ TagBox["\"Dimensions: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox[ RowBox[{"{", RowBox[{"4", ",", "4"}], "}"}], "SummaryItem"]}]}, { RowBox[{ TagBox["\"Default: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["0", "SummaryItem"]}]}, { RowBox[{ TagBox["\"Density: \"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["0.25`", "SummaryItem"]}]}, { RowBox[{ TagBox["\"Elements:\"", "SummaryItemAnnotation"], "\[InvisibleSpace]", TagBox["\"\"", "SummaryItem"]}]}, { TagBox[ TagBox[ GridBox[{{ RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}], "\[Rule]", StyleBox[ PaneBox[ "1", ContentPadding -> False, FrameMargins -> 0, StripOnInput -> True, BaselinePosition -> Baseline, ImageSize -> {{1, 300}, Automatic}], LineBreakWithin -> False]}]}, { RowBox[{ RowBox[{"{", RowBox[{"3", ",", "2"}], "}"}], "\[Rule]", StyleBox[ PaneBox[ "1", ContentPadding -> False, FrameMargins -> 0, StripOnInput -> True, BaselinePosition -> Baseline, ImageSize -> {{1, 300}, Automatic}], LineBreakWithin -> False]}]}, { RowBox[{ RowBox[{"{", RowBox[{"3", ",", "4"}], "}"}], "\[Rule]", StyleBox[ PaneBox[ "1", ContentPadding -> False, FrameMargins -> 0, StripOnInput -> True, BaselinePosition -> Baseline, ImageSize -> {{1, 300}, Automatic}], LineBreakWithin -> False]}]}, { RowBox[{ RowBox[{"{", RowBox[{"4", ",", "1"}], "}"}], "\[Rule]", StyleBox[ PaneBox[ "1", ContentPadding -> False, FrameMargins -> 0, StripOnInput -> True, BaselinePosition -> Baseline, ImageSize -> {{1, 300}, Automatic}], LineBreakWithin -> False]}]}}, GridBoxAlignment -> {"Columns" -> {{Left}}}, DefaultBaseStyle -> "Column", GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Column"], "SummaryItem"]}}, GridBoxAlignment -> { "Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings -> { "Columns" -> {{2}}, "Rows" -> {{Automatic}}}, BaseStyle -> { ShowStringCharacters -> False, NumberMarks -> False, PrintPrecision -> 3, ShowSyntaxStyles -> False}]}}, GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, BaselinePosition -> {1, 1}]}, Dynamic[Typeset`open$$], ImageSize -> Automatic], BaselinePosition -> Baseline], DynamicModuleValues :> {}], StyleBox["]", "NonInterpretableSummary"]}]}, "CopyTag", DisplayFunction->(#& ), InterpretationFunction->("SparseArray[<4>, {4, 4}]"& )], False, Editable->False, SelectWithContents->True, Selectable->False]], "Output", CellChangeTimes->{3.618760783779438*^9, 3.650885838221764*^9}] }, Open ]], Cell[TextData[{ StyleBox["By default, if the graph does not have a lot of edges, its \ adjacency matrix in ", "Subsubsection"], StyleBox["Mathematica", "Subsubsection", FontSlant->"Italic"], StyleBox[" is given as a sparse array (only the non-zero elements are \ listed), but we can convert it to the regular form by using MatrixForm. In \ practice, for directed graph we will use more often the transpose of the \ adjacency matrix.", "Subsubsection"] }], "Text", CellChangeTimes->{{3.618760850049638*^9, 3.6187608832421722`*^9}, { 3.61876091651541*^9, 3.618761030406824*^9}, {3.618761197226116*^9, 3.6187612376705437`*^9}, {3.619147990092051*^9, 3.619148066046713*^9}, { 3.65022784478936*^9, 3.650227847373041*^9}, {3.65022789963881*^9, 3.6502279131270113`*^9}}, TextJustification->1.], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MatrixForm", "[", RowBox[{"AdjacencyMatrix", "[", "G", "]"}], "]"}]], "Input", CellChangeTimes->{{3.6187608893231487`*^9, 3.6187609032849817`*^9}}, FontSize->14, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "0"}, {"0", "0", "0", "0"}, {"0", "1", "0", "1"}, {"1", "0", "0", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[ SparseArray[ Automatic, {4, 4}, 0, { 1, {{0, 1, 1, 3, 4}, {{2}, {2}, {4}, {1}}}, {1, 1, 1, 1}}]]]]], "Output",\ CellChangeTimes->{3.618760904576454*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Exercise : Define a graph H with the following set of edges and use \ Mathematica to compute its adjacency matrix. Edges : 2 -> 3, 4 -> 5, 1 -> 6, 6 -> 2, 6 -> 5, 6 -> 1, 6 -> 3, 6 -> 4, 5 \ -> 1\ \>", "Subsection", CellChangeTimes->{{3.650886710978386*^9, 3.6508868629476557`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"H", "=", RowBox[{"Graph", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"2", "\[Rule]", "3"}], ",", RowBox[{"4", "\[Rule]", "5"}], ",", RowBox[{"6", "\[Rule]", "2"}], ",", RowBox[{"6", "\[Rule]", "5"}], ",", RowBox[{"6", "\[Rule]", "1"}], ",", RowBox[{"6", "\[Rule]", "3"}], ",", RowBox[{"6", "\[Rule]", "4"}], ",", RowBox[{"5", "\[Rule]", "1"}], ",", " ", RowBox[{"1", "\[Rule]", "6"}]}], "}"}], ",", " ", RowBox[{"GraphStyle", "\[Rule]", "\"\\""}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6508868654046593`*^9, 3.6508868779621687`*^9}, { 3.650886945797793*^9, 3.650886951541358*^9}}], Cell[BoxData[ GraphicsBox[ NamespaceBox["NetworkGraphics", DynamicModuleBox[{Typeset`graph = HoldComplete[ Graph[{2, 3, 4, 5, 6, 1}, {{{1, 2}, {3, 4}, {5, 1}, {5, 4}, {5, 6}, {5, 2}, {5, 3}, {4, 6}, { 6, 5}}, Null}, {GraphStyle -> "SmallNetwork"}]], Typeset`boxes, Typeset`boxes$s2d = GraphicsGroupBox[{{ Directive[ Hue[0.625, 0.5, 0.7], Thickness[Large], Opacity[1]], { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$1", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$3", Automatic, Center], DynamicLocation["VertexID$4", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$6", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$5", Automatic, Center], DynamicLocation["VertexID$1", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$5", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$5", Automatic, Center], DynamicLocation["VertexID$3", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$5", Automatic, Center], DynamicLocation["VertexID$4", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$5", Automatic, Center], { 1.564420087803442, 0.5169311125530552}, DynamicLocation["VertexID$6", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$6", Automatic, Center], { 1.3066473185680971`, 0.2668550646901961}, DynamicLocation["VertexID$5", Automatic, Center]}]]}}, { Directive[ Hue[0.125, 0.7, 0.9], EdgeForm[]], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{-0.03044291970995737, 1.0968262284016668`}, {0.03044291970995737, 1.0968262284016668`}, { 0.06088583941991474, 1.0968262284016668`}, {0.06088583941991474, 1.1272691481116242`}, {0.06088583941991474, 1.188154987531539}, { 0.06088583941991474, 1.2185979072414963`}, {0.03044291970995737, 1.2185979072414963`}, {-0.03044291970995737, 1.2185979072414963`}, {-0.06088583941991474, 1.2185979072414963`}, {-0.06088583941991474, 1.188154987531539}, {-0.06088583941991474, 1.1272691481116242`}, {-0.06088583941991474, 1.0968262284016668`}, {-0.03044291970995737, 1.0968262284016668`}}}], "DynamicName", BoxID -> "VertexID$1"], InsetBox[ FormBox["2", TraditionalForm], DynamicLocation["VertexID$1", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$1"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{-0.0302676552501273, 0.34807279974596483`}, {0.03061818416978744, 0.34807279974596483`}, {0.06106110387974481, 0.34807279974596483`}, {0.06106110387974481, 0.37851571945592216`}, {0.06106110387974481, 0.43940155887583693`}, {0.06106110387974481, 0.46984447858579426`}, {0.03061818416978744, 0.46984447858579426`}, {-0.0302676552501273, 0.46984447858579426`}, {-0.06071057496008467, 0.46984447858579426`}, {-0.06071057496008467, 0.43940155887583693`}, {-0.06071057496008467, 0.37851571945592216`}, {-0.06071057496008467, 0.34807279974596483`}, {-0.0302676552501273, 0.34807279974596483`}}}], "DynamicName", BoxID -> "VertexID$2"], InsetBox[ FormBox["3", TraditionalForm], DynamicLocation["VertexID$2", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$2"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.7877482200001094`, 1.5045147189508774`}, {1.8486340594200241`, 1.5045147189508774`}, { 1.8790769791299815`, 1.5045147189508774`}, {1.8790769791299815`, 1.5349576386608348`}, {1.8790769791299815`, 1.5958434780807496`}, { 1.8790769791299815`, 1.626286397790707}, {1.8486340594200241`, 1.626286397790707}, {1.7877482200001094`, 1.626286397790707}, { 1.757305300290152, 1.626286397790707}, {1.757305300290152, 1.5958434780807496`}, {1.757305300290152, 1.5349576386608348`}, { 1.757305300290152, 1.5045147189508774`}, {1.7877482200001094`, 1.5045147189508774`}}}], "DynamicName", BoxID -> "VertexID$3"], InsetBox[ FormBox["4", TraditionalForm], DynamicLocation["VertexID$3", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$3"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{2.030006270916675, 0.7214297195794469}, {2.09089211033659, 0.7214297195794469}, { 2.121335030046547, 0.7214297195794469}, {2.121335030046547, 0.7518726392894043}, {2.121335030046547, 0.812758478709319}, { 2.121335030046547, 0.8432013984192764}, {2.09089211033659, 0.8432013984192764}, {2.030006270916675, 0.8432013984192764}, { 1.9995633512067177`, 0.8432013984192764}, {1.9995633512067177`, 0.812758478709319}, {1.9995633512067177`, 0.7518726392894043}, { 1.9995633512067177`, 0.7214297195794469}, {2.030006270916675, 0.7214297195794469}}}], "DynamicName", BoxID -> "VertexID$4"], InsetBox[ FormBox["5", TraditionalForm], DynamicLocation["VertexID$4", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$4"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.024899054621068, 0.7229003378233034}, {1.0857848940409827`, 0.7229003378233034}, { 1.11622781375094, 0.7229003378233034}, {1.11622781375094, 0.7533432575332608}, {1.11622781375094, 0.8142290969531756}, { 1.11622781375094, 0.844672016663133}, {1.0857848940409827`, 0.844672016663133}, {1.024899054621068, 0.844672016663133}, { 0.9944561349111105, 0.844672016663133}, {0.9944561349111105, 0.8142290969531756}, {0.9944561349111105, 0.7533432575332608}, { 0.9944561349111105, 0.7229003378233034}, {1.024899054621068, 0.7229003378233034}}}], "DynamicName", BoxID -> "VertexID$5"], InsetBox[ FormBox["6", TraditionalForm], DynamicLocation["VertexID$5", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$5"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{ 1.7852825123305511`, -0.06088583941991474}, { 1.846168351750466, -0.06088583941991474}, { 1.8766112714604233`, -0.06088583941991474}, { 1.8766112714604233`, -0.03044291970995737}, {1.8766112714604233`, 0.03044291970995737}, {1.8766112714604233`, 0.06088583941991474}, { 1.846168351750466, 0.06088583941991474}, {1.7852825123305511`, 0.06088583941991474}, {1.7548395926205937`, 0.06088583941991474}, { 1.7548395926205937`, 0.03044291970995737}, { 1.7548395926205937`, -0.03044291970995737}, { 1.7548395926205937`, -0.06088583941991474}, { 1.7852825123305511`, -0.06088583941991474}}}], "DynamicName", BoxID -> "VertexID$6"], InsetBox[ FormBox["1", TraditionalForm], DynamicLocation["VertexID$6", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$6"]}}], $CellContext`flag}, TagBox[ DynamicBox[GraphComputation`NetworkGraphicsBox[ 3, Typeset`graph, Typeset`boxes, $CellContext`flag], { CachedValue :> Typeset`boxes, SingleEvaluation -> True, SynchronousUpdating -> False, TrackedSymbols :> {$CellContext`flag}}, ImageSizeCache->{{3.760693309010094, 355.2393066909899}, {-139.2393066909899, 134.2393066909899}}], MouseAppearanceTag["NetworkGraphics"]], AllowKernelInitialization->False, UnsavedVariables:>{$CellContext`flag}]], DefaultBaseStyle->{ "NetworkGraphics", FrontEnd`GraphicsHighlightColor -> Hue[0.8, 1., 0.6]}, FormatType->TraditionalForm, FrameTicks->None]], "Output", CellChangeTimes->{ 3.6508868808894978`*^9, 3.650886955084446*^9, {3.695471470181253*^9, 3.6954714940640087`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MatrixForm", "[", RowBox[{"AdjacencyMatrix", "[", "H", "]"}], "]"}]], "Input", CellChangeTimes->{{3.6508868898576317`*^9, 3.650886911653982*^9}}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", "0", "0", "1"}, {"0", "0", "1", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "1", "0"}, {"1", "0", "0", "0", "0", "0"}, {"1", "1", "1", "1", "1", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[ SparseArray[ Automatic, {6, 6}, 0, { 1, {{0, 1, 2, 2, 3, 4, 9}, {{6}, {3}, {5}, {1}, {1}, {2}, {3}, {4}, { 5}}}, {1, 1, 1, 1, 1, 1, 1, 1, 1}}]]]]], "Output", CellChangeTimes->{{3.6508868985146008`*^9, 3.65088691209029*^9}, 3.65088695969855*^9, 3.65088700758039*^9, {3.6954715555968523`*^9, 3.695471583788039*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"H", "=", RowBox[{"Graph", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3", ",", "4", ",", "5", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"2", "\[Rule]", "3"}], ",", RowBox[{"4", "\[Rule]", "5"}], ",", RowBox[{"6", "\[Rule]", "2"}], ",", RowBox[{"6", "\[Rule]", "5"}], ",", RowBox[{"6", "\[Rule]", "1"}], ",", RowBox[{"6", "\[Rule]", "3"}], ",", RowBox[{"6", "\[Rule]", "4"}], ",", RowBox[{"5", "\[Rule]", "1"}], ",", " ", RowBox[{"1", "\[Rule]", "6"}]}], "}"}], ",", " ", RowBox[{"GraphStyle", "\[Rule]", "\"\\""}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6508869771122913`*^9, 3.6508870011561127`*^9}}], Cell[BoxData[ GraphicsBox[ NamespaceBox["NetworkGraphics", DynamicModuleBox[{Typeset`graph = HoldComplete[ Graph[{1, 2, 3, 4, 5, 6}, {{{2, 3}, {4, 5}, {6, 2}, {6, 5}, {6, 1}, {6, 3}, {6, 4}, {5, 1}, { 1, 6}}, Null}, {GraphStyle -> "SmallNetwork"}]], Typeset`boxes, Typeset`boxes$s2d = GraphicsGroupBox[{{ Directive[ Hue[0.625, 0.5, 0.7], Thickness[Large], Opacity[1]], { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$1", Automatic, Center], { 1.3072872064177354`, 0.2657190869619711}, DynamicLocation["VertexID$6", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$2", Automatic, Center], DynamicLocation["VertexID$3", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$5", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$5", Automatic, Center], DynamicLocation["VertexID$1", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$6", Automatic, Center], { 1.5644924211063729`, 0.5163413788731286}, DynamicLocation["VertexID$1", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$6", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$6", Automatic, Center], DynamicLocation["VertexID$3", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$6", Automatic, Center], DynamicLocation["VertexID$4", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$6", Automatic, Center], DynamicLocation["VertexID$5", Automatic, Center]}]}}, { Directive[ Hue[0.125, 0.7, 0.9], EdgeForm[]], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{ 1.7864658121910744`, -0.06089237536891137}, { 1.8473581875599858`, -0.06089237536891137}, { 1.8778043752444415`, -0.06089237536891137}, { 1.8778043752444415`, -0.030446187684455686`}, {1.8778043752444415`, 0.030446187684455686`}, {1.8778043752444415`, 0.06089237536891137}, {1.8473581875599858`, 0.06089237536891137}, { 1.7864658121910744`, 0.06089237536891137}, {1.7560196245066186`, 0.06089237536891137}, {1.7560196245066186`, 0.030446187684455686`}, { 1.7560196245066186`, -0.030446187684455686`}, { 1.7560196245066186`, -0.06089237536891137}, { 1.7864658121910744`, -0.06089237536891137}}}], "DynamicName", BoxID -> "VertexID$1"], InsetBox[ FormBox["1", TraditionalForm], DynamicLocation["VertexID$1", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$1"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{-0.030446187684455686`, 0.3474959351308109}, {0.030446187684455686`, 0.3474959351308109}, { 0.06089237536891137, 0.3474959351308109}, {0.06089237536891137, 0.3779421228152666}, {0.06089237536891137, 0.43883449818417797`}, { 0.06089237536891137, 0.4692806858686337}, {0.030446187684455686`, 0.4692806858686337}, {-0.030446187684455686`, 0.4692806858686337}, {-0.06089237536891137, 0.4692806858686337}, {-0.06089237536891137, 0.43883449818417797`}, {-0.06089237536891137, 0.3779421228152666}, {-0.06089237536891137, 0.3474959351308109}, {-0.030446187684455686`, 0.3474959351308109}}}], "DynamicName", BoxID -> "VertexID$2"], InsetBox[ FormBox["2", TraditionalForm], DynamicLocation["VertexID$2", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$2"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{-0.029699698255237286`, 1.0963937133580288`}, {0.031192677113674086`, 1.0963937133580288`}, {0.06163886479812977, 1.0963937133580288`}, { 0.06163886479812977, 1.1268399010424845`}, {0.06163886479812977, 1.187732276411396}, {0.06163886479812977, 1.2181784640958517`}, { 0.031192677113674086`, 1.2181784640958517`}, {-0.029699698255237286`, 1.2181784640958517`}, {-0.06014588593969297, 1.2181784640958517`}, {-0.06014588593969297, 1.187732276411396}, {-0.06014588593969297, 1.1268399010424845`}, {-0.06014588593969297, 1.0963937133580288`}, {-0.029699698255237286`, 1.0963937133580288`}}}], "DynamicName", BoxID -> "VertexID$3"], InsetBox[ FormBox["3", TraditionalForm], DynamicLocation["VertexID$3", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$3"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.7852115930898858`, 1.5056838038345277`}, {1.8461039684587972`, 1.5056838038345277`}, { 1.876550156143253, 1.5056838038345277`}, {1.876550156143253, 1.5361299915189834`}, {1.876550156143253, 1.597022366887895}, { 1.876550156143253, 1.6274685545723506`}, {1.8461039684587972`, 1.6274685545723506`}, {1.7852115930898858`, 1.6274685545723506`}, { 1.75476540540543, 1.6274685545723506`}, {1.75476540540543, 1.597022366887895}, {1.75476540540543, 1.5361299915189834`}, { 1.75476540540543, 1.5056838038345277`}, {1.7852115930898858`, 1.5056838038345277`}}}], "DynamicName", BoxID -> "VertexID$4"], InsetBox[ FormBox["4", TraditionalForm], DynamicLocation["VertexID$4", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$4"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{2.0294583031243225`, 0.7219715471210849}, {2.0903506784932335`, 0.7219715471210849}, { 2.1207968661776895`, 0.7219715471210849}, {2.1207968661776895`, 0.7524177348055405}, {2.1207968661776895`, 0.813310110174452}, { 2.1207968661776895`, 0.8437562978589076}, {2.0903506784932335`, 0.8437562978589076}, {2.0294583031243225`, 0.8437562978589076}, { 1.9990121154398666`, 0.8437562978589076}, {1.9990121154398666`, 0.813310110174452}, {1.9990121154398666`, 0.7524177348055405}, { 1.9990121154398666`, 0.7219715471210849}, {2.0294583031243225`, 0.7219715471210849}}}], "DynamicName", BoxID -> "VertexID$5"], InsetBox[ FormBox["5", TraditionalForm], DynamicLocation["VertexID$5", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$5"], TagBox[{ TagBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.0244214399641216`, 0.72116809046631}, {1.085313815333033, 0.72116809046631}, { 1.1157600030174888`, 0.72116809046631}, {1.1157600030174888`, 0.7516142781507656}, {1.1157600030174888`, 0.8125066535196771}, { 1.1157600030174888`, 0.8429528412041327}, {1.085313815333033, 0.8429528412041327}, {1.0244214399641216`, 0.8429528412041327}, { 0.993975252279666, 0.8429528412041327}, {0.993975252279666, 0.8125066535196771}, {0.993975252279666, 0.7516142781507656}, { 0.993975252279666, 0.72116809046631}, {1.0244214399641216`, 0.72116809046631}}}], "DynamicName", BoxID -> "VertexID$6"], InsetBox[ FormBox["6", TraditionalForm], DynamicLocation["VertexID$6", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$6"]}}], $CellContext`flag}, TagBox[ DynamicBox[GraphComputation`NetworkGraphicsBox[ 3, Typeset`graph, Typeset`boxes, $CellContext`flag], { CachedValue :> Typeset`boxes, SingleEvaluation -> True, SynchronousUpdating -> False, TrackedSymbols :> {$CellContext`flag}}, ImageSizeCache->{{3.760693309010094, 355.2393066909899}, {-139.2393066909899, 134.2393066909899}}], MouseAppearanceTag["NetworkGraphics"]], AllowKernelInitialization->False, UnsavedVariables:>{$CellContext`flag}]], DefaultBaseStyle->{ "NetworkGraphics", FrontEnd`GraphicsHighlightColor -> Hue[0.8, 1., 0.6]}, FormatType->TraditionalForm, FrameTicks->None]], "Output", CellChangeTimes->{3.650887003212723*^9, 3.695471580739951*^9}] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Displaying graphics in the same row/column", "Section", CellChangeTimes->{{3.650883786398342*^9, 3.6508837939603367`*^9}, { 3.65088388564581*^9, 3.650883915654666*^9}}], Cell[CellGroupData[{ Cell["\<\ We want to get a little fancy this time and display the graph and the \ adjacency matrix on the same row:\ \>", "Subsubsection", CellChangeTimes->{{3.619325542169183*^9, 3.619325621310129*^9}, { 3.6193349406664867`*^9, 3.6193349420202627`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"G", "=", RowBox[{"Graph", "[", RowBox[{"{", RowBox[{ RowBox[{"1", "->", "2"}], ",", RowBox[{"3", "\[Rule]", "2"}], ",", RowBox[{"3", "\[Rule]", "4"}], ",", RowBox[{"4", "\[Rule]", "1"}]}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Gplot", "=", RowBox[{"GraphPlot", "[", RowBox[{"G", ",", RowBox[{"VertexLabeling", "->", "True"}], ",", " ", RowBox[{"DirectedEdges", "\[Rule]", RowBox[{"{", RowBox[{"True", ",", " ", RowBox[{"\"\\"", "->", "0.15"}]}], "}"}]}], ",", " ", RowBox[{ "PlotLabel", "\[Rule]", "\"\\""}]}], "]"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Adj", "=", RowBox[{"MatrixForm", "[", RowBox[{"AdjacencyMatrix", "[", "G", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"GraphicsRow", "[", " ", RowBox[{"{", RowBox[{"Gplot", ",", "Adj"}], "}"}], "]"}]}], "Input", CellChangeTimes->{{3.619324968502533*^9, 3.619325006059704*^9}, { 3.6193250380972147`*^9, 3.6193250654062157`*^9}, {3.650883584265089*^9, 3.65088358586613*^9}, {3.650883624224807*^9, 3.650883626516548*^9}, { 3.6508836791802187`*^9, 3.650883721594861*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"GraphicsRow", "[", RowBox[{"{", RowBox[{ RowBox[{"Text", "[", "\"\\"", "]"}], ",", "Gplot", ",", RowBox[{"Text", "[", "\"\\"", "]"}], ",", "Adj"}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.619325205317028*^9, 3.619325272063368*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Random Graphs", "Section", CellChangeTimes->{{3.6187612672205887`*^9, 3.6187612699488792`*^9}}], Cell[CellGroupData[{ Cell[TextData[StyleBox["We can construct a random graph using a random matrix \ with 0 and 1.", "Subsubsection"]], "Subsection", CellChangeTimes->{{3.618761287988117*^9, 3.6187613080273533`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Ri", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomInteger", "[", "]"}], ",", RowBox[{"{", "4", "}"}], ",", RowBox[{"{", "4", "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6187613198450537`*^9, 3.6187613480138474`*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "1"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{{3.618761882501556*^9, 3.618761911475359*^9}, 3.619148305413032*^9, 3.619157385514531*^9, {3.61915750573964*^9, 3.6191575259177027`*^9}, 3.619161048439355*^9, 3.6191610942282457`*^9}, FontSize->16] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MatrixForm", "[", "%", "]"}]], "Input", CellChangeTimes->{{3.695471797494738*^9, 3.6954718056676493`*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "1"}, {"0", "1", "0", "1"}, {"1", "0", "1", "1"}, {"0", "1", "0", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{3.695471839754464*^9}, FontSize->18] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RG", "=", RowBox[{"GraphPlot", "[", RowBox[{"Ri", ",", " ", RowBox[{"VertexLabeling", "\[Rule]", "True"}], ",", " ", RowBox[{"DirectedEdges", "\[Rule]", "True"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.6187613560500603`*^9, 3.6187613696258497`*^9}, { 3.618761799619062*^9, 3.618761820737012*^9}, {3.618761853320917*^9, 3.6187619023934*^9}, {3.618762750940069*^9, 3.618762757752038*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ GraphicsBox[ TagBox[GraphicsComplexBox[{{0.9333992261410657, 0.8688665805294101}, { 1.868189993467873, 0.43484730765149504`}, {0., 0.43398273710533725`}, { 0.9352581888609788, 0.}}, { {RGBColor[0.5, 0., 0.], Arrowheads[{{0.03466130579358838, 0.7}}], ArrowBox[{1, 2}], ArrowBox[{1, 4}], ArrowBox[{2, 4}], ArrowBox[{3, 1}], ArrowBox[{3, 4}], ArrowBox[{4, 2}]}, {InsetBox[ FrameBox["1", Background->RGBColor[1, 1, 0.8], FrameStyle->RGBColor[0.94, 0.85, 0.36], StripOnInput->False], 1], InsetBox[ FrameBox["2", Background->RGBColor[1, 1, 0.8], FrameStyle->RGBColor[0.94, 0.85, 0.36], StripOnInput->False], 2], InsetBox[ FrameBox["3", Background->RGBColor[1, 1, 0.8], FrameStyle->RGBColor[0.94, 0.85, 0.36], StripOnInput->False], 3], InsetBox[ FrameBox["4", Background->RGBColor[1, 1, 0.8], FrameStyle->RGBColor[0.94, 0.85, 0.36], StripOnInput->False], 4]}}], Annotation[#, VertexCoordinateRules -> {{0.9333992261410657, 0.8688665805294101}, { 1.868189993467873, 0.43484730765149504`}, {0., 0.43398273710533725`}, { 0.9352581888609788, 0.}}]& ], AspectRatio->Automatic, FrameTicks->None, PlotRange->All, PlotRangePadding->Scaled[0.1]]], "Output", CellChangeTimes->{ 3.61876178972199*^9, 3.618761825671589*^9, {3.618761856187043*^9, 3.618761913389724*^9}, 3.618762759913122*^9, 3.619148310191326*^9, 3.619157389683135*^9, {3.619157509615676*^9, 3.619157528938414*^9}, 3.619161051610915*^9, 3.6191610982853823`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " also has a command for building random undirected graphs: \n", StyleBox["RandomGraph[{m,n}] --", FontColor->GrayLevel[0]], " where m is the number of vertices and n is the number of edges.\n", StyleBox["RandomGraph[{m,n},k] --", FontColor->GrayLevel[0]], " generates k random graphs with m vertices and n edges.\nIf we want to make \ the graph directed, we need to set the attribute DirectedEdges to True.\n" }], "Subsubsection", CellChangeTimes->{ 3.619325727796644*^9, {3.619327161865158*^9, 3.619327204524979*^9}, 3.654480298365694*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RandomGraph", "[", RowBox[{"{", RowBox[{"5", ",", "7"}], "}"}], "]"}]], "Input", FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ GraphicsBox[ NamespaceBox["NetworkGraphics", DynamicModuleBox[{Typeset`graph = HoldComplete[ Graph[{1, 2, 3, 4, 5}, {Null, SparseArray[ Automatic, {5, 5}, 0, { 1, {{0, 4, 6, 8, 12, 14}, {{2}, {3}, {4}, {5}, {1}, {4}, {1}, {4}, { 1}, {2}, {3}, {5}, {1}, {4}}}, Pattern}]}]]}, TagBox[ GraphicsGroupBox[ GraphicsComplexBox[{{0.7062565748432121, 0.44835114471182963`}, {0., 0.}, {1.7139285311430195`, 0.7333740987218709}, {0.7067542461349229, 1.0207039054680607`}, {0.002714255284594236, 1.4704689916773641`}}, { {Hue[0.6, 0.7, 0.5], Opacity[0.7], {Arrowheads[0.], ArrowBox[{1, 2}, 0.020247225036816086`]}, {Arrowheads[0.], ArrowBox[{1, 3}, 0.020247225036816086`]}, {Arrowheads[0.], ArrowBox[{1, 4}, 0.020247225036816086`]}, {Arrowheads[0.], ArrowBox[{1, 5}, 0.020247225036816086`]}, {Arrowheads[0.], ArrowBox[{2, 4}, 0.020247225036816086`]}, {Arrowheads[0.], ArrowBox[{3, 4}, 0.020247225036816086`]}, {Arrowheads[0.], ArrowBox[{4, 5}, 0.020247225036816086`]}}, {Hue[0.6, 0.2, 0.8], EdgeForm[{GrayLevel[0], Opacity[0.7]}], DiskBox[1, 0.020247225036816086], DiskBox[2, 0.020247225036816086], DiskBox[3, 0.020247225036816086], DiskBox[4, 0.020247225036816086], DiskBox[5, 0.020247225036816086]}}]], MouseAppearanceTag["NetworkGraphics"]], AllowKernelInitialization->False]], DefaultBaseStyle->{ "NetworkGraphics", FrontEnd`GraphicsHighlightColor -> Hue[0.8, 1., 0.6]}, FrameTicks->None, GridLinesStyle->Directive[ GrayLevel[0.5, 0.4]], ImageSize->{Automatic, 231.10024854270398`}]], "Output", CellChangeTimes->{3.619325823255753*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RandomGraph", "[", RowBox[{ RowBox[{"{", RowBox[{"5", ",", "7"}], "}"}], ",", RowBox[{"DirectedEdges", "->", "True"}]}], "]"}]], "Input", CellChangeTimes->{{3.6193272354309797`*^9, 3.619327256354621*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ GraphicsBox[ NamespaceBox["NetworkGraphics", DynamicModuleBox[{Typeset`graph = HoldComplete[ Graph[{1, 2, 3, 4, 5}, { SparseArray[ Automatic, {5, 5}, 0, { 1, {{0, 1, 2, 3, 5, 7}, {{5}, {3}, {2}, {1}, {2}, {2}, {4}}}, Pattern}], Null}]]}, TagBox[GraphicsGroupBox[GraphicsComplexBox[CompressedData[" 1:eJxTTMoPSmViYGBQBWIQrXDYrJ91L7vDtLafVo7J1+21+X7ePXP1o333yh+6 N1Kv2zNAAUs9n/yblOv2fQ53t9ecZXCI42+Un5Xy3P7hXbXdFWcYHGDq7m9g +Wzw/L39nz2t3MsOXbFfZbrqtP/Hd/bf/gT9W618xV78mLHE0+9v7Vt6LnW1 zrlsb3+osLXl9xv7JBG5bU26l+1TU942HP7z2v7FnAqrp9cu2W/szn9g8eeV /RLOlIQHMy7Zs1hv6qj59dLe6IvzgxnFl+yj1xQKq/94Yd/wYP4ZlfRL9itv h8SypV+1f2LqlHAs7ZJ9wOepCtFJl+3j/m+W0AWqL1k0qeph3EX7F9ZdrulA 886sXGU3dfc5+wAtxTtxQPscP3Ru6jlwyl5j5nvt9zqX7TNVelexnD9mb8fj 8OXJ7Mv2am/tHgS9PGR/xLmz6Z/SFXuJDHaxHuV99st0Q26+PnjFfk90trsb kD8lu9FRjuOW/dZZ8gfVgepnaW/xk1h+y54h8mffpXPH7HnmmByy07ttH5fB eCsEaJ+uyMtpjnNv2x+7L/QmAuieFd19Qvc/37b3VmTdfhDo3jdyi988Nrxj v/RQfZoV0D+xJodztMPv2P+4zxD4NO2qvYBHesP85Dv2Tevce8WA4bHm05E3 f4H89UrLtXOA4WWsGWwyHahe9vSKfxrA8FzxpoY91uiO/ZNC95wtwPB2+Pe0 IPXLbXv3Bf79ZcD4yOwXV7wKdI/NZb+JN4DxFSRzPOI+0L28iY+YXYHxeeZJ 7amjQP+E6BtaagDj+9WvTcU3gP4FAHYaLEk= "], { {Hue[0.6, 0.7, 0.5], Opacity[0.7], Arrowheads[0.02906979448908239], ArrowBox[{1, 5}, 0.03000452930118265], ArrowBox[BezierCurveBox[{ 2, {0.5573579196357294, 0.18226128990869128`}, 3}], 0.03000452930118265], ArrowBox[BezierCurveBox[{ 3, {0.5573394099632059, 0.5488646134332443}, 2}], 0.03000452930118265], ArrowBox[{4, 1}, 0.03000452930118265], ArrowBox[{4, 2}, 0.03000452930118265], ArrowBox[{5, 2}, 0.03000452930118265], ArrowBox[{5, 4}, 0.03000452930118265]}, {Hue[0.6, 0.2, 0.8], EdgeForm[{GrayLevel[0], Opacity[0.7]}], DiskBox[1, 0.03000452930118265], DiskBox[2, 0.03000452930118265], DiskBox[3, 0.03000452930118265], DiskBox[4, 0.03000452930118265], DiskBox[5, 0.03000452930118265]}}]], MouseAppearanceTag["NetworkGraphics"]], AllowKernelInitialization->False]], DefaultBaseStyle->{ "NetworkGraphics", FrontEnd`GraphicsHighlightColor -> Hue[0.8, 1., 0.6]}, FrameTicks->None, GridLinesStyle->Directive[ GrayLevel[0.5, 0.4]]]], "Output", CellChangeTimes->{3.6193272591606903`*^9}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " can also generate graphs with a special form, for instance graphs for \ which any two vertices are connected by an edge; these are called complete \ graphs)." }], "Subsubsection", CellChangeTimes->{{3.61932655171364*^9, 3.61932662734085*^9}}], Cell[BoxData[ RowBox[{"CompleteGraph", "[", "5", "]"}]], "Code", CellChangeTimes->{{3.619326638861352*^9, 3.619326652019862*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Properties of Graphs - Strong Connectivity", "Section", CellChangeTimes->{{3.618761972537057*^9, 3.6187619770155163`*^9}, 3.618762045800455*^9, 3.619149353940484*^9, {3.650885442495215*^9, 3.650885448694189*^9}}], Cell[TextData[{ StyleBox["Definition:", FontColor->RGBColor[0., 0., 0.]], StyleBox[" ", FontColor->GrayLevel[0]], "A graph is ", StyleBox["connected", FontColor->GrayLevel[0]], " if for any two vertices u and v, there is a path in the graph from u to v \ OR from v to u. A graph is ", StyleBox["strongly connected", FontColor->GrayLevel[0]], " if for any two vertices u and v, there is a path in the graph from u to v \ AND from v to u." }], "Subsubsection", CellChangeTimes->{{3.618762135116743*^9, 3.61876223128712*^9}, { 3.61876268276436*^9, 3.618762694659878*^9}}], Cell[TextData[{ StyleBox["Proposition:", FontColor->GrayLevel[0]], " Let G be a graph and A its adjacency matrix. If there is a positive \ integer k such that the matrix S = ", Cell[BoxData[ FormBox[ RowBox[{"I", "+", "A"}], TraditionalForm]]], " + ", Cell[BoxData[ FormBox[ SuperscriptBox["A", "2"], TraditionalForm]]], " + ", Cell[BoxData[ FormBox[ SuperscriptBox["A", "3"], TraditionalForm]]], " + \[Ellipsis] +", Cell[BoxData[ FormBox[ SuperscriptBox["A", "k"], TraditionalForm]]], " is positive (has only positive entries), then the graph is strongly \ connected." }], "Subsubsection", CellChangeTimes->{{3.618762468040743*^9, 3.6187625958164473`*^9}, { 3.619159303736907*^9, 3.619159318989758*^9}, 3.619325936339699*^9}], Cell[TextData[{ StyleBox["Idea of the proof: ", FontColor->GrayLevel[0]], Cell[BoxData[ FormBox[ RowBox[{ "The", " ", "entry", " ", "on", " ", "row", " ", "i", " ", "and", " ", "column", " ", "j", " ", "of", " ", "the", " ", "matrix", " ", SuperscriptBox["A", "k"]}], TraditionalForm]]], " represents the number of paths of length k from i to j. If the (i,j) entry \ is positive, it means that there exists at least one path of length k from i \ to j. \n" }], "Subsubsection", CellChangeTimes->{{3.618762654165656*^9, 3.618762674268544*^9}, { 3.618762713963168*^9, 3.6187627314901237`*^9}, {3.6187627711226482`*^9, 3.6187628893798847`*^9}, 3.619148144356516*^9, {3.6508841058940697`*^9, 3.650884106235435*^9}}], Cell[TextData[{ StyleBox["Testing strong connectivity using the adjacency matrix and ", FontColor->GrayLevel[0]], StyleBox["Mathematica", FontSlant->"Italic", FontColor->GrayLevel[0]], StyleBox[": ", FontColor->GrayLevel[0]] }], "Subsubsection", CellChangeTimes->{{3.618762941529834*^9, 3.618762978448453*^9}, { 3.6193282689815474`*^9, 3.619328274096846*^9}}], Cell[CellGroupData[{ Cell[TextData[{ "First we compute S= ", Cell[BoxData[ FormBox[ RowBox[{"I", "+", "A"}], TraditionalForm]]], " + ", Cell[BoxData[ FormBox[ SuperscriptBox["A", "2"], TraditionalForm]]], " + ", Cell[BoxData[ FormBox[ SuperscriptBox["A", "3"], TraditionalForm]]], " + \[Ellipsis] +", Cell[BoxData[ FormBox[ SuperscriptBox["A", "k"], TraditionalForm]]], ". It\[CloseCurlyQuote]s enough to consider k=dimension(A)" }], "Subsubsection", CellChangeTimes->{{3.619327363440502*^9, 3.619327416796204*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"S", "=", RowBox[{ RowBox[{"IdentityMatrix", "[", RowBox[{"Length", "[", "Ri", "]"}], "]"}], "+", RowBox[{"Sum", "[", RowBox[{ RowBox[{"MatrixPower", "[", RowBox[{"Ri", ",", "k"}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", RowBox[{"Length", "[", "Ri", "]"}]}], "}"}]}], " ", "]"}]}]}]], "Input",\ CellChangeTimes->{{3.61876303699631*^9, 3.618763045838484*^9}, { 3.618763324854116*^9, 3.6187633257472878`*^9}, {3.619148195449411*^9, 3.619148284217455*^9}, {3.61915911810667*^9, 3.619159166584352*^9}, { 3.619159357482925*^9, 3.619159358459538*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "15", ",", "0", ",", "15"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "16", ",", "0", ",", "15"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "22", ",", "5", ",", "26"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "15", ",", "0", ",", "16"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{{3.619148273719966*^9, 3.619148285225007*^9}, 3.619148319810979*^9, 3.619157372808556*^9, 3.619157404564996*^9, 3.619157535619934*^9, 3.619157673098894*^9, {3.619159120963436*^9, 3.619159169271799*^9}, 3.619159360453524*^9, 3.619161059958802*^9, 3.61916110570935*^9}, FontSize->16] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Now we must check the entries of the matrix S to see if there are any 0 \ elements. If for some i and j the (i,j) entry is equal to 0, it means that \ there is no path from node i to node j, so the graph is not strongly connected. \ \>", "Subsubsection", CellChangeTimes->{{3.6193261396587143`*^9, 3.619326246844105*^9}, { 3.619326291765854*^9, 3.619326349439982*^9}, {3.650885280138762*^9, 3.650885281587146*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"con", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"S", "[", RowBox[{"[", "i", "]"}], "]"}], "[", RowBox[{"[", "j", "]"}], "]"}], "==", "0"}], ",", RowBox[{ RowBox[{"con", "=", "0"}], ";", RowBox[{"Break", "[", "]"}]}]}], "]"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "4"}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"con", ">", "0"}], ",", RowBox[{"Print", "[", "\"\\"", "]"}], ",", RowBox[{"Print", "[", "\"\\"", "]"}]}], "]"}]}], "Input", CellChangeTimes->{{3.619159864047612*^9, 3.619159879187243*^9}, { 3.61916102512617*^9, 3.619161030332326*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData["\<\"Not strongly connected\"\>"], "Print", CellChangeTimes->{3.6191598409689198`*^9, 3.619161067435416*^9, 3.6191611107068577`*^9}, FontSize->16] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"con", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"S", "[", RowBox[{"[", "i", "]"}], "]"}], "[", RowBox[{"[", "j", "]"}], "]"}], "==", "0"}], ",", RowBox[{ RowBox[{"con", "=", "0"}], ";", " ", RowBox[{"Return", "[", RowBox[{"{", RowBox[{"i", ",", "j"}], "}"}], "]"}]}]}], "]"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "4"}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"con", ">", "0"}], ",", RowBox[{"Print", "[", "\"\\"", "]"}], ",", " ", RowBox[{"Row", "[", RowBox[{"{", RowBox[{ "\"\\"", ",", RowBox[{"%", "[", RowBox[{"[", "1", "]"}], "]"}], ",", "\"\< to node \>\"", ",", RowBox[{"%", "[", RowBox[{"[", "2", "]"}], "]"}]}], "}"}], "]"}]}], "]"}]}], "Input", CellChangeTimes->{{3.618763512170972*^9, 3.618763526187106*^9}, { 3.6191574457146053`*^9, 3.6191574890436563`*^9}, {3.619157689429244*^9, 3.619157778919546*^9}, {3.61915790723182*^9, 3.619157911235434*^9}, { 3.6191579416697702`*^9, 3.619157954899959*^9}, {3.619158479417226*^9, 3.6191585723784103`*^9}, {3.619158611778282*^9, 3.619158616554545*^9}, { 3.619158658953081*^9, 3.619158857217448*^9}, {3.619159065033543*^9, 3.619159111851839*^9}, {3.619159383790454*^9, 3.619159385511989*^9}, { 3.619159610821959*^9, 3.619159635161975*^9}, {3.6191598862365723`*^9, 3.61915990589081*^9}, {3.619161073675644*^9, 3.619161078362735*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ TemplateBox[{ "\"Not strongly connected, for example, there is no path from node \"","1", "\" to node \"","3"}, "RowDefault"]], "Output", CellChangeTimes->{3.619159794621035*^9, 3.6191599158380537`*^9, 3.619161082346023*^9, 3.6191611163967113`*^9}, FontSize->16] }, Open ]] }, Open ]], Cell[TextData[{ StyleBox["Comments about the previous code:", FontColor->GrayLevel[0]], " First we assume that the graph is strongly connected, so we introduce a \ variable con and make it equal to 1. We use a Do loop to check whether there \ are any 0 entries in the matrix S. Notice the use of Return[{i,j}] in the Do \ loop. When the first 0 element of the matrix S is found, we set con to 0, \ exit the Do loop and return the pair {i,j}. We can later use {i,j} to \ indicate that the graph fails to be strongly connected because there is no \ path from node %[[1]] to node %[[2]]. If no element of the matrix is 0, then \ the value of the variable con is never changed, so it remains equal to 1 \ after the Do command." }], "Subsubsection", CellChangeTimes->{{3.6193261396587143`*^9, 3.619326246844105*^9}, { 3.619326291765854*^9, 3.619326349439982*^9}, {3.619388959587914*^9, 3.6193895679240227`*^9}}, TextJustification->1.] }, Open ]], Cell[CellGroupData[{ Cell["Connected components of a graph", "Section", CellChangeTimes->{{3.6193347856154823`*^9, 3.6193347964530277`*^9}}], Cell[CellGroupData[{ Cell[TextData[{ "\nWe can also use ", StyleBox["Mathematica", FontSlant->"Italic"], " to get the connected components of a graph:" }], "Subsubsection", CellChangeTimes->{{3.619328153385494*^9, 3.619328191476115*^9}, 3.619328298351815*^9}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Gr", "=", RowBox[{"RandomGraph", "[", RowBox[{ RowBox[{"{", RowBox[{"10", ",", "20"}], "}"}], ",", " ", RowBox[{"DirectedEdges", "\[Rule]", "True"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"ConnectedComponents", "[", "Gr", "]"}], "\[IndentingNewLine]", RowBox[{"HighlightGraph", "[", RowBox[{"Gr", ",", RowBox[{"ConnectedComponents", "[", "Gr", "]"}]}], "]"}]}], "Input", CellChangeTimes->{{3.6193226731434727`*^9, 3.61932273640766*^9}, { 3.6193227907990932`*^9, 3.619322822884901*^9}, {3.619322883081799*^9, 3.619322902472224*^9}, {3.619327064615128*^9, 3.619327112386265*^9}, 3.6193276702308598`*^9, {3.619327728769772*^9, 3.619327731088109*^9}, { 3.61932787967618*^9, 3.61932788114653*^9}, {3.619327939287117*^9, 3.6193279522557993`*^9}, {3.619328101948112*^9, 3.619328119133338*^9}, { 3.619328216141069*^9, 3.619328216948924*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "2", ",", "5", ",", "6", ",", "7", ",", "8", ",", "9", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3", ",", "4"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{{3.619328198557918*^9, 3.619328220128673*^9}}, FontSize->16] }, Open ]], Cell[BoxData[ GraphicsBox[ NamespaceBox["NetworkGraphics", DynamicModuleBox[{Typeset`graph = HoldComplete[ Graph[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, { SparseArray[ Automatic, {10, 10}, 0, { 1, {{0, 2, 4, 6, 10, 11, 12, 15, 17, 19, 20}, {{3}, {9}, {5}, {7}, { 4}, {7}, {1}, {2}, {3}, {8}, {9}, {7}, {2}, {8}, {10}, {6}, {7}, { 2}, {10}, {2}}}, Pattern}], Null}, { GraphHighlight -> {10, 1, 5, 6, 9, 2, 7, 8, 3, 4}, GraphHighlightStyle -> { 4 -> {VertexStyle -> Hue[0.14, 1, 0.9]}, 1 -> {VertexStyle -> Hue[0.14, 1, 0.9]}, 2 -> {VertexStyle -> Hue[0, 1, 0.8]}, 10 -> {VertexStyle -> Hue[0, 1, 0.8]}, 5 -> {VertexStyle -> Hue[0, 1, 0.8]}, 3 -> {VertexStyle -> Hue[0.14, 1, 0.9]}, 9 -> {VertexStyle -> Hue[0, 1, 0.8]}, 6 -> {VertexStyle -> Hue[0, 1, 0.8]}, 8 -> {VertexStyle -> Hue[0, 1, 0.8]}, 7 -> {VertexStyle -> Hue[0, 1, 0.8]}}, GraphStyle -> "SmallNetwork", GridLinesStyle -> Directive[ GrayLevel[0.5, 0.4]]}]], Typeset`boxes, Typeset`boxes$s2d = GraphicsGroupBox[{{ Directive[ Hue[0.625, 0.5, 0.7], Thickness[Large], Opacity[1]], { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$1", Automatic, Center], DynamicLocation["VertexID$3", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$1", Automatic, Center], DynamicLocation["VertexID$9", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$2", Automatic, Center], DynamicLocation["VertexID$5", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$2", Automatic, Center], { 1.6896960804507715`, 1.0979972619527258`}, DynamicLocation["VertexID$7", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$3", Automatic, Center], { 1.240524271920901, 0.3194058871079309}, DynamicLocation["VertexID$4", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$3", Automatic, Center], DynamicLocation["VertexID$7", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$1", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$4", Automatic, Center], { 1.4174871100830844`, 0.2543178033322432}, DynamicLocation["VertexID$3", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$8", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$5", Automatic, Center], DynamicLocation["VertexID$9", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$6", Automatic, Center], DynamicLocation["VertexID$7", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$7", Automatic, Center], { 1.7095745368526702`, 1.4791793714739359`}, DynamicLocation["VertexID$2", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$7", Automatic, Center], { 0.7816150100871349, 1.0296175285527305`}, DynamicLocation["VertexID$8", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$7", Automatic, Center], DynamicLocation["VertexID$10", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$8", Automatic, Center], DynamicLocation["VertexID$6", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$8", Automatic, Center], { 0.6760422141885037, 1.286996133211445}, DynamicLocation["VertexID$7", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$9", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$9", Automatic, Center], DynamicLocation["VertexID$10", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$10", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}}, { Directive[ Hue[0.125, 0.7, 0.9], EdgeForm[]], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{ 2.158202911154472, -0.09251945399523162}, { 2.250722365149704, -0.09251945399523162}, { 2.2969820921473194`, -0.09251945399523162}, { 2.2969820921473194`, -0.04625972699761581}, {2.2969820921473194`, 0.04625972699761581}, {2.2969820921473194`, 0.09251945399523162}, {2.250722365149704, 0.09251945399523162}, { 2.158202911154472, 0.09251945399523162}, {2.1119431841568566`, 0.09251945399523162}, {2.1119431841568566`, 0.04625972699761581}, { 2.1119431841568566`, -0.04625972699761581}, { 2.1119431841568566`, -0.09251945399523162}, { 2.158202911154472, -0.09251945399523162}}}], Hue[0.14, 1, 0.9], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$1"], InsetBox[ FormBox["1", TraditionalForm], DynamicLocation["VertexID$1", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$1"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{2.2328884397051865`, 1.1658475569548437`}, {2.3254078937004183`, 1.1658475569548437`}, {2.371667620698034, 1.1658475569548437`}, { 2.371667620698034, 1.2121072839524596`}, {2.371667620698034, 1.304626737947691}, {2.371667620698034, 1.350886464945307}, { 2.3254078937004183`, 1.350886464945307}, {2.2328884397051865`, 1.350886464945307}, {2.186628712707571, 1.350886464945307}, { 2.186628712707571, 1.304626737947691}, {2.186628712707571, 1.2121072839524596`}, {2.186628712707571, 1.1658475569548437`}, { 2.2328884397051865`, 1.1658475569548437`}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$2"], InsetBox[ FormBox["2", TraditionalForm], DynamicLocation["VertexID$2", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$2"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{ 1.1837922604811633`, -0.07469499943650335}, { 1.2763117144763947`, -0.07469499943650335}, { 1.3225714414740106`, -0.07469499943650335}, { 1.3225714414740106`, -0.028435272438887535`}, { 1.3225714414740106`, 0.06408418155634409}, {1.3225714414740106`, 0.1103439085539599}, {1.2763117144763947`, 0.1103439085539599}, { 1.1837922604811633`, 0.1103439085539599}, {1.1375325334835473`, 0.1103439085539599}, {1.1375325334835473`, 0.06408418155634409}, { 1.1375325334835473`, -0.028435272438887535`}, { 1.1375325334835473`, -0.07469499943650335}, { 1.1837922604811633`, -0.07469499943650335}}}], Hue[0.14, 1, 0.9], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$3"], InsetBox[ FormBox["3", TraditionalForm], DynamicLocation["VertexID$3", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$3"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.3816996675275905`, 0.4633797818861962}, {1.474219121522822, 0.4633797818861962}, { 1.520478848520438, 0.4633797818861962}, {1.520478848520438, 0.509639508883812}, {1.520478848520438, 0.6021589628790437}, { 1.520478848520438, 0.6484186898766595}, {1.474219121522822, 0.6484186898766595}, {1.3816996675275905`, 0.6484186898766595}, { 1.3354399405299746`, 0.6484186898766595}, {1.3354399405299746`, 0.6021589628790437}, {1.3354399405299746`, 0.509639508883812}, { 1.3354399405299746`, 0.4633797818861962}, {1.3816996675275905`, 0.4633797818861962}}}], Hue[0.14, 1, 0.9], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$4"], InsetBox[ FormBox["4", TraditionalForm], DynamicLocation["VertexID$4", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$4"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{3.426682103864904, 1.39698375920483}, {3.5192015578601357`, 1.39698375920483}, { 3.565461284857751, 1.39698375920483}, {3.565461284857751, 1.443243486202446}, {3.565461284857751, 1.5357629401976773`}, { 3.565461284857751, 1.5820226671952933`}, {3.5192015578601357`, 1.5820226671952933`}, {3.426682103864904, 1.5820226671952933`}, { 3.3804223768672883`, 1.5820226671952933`}, {3.3804223768672883`, 1.5357629401976773`}, {3.3804223768672883`, 1.443243486202446}, { 3.3804223768672883`, 1.39698375920483}, {3.426682103864904, 1.39698375920483}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$5"], InsetBox[ FormBox["5", TraditionalForm], DynamicLocation["VertexID$5", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$5"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{-0.04625972699761581, 1.6360429723221157`}, {0.04625972699761581, 1.6360429723221157`}, {0.09251945399523162, 1.6360429723221157`}, {0.09251945399523162, 1.6823026993197316`}, {0.09251945399523162, 1.774822153314963}, { 0.09251945399523162, 1.821081880312579}, {0.04625972699761581, 1.821081880312579}, {-0.04625972699761581, 1.821081880312579}, {-0.09251945399523162, 1.821081880312579}, {-0.09251945399523162, 1.774822153314963}, {-0.09251945399523162, 1.6823026993197316`}, {-0.09251945399523162, 1.6360429723221157`}, {-0.04625972699761581, 1.6360429723221157`}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$6"], InsetBox[ FormBox["6", TraditionalForm], DynamicLocation["VertexID$6", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$6"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.073862723603023, 1.226290168480281}, {1.1663821775982544`, 1.226290168480281}, { 1.2126419045958703`, 1.226290168480281}, {1.2126419045958703`, 1.2725498954778969`}, {1.2126419045958703`, 1.3650693494731283`}, {1.2126419045958703`, 1.4113290764707442`}, {1.1663821775982544`, 1.4113290764707442`}, {1.073862723603023, 1.4113290764707442`}, { 1.027602996605407, 1.4113290764707442`}, {1.027602996605407, 1.3650693494731283`}, {1.027602996605407, 1.2725498954778969`}, { 1.027602996605407, 1.226290168480281}, {1.073862723603023, 1.226290168480281}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$7"], InsetBox[ FormBox["7", TraditionalForm], DynamicLocation["VertexID$7", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$7"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{0.29127504667739, 0.9052845852927082}, {0.38379450067262166`, 0.9052845852927082}, { 0.4300542276702375, 0.9052845852927082}, {0.4300542276702375, 0.951544312290324}, {0.4300542276702375, 1.0440637662855556`}, { 0.4300542276702375, 1.0903234932831714`}, {0.38379450067262166`, 1.0903234932831714`}, {0.29127504667739, 1.0903234932831714`}, { 0.24501531967977422`, 1.0903234932831714`}, {0.24501531967977422`, 1.0440637662855556`}, {0.24501531967977422`, 0.951544312290324}, {0.24501531967977422`, 0.9052845852927082}, { 0.29127504667739, 0.9052845852927082}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$8"], InsetBox[ FormBox["8", TraditionalForm], DynamicLocation["VertexID$8", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$8"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{2.842032781999416, 0.8633136199583784}, {2.934552235994648, 0.8633136199583784}, { 2.9808119629922634`, 0.8633136199583784}, {2.9808119629922634`, 0.9095733469559942}, {2.9808119629922634`, 1.0020928009512258`}, { 2.9808119629922634`, 1.0483525279488417`}, {2.934552235994648, 1.0483525279488417`}, {2.842032781999416, 1.0483525279488417`}, { 2.7957730550018005`, 1.0483525279488417`}, {2.7957730550018005`, 1.0020928009512258`}, {2.7957730550018005`, 0.9095733469559942}, { 2.7957730550018005`, 0.8633136199583784}, {2.842032781999416, 0.8633136199583784}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$9"], InsetBox[ FormBox["9", TraditionalForm], DynamicLocation["VertexID$9", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$9"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{2.103248416751825, 1.7513673160827352`}, {2.1957678707470567`, 1.7513673160827352`}, {2.242027597744672, 1.7513673160827352`}, { 2.242027597744672, 1.7976270430803512`}, {2.242027597744672, 1.8901464970755826`}, {2.242027597744672, 1.9364062240731985`}, { 2.1957678707470567`, 1.9364062240731985`}, {2.103248416751825, 1.9364062240731985`}, {2.0569886897542093`, 1.9364062240731985`}, {2.0569886897542093`, 1.8901464970755826`}, {2.0569886897542093`, 1.7976270430803512`}, {2.0569886897542093`, 1.7513673160827352`}, {2.103248416751825, 1.7513673160827352`}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$10"], InsetBox[ FormBox["10", TraditionalForm], DynamicLocation["VertexID$10", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$10"]}}], $CellContext`flag}, TagBox[ DynamicBox[GraphComputation`NetworkGraphicsBox[ 3, Typeset`graph, Typeset`boxes, $CellContext`flag], { CachedValue :> Typeset`boxes, SingleEvaluation -> True, SynchronousUpdating -> False, TrackedSymbols :> {$CellContext`flag}}, ImageSizeCache->{{3.760693309010094, 355.2393066909899}, {-101.2393066909899, 97.2393066909899}}], MouseAppearanceTag["NetworkGraphics"]], AllowKernelInitialization->False, UnsavedVariables:>{$CellContext`flag}]], DefaultBaseStyle->{ "NetworkGraphics", FrontEnd`GraphicsHighlightColor -> Hue[0.8, 1., 0.6]}, FrameTicks->None, GridLinesStyle->Directive[ GrayLevel[0.5, 0.4]]]], "Input", CellChangeTimes->{{3.6193282457693367`*^9, 3.6193282458158827`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " lets you copy the graph and use it anywhere else in your code. You can \ even assign it to some other variable, or use it in computations." }], "Subsubsection", CellChangeTimes->{{3.619329106784422*^9, 3.6193291541405773`*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"Grrr", "=", GraphicsBox[ NamespaceBox["NetworkGraphics", DynamicModuleBox[{Typeset`graph = HoldComplete[ Graph[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, { SparseArray[ Automatic, {10, 10}, 0, { 1, {{0, 2, 4, 6, 10, 11, 12, 15, 17, 19, 20}, {{3}, {9}, {5}, {7}, { 4}, {7}, {1}, {2}, {3}, {8}, {9}, {7}, {2}, {8}, {10}, {6}, {7}, { 2}, {10}, {2}}}, Pattern}], Null}, { GraphHighlight -> {10, 1, 5, 6, 9, 2, 7, 8, 3, 4}, GraphHighlightStyle -> { 4 -> {VertexStyle -> Hue[0.14, 1, 0.9]}, 1 -> {VertexStyle -> Hue[0.14, 1, 0.9]}, 2 -> {VertexStyle -> Hue[0, 1, 0.8]}, 10 -> {VertexStyle -> Hue[0, 1, 0.8]}, 5 -> {VertexStyle -> Hue[0, 1, 0.8]}, 3 -> {VertexStyle -> Hue[0.14, 1, 0.9]}, 9 -> {VertexStyle -> Hue[0, 1, 0.8]}, 6 -> {VertexStyle -> Hue[0, 1, 0.8]}, 8 -> {VertexStyle -> Hue[0, 1, 0.8]}, 7 -> {VertexStyle -> Hue[0, 1, 0.8]}}, GraphStyle -> "SmallNetwork", GridLinesStyle -> Directive[ GrayLevel[0.5, 0.4]]}]], Typeset`boxes, Typeset`boxes$s2d = GraphicsGroupBox[{{ Directive[ Hue[0.625, 0.5, 0.7], Thickness[Large], Opacity[1]], { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$1", Automatic, Center], DynamicLocation["VertexID$3", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$1", Automatic, Center], DynamicLocation["VertexID$9", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$2", Automatic, Center], DynamicLocation["VertexID$5", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$2", Automatic, Center], { 1.6896960804507715`, 1.0979972619527258`}, DynamicLocation["VertexID$7", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$3", Automatic, Center], { 1.240524271920901, 0.3194058871079309}, DynamicLocation["VertexID$4", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$3", Automatic, Center], DynamicLocation["VertexID$7", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$1", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$4", Automatic, Center], { 1.4174871100830844`, 0.2543178033322432}, DynamicLocation["VertexID$3", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$4", Automatic, Center], DynamicLocation["VertexID$8", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$5", Automatic, Center], DynamicLocation["VertexID$9", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$6", Automatic, Center], DynamicLocation["VertexID$7", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$7", Automatic, Center], { 1.7095745368526702`, 1.4791793714739359`}, DynamicLocation["VertexID$2", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$7", Automatic, Center], { 0.7816150100871349, 1.0296175285527305`}, DynamicLocation["VertexID$8", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$7", Automatic, Center], DynamicLocation["VertexID$10", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$8", Automatic, Center], DynamicLocation["VertexID$6", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[ BezierCurveBox[{ DynamicLocation["VertexID$8", Automatic, Center], { 0.6760422141885037, 1.286996133211445}, DynamicLocation["VertexID$7", Automatic, Center]}]]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$9", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$9", Automatic, Center], DynamicLocation["VertexID$10", Automatic, Center]}]}, { Arrowheads[{{0.04, 1, { GraphicsBox[ FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{-0.6666528591843921, -0.3333333333333333}, \ {-0.533327810340424, 6.903741136987662*^-6}, {-0.6666528591843921, 0.3333333333333333}, {0., 6.903741136987662*^-6}}}]], 0.533327810340424}}}], ArrowBox[{ DynamicLocation["VertexID$10", Automatic, Center], DynamicLocation["VertexID$2", Automatic, Center]}]}}, { Directive[ Hue[0.125, 0.7, 0.9], EdgeForm[]], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{ 2.158202911154472, -0.09251945399523162}, { 2.250722365149704, -0.09251945399523162}, { 2.2969820921473194`, -0.09251945399523162}, { 2.2969820921473194`, -0.04625972699761581}, {2.2969820921473194`, 0.04625972699761581}, {2.2969820921473194`, 0.09251945399523162}, {2.250722365149704, 0.09251945399523162}, { 2.158202911154472, 0.09251945399523162}, {2.1119431841568566`, 0.09251945399523162}, {2.1119431841568566`, 0.04625972699761581}, { 2.1119431841568566`, -0.04625972699761581}, { 2.1119431841568566`, -0.09251945399523162}, { 2.158202911154472, -0.09251945399523162}}}], Hue[0.14, 1, 0.9], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$1"], InsetBox[ FormBox["1", TraditionalForm], DynamicLocation["VertexID$1", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$1"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{2.2328884397051865`, 1.1658475569548437`}, {2.3254078937004183`, 1.1658475569548437`}, {2.371667620698034, 1.1658475569548437`}, { 2.371667620698034, 1.2121072839524596`}, {2.371667620698034, 1.304626737947691}, {2.371667620698034, 1.350886464945307}, { 2.3254078937004183`, 1.350886464945307}, {2.2328884397051865`, 1.350886464945307}, {2.186628712707571, 1.350886464945307}, { 2.186628712707571, 1.304626737947691}, {2.186628712707571, 1.2121072839524596`}, {2.186628712707571, 1.1658475569548437`}, { 2.2328884397051865`, 1.1658475569548437`}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$2"], InsetBox[ FormBox["2", TraditionalForm], DynamicLocation["VertexID$2", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$2"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{ 1.1837922604811633`, -0.07469499943650335}, { 1.2763117144763947`, -0.07469499943650335}, { 1.3225714414740106`, -0.07469499943650335}, { 1.3225714414740106`, -0.028435272438887535`}, { 1.3225714414740106`, 0.06408418155634409}, {1.3225714414740106`, 0.1103439085539599}, {1.2763117144763947`, 0.1103439085539599}, { 1.1837922604811633`, 0.1103439085539599}, {1.1375325334835473`, 0.1103439085539599}, {1.1375325334835473`, 0.06408418155634409}, { 1.1375325334835473`, -0.028435272438887535`}, { 1.1375325334835473`, -0.07469499943650335}, { 1.1837922604811633`, -0.07469499943650335}}}], Hue[0.14, 1, 0.9], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$3"], InsetBox[ FormBox["3", TraditionalForm], DynamicLocation["VertexID$3", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$3"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.3816996675275905`, 0.4633797818861962}, {1.474219121522822, 0.4633797818861962}, { 1.520478848520438, 0.4633797818861962}, {1.520478848520438, 0.509639508883812}, {1.520478848520438, 0.6021589628790437}, { 1.520478848520438, 0.6484186898766595}, {1.474219121522822, 0.6484186898766595}, {1.3816996675275905`, 0.6484186898766595}, { 1.3354399405299746`, 0.6484186898766595}, {1.3354399405299746`, 0.6021589628790437}, {1.3354399405299746`, 0.509639508883812}, { 1.3354399405299746`, 0.4633797818861962}, {1.3816996675275905`, 0.4633797818861962}}}], Hue[0.14, 1, 0.9], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$4"], InsetBox[ FormBox["4", TraditionalForm], DynamicLocation["VertexID$4", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$4"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{3.426682103864904, 1.39698375920483}, {3.5192015578601357`, 1.39698375920483}, { 3.565461284857751, 1.39698375920483}, {3.565461284857751, 1.443243486202446}, {3.565461284857751, 1.5357629401976773`}, { 3.565461284857751, 1.5820226671952933`}, {3.5192015578601357`, 1.5820226671952933`}, {3.426682103864904, 1.5820226671952933`}, { 3.3804223768672883`, 1.5820226671952933`}, {3.3804223768672883`, 1.5357629401976773`}, {3.3804223768672883`, 1.443243486202446}, { 3.3804223768672883`, 1.39698375920483}, {3.426682103864904, 1.39698375920483}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$5"], InsetBox[ FormBox["5", TraditionalForm], DynamicLocation["VertexID$5", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$5"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{-0.04625972699761581, 1.6360429723221157`}, { 0.04625972699761581, 1.6360429723221157`}, {0.09251945399523162, 1.6360429723221157`}, {0.09251945399523162, 1.6823026993197316`}, {0.09251945399523162, 1.774822153314963}, { 0.09251945399523162, 1.821081880312579}, {0.04625972699761581, 1.821081880312579}, {-0.04625972699761581, 1.821081880312579}, {-0.09251945399523162, 1.821081880312579}, {-0.09251945399523162, 1.774822153314963}, {-0.09251945399523162, 1.6823026993197316`}, {-0.09251945399523162, 1.6360429723221157`}, {-0.04625972699761581, 1.6360429723221157`}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$6"], InsetBox[ FormBox["6", TraditionalForm], DynamicLocation["VertexID$6", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$6"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{1.073862723603023, 1.226290168480281}, {1.1663821775982544`, 1.226290168480281}, { 1.2126419045958703`, 1.226290168480281}, {1.2126419045958703`, 1.2725498954778969`}, {1.2126419045958703`, 1.3650693494731283`}, {1.2126419045958703`, 1.4113290764707442`}, {1.1663821775982544`, 1.4113290764707442`}, {1.073862723603023, 1.4113290764707442`}, { 1.027602996605407, 1.4113290764707442`}, {1.027602996605407, 1.3650693494731283`}, {1.027602996605407, 1.2725498954778969`}, { 1.027602996605407, 1.226290168480281}, {1.073862723603023, 1.226290168480281}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$7"], InsetBox[ FormBox["7", TraditionalForm], DynamicLocation["VertexID$7", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$7"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{0.29127504667739, 0.9052845852927082}, {0.38379450067262166`, 0.9052845852927082}, {0.4300542276702375, 0.9052845852927082}, { 0.4300542276702375, 0.951544312290324}, {0.4300542276702375, 1.0440637662855556`}, {0.4300542276702375, 1.0903234932831714`}, {0.38379450067262166`, 1.0903234932831714`}, {0.29127504667739, 1.0903234932831714`}, { 0.24501531967977422`, 1.0903234932831714`}, { 0.24501531967977422`, 1.0440637662855556`}, { 0.24501531967977422`, 0.951544312290324}, {0.24501531967977422`, 0.9052845852927082}, {0.29127504667739, 0.9052845852927082}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$8"], InsetBox[ FormBox["8", TraditionalForm], DynamicLocation["VertexID$8", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$8"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{2.842032781999416, 0.8633136199583784}, {2.934552235994648, 0.8633136199583784}, { 2.9808119629922634`, 0.8633136199583784}, {2.9808119629922634`, 0.9095733469559942}, {2.9808119629922634`, 1.0020928009512258`}, {2.9808119629922634`, 1.0483525279488417`}, {2.934552235994648, 1.0483525279488417`}, { 2.842032781999416, 1.0483525279488417`}, {2.7957730550018005`, 1.0483525279488417`}, {2.7957730550018005`, 1.0020928009512258`}, {2.7957730550018005`, 0.9095733469559942}, {2.7957730550018005`, 0.8633136199583784}, { 2.842032781999416, 0.8633136199583784}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$9"], InsetBox[ FormBox["9", TraditionalForm], DynamicLocation["VertexID$9", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$9"], TagBox[{ TagBox[ StyleBox[ FilledCurveBox[{{{0, 2, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}, {0, 1, 1}, {1, 2, 2}}}, {{{2.103248416751825, 1.7513673160827352`}, {2.1957678707470567`, 1.7513673160827352`}, {2.242027597744672, 1.7513673160827352`}, { 2.242027597744672, 1.7976270430803512`}, {2.242027597744672, 1.8901464970755826`}, {2.242027597744672, 1.9364062240731985`}, { 2.1957678707470567`, 1.9364062240731985`}, {2.103248416751825, 1.9364062240731985`}, {2.0569886897542093`, 1.9364062240731985`}, {2.0569886897542093`, 1.8901464970755826`}, {2.0569886897542093`, 1.7976270430803512`}, {2.0569886897542093`, 1.7513673160827352`}, {2.103248416751825, 1.7513673160827352`}}}], Hue[0, 1, 0.8], StripOnInput -> False], "DynamicName", BoxID -> "VertexID$10"], InsetBox[ FormBox["10", TraditionalForm], DynamicLocation["VertexID$10", None, Center], BaseStyle -> "Graphics"]}, "DynamicName", BoxID -> "VertexLabelID$10"]}}], $CellContext`flag}, TagBox[ DynamicBox[GraphComputation`NetworkGraphicsBox[ 3, Typeset`graph, Typeset`boxes, $CellContext`flag], { CachedValue :> Typeset`boxes, SingleEvaluation -> True, SynchronousUpdating -> False, TrackedSymbols :> {$CellContext`flag}}, ImageSizeCache->{{-2.239306690989927, 90.23930669098989}, {-33.73930669098986, 27.739306690989928`}}], MouseAppearanceTag["NetworkGraphics"]], AllowKernelInitialization->False, UnsavedVariables:>{$CellContext`flag}]], DefaultBaseStyle->{ "NetworkGraphics", FrontEnd`GraphicsHighlightColor -> Hue[0.8, 1., 0.6]}, FrameTicks->None, GridLinesStyle->Directive[ GrayLevel[0.5, 0.4]]]}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", RowBox[{"AdjacencyMatrix", "[", "Grrr", "]"}], "]"}]}], "Input", CellChangeTimes->{{3.619328999338295*^9, 3.619329054947741*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "1", "0", "0", "0", "0", "0", "1", "0"}, {"0", "0", "0", "0", "1", "0", "1", "0", "0", "0"}, {"0", "0", "0", "1", "0", "0", "1", "0", "0", "0"}, {"1", "1", "1", "0", "0", "0", "0", "1", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "1", "0"}, {"0", "0", "0", "0", "0", "0", "1", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0", "1", "0", "1"}, {"0", "0", "0", "0", "0", "1", "1", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0", "0", "0", "1"}, {"0", "1", "0", "0", "0", "0", "0", "0", "0", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[ SparseArray[ Automatic, {10, 10}, 0, { 1, {{0, 2, 4, 6, 10, 11, 12, 15, 17, 19, 20}, {{3}, {9}, {5}, {7}, {4}, { 7}, {1}, {2}, {3}, {8}, {9}, {7}, {2}, {8}, {10}, {6}, {7}, {2}, { 10}, {2}}}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}]]]]], "Output", CellChangeTimes->{{3.619329029494405*^9, 3.6193290555602713`*^9}}] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Transition Matrices", "Section", CellChangeTimes->{{3.61932925989791*^9, 3.619329263671877*^9}}], Cell[TextData[{ StyleBox["Definition:", FontColor->GrayLevel[0]], " In a directed graph, for every vertex i there is a number of edges that \ enter that vertex (i is a head) and a number of edges that exit that vertex \ (i is a tail). Thus we define the ", StyleBox["indegree of vertex", FontColor->GrayLevel[0]], " i as the number of edges for which vertex i is a head. Similarly, the ", StyleBox["outdegree of vertex", FontColor->GrayLevel[0]], " i as the number of edges for which i is a tail.\n\n", StyleBox["Mathematica", FontSlant->"Italic"], " has built-in functions for the indegree and the outdegree of the vertices \ of a graph: \n", StyleBox["VertexInDegree[graph]", FontColor->GrayLevel[0]], " -- returns a list with the indegrees of the vertices of the graph \ specified in the argument\n", StyleBox["VertexOutDegree[graph] ", FontColor->GrayLevel[0]], "-- returns a list with the indegrees of the vertices of the graph" }], "Subsubsection", CellChangeTimes->{{3.619329275000368*^9, 3.6193292848631973`*^9}, { 3.619331320051779*^9, 3.619331554089898*^9}, {3.619333575347495*^9, 3.619333585383073*^9}, 3.6954719065720863`*^9}, TextJustification->1.], Cell[TextData[{ "\n", StyleBox["Definition:", "Subsection", FontColor->GrayLevel[0]], StyleBox[" ", "Subsection"], StyleBox["The transition matrix A of a directed graph", FontColor->GrayLevel[0]], " is defined as follows. If there is an edge from i to j and the outdegree \ of vertex i is ", Cell[BoxData[ FormBox[ SubscriptBox["d", "i"], TraditionalForm]], FontSize->24], StyleBox[",", FontSize->24], " then on column i and row j we put ", Cell[BoxData[ FormBox[ StyleBox[ FractionBox["1", SubscriptBox["d", "i"]], FontSize->36], TraditionalForm]], FontSize->24], ". Otherwise we mark the entry on column i and row j with zero. " }], "Subsubsection", CellChangeTimes->{{3.619329331935567*^9, 3.6193293329538317`*^9}, { 3.619330996052457*^9, 3.619330996360705*^9}}], Cell[TextData[{ StyleBox["Random Walk on a Graph: ", FontColor->GrayLevel[0]], "We use the transition matrix to model the behavior of a random surfer on a \ graph. The surfer chooses a node at random, then walks on the outgoing edges \ to other nodes for as long as he/she wishes. At each step the probability \ that the surfer moves from node i to node j is zero if there is no link from \ i to j and ", Cell[BoxData[ FormBox[ StyleBox[ FractionBox["1", SubscriptBox["d", "i"]], FontSize->36], TraditionalForm]]], "otherwise. Recall that ", Cell[BoxData[ FormBox[ StyleBox[ SubscriptBox["d", "i"], FontSize->24], TraditionalForm]]], " is the outdegree of vertex i." }], "Subsubsection", CellChangeTimes->{{3.619334379046524*^9, 3.6193345467508287`*^9}}], Cell[TextData[{ StyleBox["Question:", FontColor->GrayLevel[0]], " What is the probability that a random surfer that starts at one of the \ nodes of the graph visits say, node j ?" }], "Subsubsection", CellChangeTimes->{{3.619336148375181*^9, 3.619336230922124*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Finding the Transition Matrix using ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Section", CellChangeTimes->{{3.619334627606031*^9, 3.619334671602048*^9}}], Cell[CellGroupData[{ Cell["\<\ Let us try to produce the transition matrix of a directed graph, using the \ adjacency matrix. Notice that for the transition matrix, we first look at the \ column, then at the row. So we need to work with the transpose of the \ adjacency matrix instead.\ \>", "Subsubsection", CellChangeTimes->{{3.619329409909124*^9, 3.619329416332115*^9}, { 3.619331155788309*^9, 3.619331162210226*^9}, {3.619331297372004*^9, 3.619331312019862*^9}, {3.654479668639286*^9, 3.6544796708453074`*^9}}, TextJustification->1.], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"G", "=", RowBox[{"Graph", "[", RowBox[{"{", RowBox[{ RowBox[{"1", "->", "2"}], ",", RowBox[{"3", "\[Rule]", "2"}], ",", RowBox[{"3", "\[Rule]", "4"}], ",", RowBox[{"4", "\[Rule]", "1"}], ",", " ", RowBox[{"4", "\[Rule]", "2"}], ",", " ", RowBox[{"4", "\[Rule]", "3"}]}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Gplot", "=", RowBox[{"GraphPlot", "[", RowBox[{"G", ",", RowBox[{"VertexLabeling", "->", "True"}], ",", " ", RowBox[{"DirectedEdges", "\[Rule]", RowBox[{"{", RowBox[{"True", ",", " ", RowBox[{"\"\\"", "->", "0.07"}]}], "}"}]}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Lin", "=", " ", RowBox[{"VertexInDegree", "[", "G", "]"}]}], ";"}], " "}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "Lin"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Lout", "=", RowBox[{"VertexOutDegree", "[", "G", "]"}]}], ";", " ", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "Lout"}], "]"}]}]}], "Input", CellChangeTimes->{ 3.6191973056624393`*^9, {3.619330526592676*^9, 3.619330572417944*^9}, { 3.6193308432264023`*^9, 3.619330860431671*^9}, {3.6193310481854067`*^9, 3.619331051033924*^9}, {3.619331081729987*^9, 3.6193311337784452`*^9}, { 3.619331587131797*^9, 3.619331673343327*^9}, {3.619331993836849*^9, 3.6193319962979317`*^9}, {3.619335336082837*^9, 3.6193353367844353`*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ GraphicsBox[ TagBox[GraphicsComplexBox[{{0., 0.4319918434636806}, {0.928717592935903, 0.}, {1.857463036471831, 0.43245783691952167`}, {0.9277180173198677, 0.8654295315103671}}, { {RGBColor[0.5, 0., 0.], Arrowheads[{{0.07, 0.7}}], ArrowBox[{1, 2}], ArrowBox[{3, 2}], ArrowBox[{3, 4}], ArrowBox[{4, 1}], ArrowBox[{4, 2}], ArrowBox[{4, 3}]}, {InsetBox[ FrameBox["1", Background->RGBColor[1, 1, 0.8], FrameStyle->RGBColor[0.94, 0.85, 0.36], StripOnInput->False], 1], InsetBox[ FrameBox["2", Background->RGBColor[1, 1, 0.8], FrameStyle->RGBColor[0.94, 0.85, 0.36], StripOnInput->False], 2], InsetBox[ FrameBox["3", Background->RGBColor[1, 1, 0.8], FrameStyle->RGBColor[0.94, 0.85, 0.36], StripOnInput->False], 3], InsetBox[ FrameBox["4", Background->RGBColor[1, 1, 0.8], FrameStyle->RGBColor[0.94, 0.85, 0.36], StripOnInput->False], 4]}}], Annotation[#, VertexCoordinateRules -> {{0., 0.4319918434636806}, {0.928717592935903, 0.}, {1.857463036471831, 0.43245783691952167`}, {0.9277180173198677, 0.8654295315103671}}]& ], AspectRatio->Automatic, FrameTicks->None, PlotRange->All, PlotRangePadding->Scaled[0.1]]], "Output", CellChangeTimes->{ 3.619331057578847*^9, 3.619331136103093*^9, {3.619331596361979*^9, 3.619331620416439*^9}, 3.619331675018283*^9, 3.619332001889554*^9, 3.650886366702703*^9, 3.654479588525361*^9}], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Lin=\"\>", "\[InvisibleSpace]", RowBox[{"{", RowBox[{"1", ",", "3", ",", "1", ",", "1"}], "}"}]}], SequenceForm["Lin=", {1, 3, 1, 1}], Editable->False]], "Print", CellChangeTimes->{3.619331675025281*^9, 3.619332001896632*^9, 3.650886366707406*^9, 3.6544795885311728`*^9}, FontSize->18], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Lout=\"\>", "\[InvisibleSpace]", RowBox[{"{", RowBox[{"1", ",", "0", ",", "2", ",", "3"}], "}"}]}], SequenceForm["Lout=", {1, 0, 2, 3}], Editable->False]], "Print", CellChangeTimes->{3.619331675025281*^9, 3.619332001896632*^9, 3.650886366707406*^9, 3.654479588534651*^9}, FontSize->18] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"A", "=", RowBox[{"AdjacencyMatrix", "[", "G", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"TA", " ", "=", " ", RowBox[{"Transpose", "[", "A", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", RowBox[{"MatrixForm", "[", "TA", "]"}]}], "]"}]}], "Input", CellChangeTimes->{{3.619197308265451*^9, 3.6191973391323843`*^9}, { 3.6191973737322483`*^9, 3.619197385651985*^9}, {3.619331835402947*^9, 3.619331846703548*^9}}, FontSize->18, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"\<\"The transpose matrix is TA=\"\>", " ", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", "1"}, {"1", "0", "1", "1"}, {"0", "0", "0", "1"}, {"0", "0", "1", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[ SparseArray[ Automatic, {4, 4}, 0, { 1, {{0, 1, 4, 5, 6}, {{4}, {1}, {3}, {4}, {4}, {3}}}, {1, 1, 1, 1, 1, 1}}]]]]}]], "Print", CellChangeTimes->{3.619331815508079*^9, 3.6193318508404016`*^9, 3.619332023016313*^9, 3.650886370858206*^9, 3.654479592090734*^9}, FontSize->18] }, Open ]], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{"f", "[", RowBox[{"i_", ",", "j_"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"TA", "[", RowBox[{"[", "i", "]"}], "]"}], "[", RowBox[{"[", "j", "]"}], "]"}], "/", RowBox[{"Lout", "[", RowBox[{"[", "j", "]"}], "]"}]}]}]}]], "Input", CellChangeTimes->{{3.619331772764552*^9, 3.6193317918091373`*^9}, { 3.619332036359201*^9, 3.619332079949462*^9}, {3.619332236065897*^9, 3.619332345333411*^9}}, FontSize->18, Background->RGBColor[1, 1, 0.85]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Trans", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"i", ",", "j"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "TA", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "TA", "]"}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "Trans", "]"}]}], "Input", CellChangeTimes->{{3.6191976348766813`*^9, 3.6191977166441593`*^9}, { 3.619198184131897*^9, 3.619198192018344*^9}}, FontSize->18, Background->RGBColor[1, 1, 0.85]], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "Indeterminate", "0", FractionBox["1", "3"]}, {"1", "Indeterminate", FractionBox["1", "2"], FractionBox["1", "3"]}, {"0", "Indeterminate", "0", FractionBox["1", "3"]}, {"0", "Indeterminate", FractionBox["1", "2"], "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{3.654479600271618*^9}] }, Open ]] }, Open ]], Cell["\<\ Exercise : Find the transition matrix of a graph. The code in yellow computes \ the transition matrix, but some cases are overlooked.\ \>", "Subsection", CellChangeTimes->{{3.650886542769381*^9, 3.650886573861004*^9}, { 3.6544796125763693`*^9, 3.6544796381492777`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Making interactive models", "Section", CellChangeTimes->{{3.618763068734948*^9, 3.6187630938146772`*^9}, { 3.619141486610537*^9, 3.619141492926496*^9}}], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Using the command ", "Subsubsection"], StyleBox["Manipulate[...] ", "Subsubsection", FontColor->GrayLevel[0]], StyleBox["we can turn a static computation or graph into a dynamic and \ sophisticated model. We can wrap Manipulate[...] around any Wolfram command \ to create an interactive model. We need to introduce a parameter that we want \ to manipulate and some bounds for that parameter. ", "Subsubsection"] }], "Subsection", CellChangeTimes->{{3.61914149719843*^9, 3.6191415458687487`*^9}, { 3.619144411008965*^9, 3.619144447675994*^9}, {3.619144533114852*^9, 3.619144563423238*^9}, {3.619144660390873*^9, 3.619144690722156*^9}, { 3.619146725854446*^9, 3.619146759990509*^9}, {3.619147099274131*^9, 3.6191471081783953`*^9}}], Cell[CellGroupData[{ Cell[TextData[{ "Parameter ranges are given inside curly brackets: \n", StyleBox["{x, 4, 7}", FontColor->GrayLevel[0]], " -- specifies an interval [4,7] that the parameter x belongs to.\n", StyleBox["{x, {4,7}}", FontColor->GrayLevel[0]], " -- specifies a discrete set of values that x can take on.\n", StyleBox["{{x, 5, \[OpenCurlyDoubleQuote]Some text describing the meaning of \ the parameter x\[CloseCurlyDoubleQuote]}, 4,7} ", FontColor->GrayLevel[0]], "\n -- x belongs to the interval [4,7] and the default value is 5" }], "Subsubsection", CellChangeTimes->{{3.6191467693238573`*^9, 3.619146950356045*^9}, { 3.619151086286968*^9, 3.619151140449494*^9}, {3.619151279939712*^9, 3.619151417605892*^9}, {3.619151535475821*^9, 3.619151555312394*^9}, { 3.619151607803134*^9, 3.619151635421248*^9}, {3.619151711650279*^9, 3.6191517176736727`*^9}, {3.6191518115360126`*^9, 3.619151826517083*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox["Manipulate", Background->RGBColor[1, 1, 0.85]], StyleBox["[", Background->RGBColor[1, 1, 0.85]], "\[IndentingNewLine]", RowBox[{ RowBox[{"GraphPlot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomInteger", "[", "]"}], ",", RowBox[{"{", "n", "}"}], ",", RowBox[{"{", "n", "}"}]}], "]"}], ",", " ", RowBox[{"VertexLabeling", "\[Rule]", "True"}], ",", " ", RowBox[{"DirectedEdges", "\[Rule]", "True"}]}], "]"}], ",", " ", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"n", ",", "4", ",", "7"}], "}"}]}], StyleBox["]", Background->RGBColor[1, 1, 0.85]]}]], "Input", CellChangeTimes->{{3.6191448933901463`*^9, 3.619144978839225*^9}, { 3.619145063045244*^9, 3.619145066491253*^9}, {3.619146961727853*^9, 3.619147014347159*^9}, {3.6191491773581057`*^9, 3.6191491836182833`*^9}, { 3.619149235505515*^9, 3.6191492377599373`*^9}, {3.619151198683278*^9, 3.619151237118923*^9}, {3.6191514402252502`*^9, 3.61915145692518*^9}, { 3.619151491391274*^9, 3.619151511100024*^9}, {3.61915166990576*^9, 3.6191516919649143`*^9}, {3.619151726667294*^9, 3.6191517268028316`*^9}, { 3.61915176600266*^9, 3.619151780587287*^9}, {3.619153233623488*^9, 3.619153257556288*^9}, {3.6193352264629297`*^9, 3.619335232704973*^9}}, FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`n$$ = 4.915, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[$CellContext`n$$], 4, 7}}, Typeset`size$$ = {360., {73., 78.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`n$9710$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`n$$ = 4}, "ControllerVariables" :> { Hold[$CellContext`n$$, $CellContext`n$9710$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> GraphPlot[ Table[ RandomInteger[], {$CellContext`n$$}, {$CellContext`n$$}], VertexLabeling -> True, DirectedEdges -> True], "Specifications" :> {{$CellContext`n$$, 4, 7}}, "Options" :> {}, "DefaultOptions" :> {}], ImageSizeCache->{405., {118., 124.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$}, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{3.6544801633153276`*^9}] }, Open ]] }, Open ]] }, Open ]], Cell[TextData[StyleBox["If you click the plus sign at the end of the slider, \ you get a set of video controls. You can introduce a particular value of the \ parameter and hit Enter to jump to that value. When you do a presentation, \ you can also hide the Wolfram commands and show only the interactive model.", \ "Subsubsection"]], "Subsection", CellChangeTimes->{{3.619145246067844*^9, 3.619145279969318*^9}, { 3.619145322073482*^9, 3.6191453241836147`*^9}, {3.6191464313952007`*^9, 3.6191464624083757`*^9}, {3.61914651419269*^9, 3.619146531509437*^9}, { 3.619148673398098*^9, 3.61914871311623*^9}, 3.619148883856667*^9}, TextJustification->1.], Cell[TextData[{ StyleBox["\nHelp->Demonstrations gives you a list of pre-built ", "Subsubsection"], ButtonBox["Wolfram Demonstration Projects", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], StyleBox[". You can browse by topic and see the available templates. You can \ then download the project as a .cdf, which means that you get an interactive \ version that you can run locally on your computer, or you can download the \ author code, which means that you get a notebook (.nb) with the necessary \ code to generate the model.", "Subsubsection"] }], "Subsection", CellChangeTimes->{{3.6191488891318197`*^9, 3.619148979369378*^9}, { 3.619149274230813*^9, 3.619149289604766*^9}, {3.619150000298657*^9, 3.619150169057393*^9}, {3.619150317437633*^9, 3.6191503369626293`*^9}, { 3.6191533487345333`*^9, 3.619153348737863*^9}, 3.619328952479558*^9}, TextJustification->1.] }, Open ]] }, Open ]] }, WindowSize->{1280, 664}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, FrontEndVersion->"11.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (September \ 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 571, 13, 284, "Title"], Cell[CellGroupData[{ Cell[1176, 39, 93, 1, 64, "Section"], Cell[1272, 42, 1375, 26, 227, "Subsubsection"], Cell[2650, 70, 1634, 38, 101, "Subsubsection"] }, Open ]], Cell[CellGroupData[{ Cell[4321, 113, 166, 2, 64, "Section"], Cell[4490, 117, 494, 13, 52, "Input"], Cell[4987, 132, 7892, 157, 365, "Input"], Cell[12882, 291, 490, 14, 52, "Input"], Cell[13375, 307, 811, 16, 68, "Input"], Cell[14189, 325, 564, 13, 52, "Input"], Cell[14756, 340, 1246, 31, 114, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[16039, 376, 103, 1, 64, "Section"], Cell[16145, 379, 411, 8, 83, "Subsubsection"], Cell[CellGroupData[{ Cell[16581, 391, 237, 5, 29, "Subsubsection"], Cell[CellGroupData[{ Cell[16843, 400, 237, 5, 50, "Input"], Cell[17083, 407, 9138, 190, 61, "Output"] }, Open ]], Cell[26236, 600, 803, 15, 89, "Text"], Cell[CellGroupData[{ Cell[27064, 619, 228, 5, 50, "Input"], Cell[27295, 626, 801, 24, 81, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[28145, 656, 297, 6, 69, "Subsection"], Cell[CellGroupData[{ Cell[28467, 666, 715, 18, 32, "Input"], Cell[29185, 686, 12782, 253, 296, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[42004, 944, 173, 3, 32, "Input"], Cell[42180, 949, 1090, 28, 126, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[43307, 982, 772, 20, 32, "Input"], Cell[44082, 1004, 12741, 250, 296, "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[56884, 1261, 177, 2, 64, "Section"], Cell[CellGroupData[{ Cell[57086, 1267, 257, 5, 35, "Subsubsection"], Cell[57346, 1274, 1406, 38, 201, "Input"], Cell[58755, 1314, 369, 9, 55, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[59173, 1329, 102, 1, 64, "Section"], Cell[CellGroupData[{ Cell[59300, 1334, 196, 2, 43, "Subsection"], Cell[CellGroupData[{ Cell[59521, 1340, 326, 9, 55, "Input"], Cell[59850, 1351, 595, 14, 36, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[60482, 1370, 184, 4, 55, "Input"], Cell[60669, 1376, 716, 21, 118, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[61422, 1402, 489, 10, 55, "Input"], Cell[61914, 1414, 1617, 36, 183, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[63568, 1455, 622, 14, 131, "Subsubsection"], Cell[CellGroupData[{ Cell[64215, 1473, 164, 5, 55, "Input"], Cell[64382, 1480, 1759, 34, 246, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[66178, 1519, 297, 8, 55, "Input"], Cell[66478, 1529, 2360, 47, 120, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[68887, 1582, 311, 7, 59, "Subsubsection"], Cell[69201, 1591, 184, 4, 60, "Code"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[69446, 1602, 227, 3, 64, "Section"], Cell[69676, 1607, 587, 16, 59, "Subsubsection"], Cell[70266, 1625, 762, 24, 53, "Subsubsection"], Cell[71031, 1651, 745, 16, 79, "Subsubsection"], Cell[71779, 1669, 373, 10, 29, "Subsubsection"], Cell[CellGroupData[{ Cell[72177, 1683, 524, 19, 29, "Subsubsection"], Cell[CellGroupData[{ Cell[72726, 1706, 696, 18, 55, "Input"], Cell[73425, 1726, 695, 16, 36, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[74169, 1748, 430, 8, 83, "Subsubsection"], Cell[CellGroupData[{ Cell[74624, 1760, 991, 29, 114, "Input"], Cell[75618, 1791, 164, 3, 29, "Print"] }, Open ]], Cell[CellGroupData[{ Cell[75819, 1799, 1854, 45, 143, "Input"], Cell[77676, 1846, 289, 7, 36, "Output"] }, Open ]] }, Open ]], Cell[77992, 1857, 940, 16, 131, "Subsubsection"] }, Open ]], Cell[CellGroupData[{ Cell[78969, 1878, 120, 1, 64, "Section"], Cell[CellGroupData[{ Cell[79114, 1883, 248, 7, 59, "Subsubsection"], Cell[CellGroupData[{ Cell[79387, 1894, 996, 21, 114, "Input"], Cell[80386, 1917, 322, 10, 36, "Output"] }, Open ]], Cell[80723, 1930, 24845, 499, 221, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[105605, 2434, 296, 6, 35, "Subsubsection"], Cell[CellGroupData[{ Cell[105926, 2444, 25599, 510, 118, "Input"], Cell[131528, 2956, 1467, 32, 183, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[133056, 2995, 103, 1, 64, "Section"], Cell[133162, 2998, 1194, 27, 179, "Subsubsection"], Cell[134359, 3027, 812, 26, 118, "Subsubsection"], Cell[135174, 3055, 795, 22, 111, "Subsubsection"], Cell[135972, 3079, 270, 6, 29, "Subsubsection"] }, Open ]], Cell[CellGroupData[{ Cell[136279, 3090, 185, 5, 64, "Section"], Cell[CellGroupData[{ Cell[136489, 3099, 524, 10, 83, "Subsubsection"], Cell[CellGroupData[{ Cell[137038, 3113, 1612, 41, 201, "Input"], Cell[138653, 3156, 1523, 35, 183, "Output"], Cell[CellGroupData[{ Cell[140201, 3195, 352, 9, 32, "Print"], Cell[140556, 3206, 352, 9, 32, "Print"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[140957, 3221, 599, 14, 114, "Input"], Cell[141559, 3237, 1008, 27, 100, "Print"] }, Open ]], Cell[142582, 3267, 556, 16, 87, "Input"], Cell[CellGroupData[{ Cell[143163, 3287, 628, 18, 85, "Input"], Cell[143794, 3307, 874, 25, 109, "Output"] }, Open ]] }, Open ]], Cell[144695, 3336, 282, 5, 44, "Subsection"] }, Open ]], Cell[CellGroupData[{ Cell[145014, 3346, 161, 2, 64, "Section"], Cell[CellGroupData[{ Cell[145200, 3352, 771, 13, 91, "Subsection"], Cell[CellGroupData[{ Cell[145996, 3369, 932, 17, 131, "Subsubsection"], Cell[CellGroupData[{ Cell[146953, 3390, 1403, 31, 177, "Input"], Cell[148359, 3423, 1677, 35, 259, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[150075, 3463, 659, 9, 67, "Subsection"], Cell[150737, 3474, 988, 18, 108, "Subsection"] }, Open ]] }, Open ]] } ] *)