Wolfram
Mathematica
8의 신기능: 그래프 및 네트워크 모델링
◄
이전
|
다음
►
응용 분야
그래프 작업
Mathematica
8에는 그래프에 대한 모든 일반적인 작업 이상의 기능을 내장하고 있습니다.
In[1]:=
X
style = {VertexStyle -> Directive[Hue[.6, .3, 1], EdgeForm[Hue[.6, .8, .7]]], VertexSize -> 0.2, EdgeStyle -> Hue[.6, .8, .5], ImageSize -> {100, 100}};
In[2]:=
X
name = {"Graph Union", "Graph Disjoint Union", "Graph Difference", "Graph Intersection"};
In[3]:=
X
info = { {g = CycleGraph[4, style], Style["\[Union]", 20], h = StarGraph[4, style], Style["\[LongEqual]", 20], HighlightGraph[ GraphUnion[g, h, GraphLayout -> "CircularEmbedding"], g, style]}, {g = CycleGraph[3, style], Style["\[UnionPlus]", 20], h = CycleGraph[3, style], Style["\[LongEqual]", 20], HighlightGraph[GraphDisjointUnion[g, h], g, style]}, {g = PetersenGraph[5, 2, style], Style["-", 20], h = CompleteGraph[5, style], Style["\[LongEqual]", 20], HighlightGraph[g, GraphDifference[g, h], style]}, {g = PetersenGraph[5, 2, style], Style["\[Intersection]", 20], h = CompleteGraph[5, style], Style["\[LongEqual]", 20], HighlightGraph[g, GraphIntersection[g, h], style]} };
In[4]:=
X
ShowPlotSamples[name_, info_] := Framed[Column[{Style[name, 14, Bold, FontFamily -> "Verdana"], Grid[{info}, Spacings -> {1, 0}]}, Alignment -> Center], RoundingRadius -> 9, FrameStyle -> None, Background -> GrayLevel@0.90];
In[5]:=
X
Column[MapThread[ShowPlotSamples, {name, info}]]
Out[5]=