New in Wolfram
Mathematica
8: Graph & Network Analysis
◄
previous
|
next
►
Application Areas
Test Properties
Mathematica
8 provides a broad range of predicate functions to test graph properties.
In[1]:=
X
names = {GraphQ, EmptyGraphQ, UndirectedGraphQ, DirectedGraphQ, LoopFreeGraphQ, SimpleGraphQ, WeightedGraphQ, AcyclicGraphQ, BipartiteGraphQ, ConnectedGraphQ, EulerianGraphQ, HamiltonianGraphQ, PathGraphQ, TreeGraphQ};
In[2]:=
X
FormulaGallery[f_List] := Module[{style = {VertexSize -> 0.2, ImageSize -> 120}}, g = Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 1, 4 \[UndirectedEdge] 5, 5 \[UndirectedEdge] 6, 6 \[UndirectedEdge] 4}, style]; h = Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 1, 3 \[UndirectedEdge] 3}, style]; Style[Grid[ Join[{{Style["Functions", FontFamily -> "Verdana", Bold], g, h}}, {ToString /@ f, #[g] & /@ f, #[h] & /@ f}\[Transpose]], Background -> {None, {{Hue[.25, .15, .9], GrayLevel[.9]}}}, FrameStyle -> Directive[Thick, White], Dividers -> All, Spacings -> {1, 2}], FontFamily -> "Verdana"]];
In[3]:=
X
Pane[FormulaGallery[names], 500]
Out[3]=