# Тестирование свойств

В системе Mathematica 8 имеется широкий ряд функций-предикатов для тестирования свойств графов.
 In[1]:= Xnames = {GraphQ, EmptyGraphQ, UndirectedGraphQ, DirectedGraphQ, LoopFreeGraphQ, SimpleGraphQ, WeightedGraphQ, AcyclicGraphQ, BipartiteGraphQ, ConnectedGraphQ, EulerianGraphQ, HamiltonianGraphQ, PathGraphQ, TreeGraphQ};
 In[2]:= XFormulaGallery[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]:= XPane[FormulaGallery[names], 500]
 Out[3]=