This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

GraphData

GraphData[name]
gives an image of the graph with the specified name.
GraphData[name, "property"]
gives the value for the specified property for a named graph.
GraphData["class"]
gives a list of named graphs in the specified class.
GraphData[n]
gives a list of named graphs with n vertices.
  • Graphs can be specified by standard names such as "PetersenGraph" and "FosterCage".
  • GraphData[patt] gives a list of all graph names that match the string pattern patt.
  • GraphData[{n, i}, ...] gives data for the i^(th) simple graph with n vertices.
  • GraphData[{"type", id}, ...] gives data for the graph of the specified type with identifier id. The identifier is typically an integer, or lists of integers.
  • GraphData["class", n] gives a list of graphs with n vertices in the specified class.
  • GraphData["Classes"] gives a list of all supported classes.
  • GraphData["Properties"] gives a list of properties available for graphs.
  • Basic graph properties include:
"AdjacencyMatrix"adjacency matrix
"EdgeCount"total number of edges
"EdgeIndices"pairs of vertex indices for each edge
"EdgeRules"edges specified as vertex connectivity rules
"VertexCount"total number of vertices
  • Properties related to graph display include:
"AllImages"list of images of all available layouts for the graph
"AlternateVertexCoordinates"vertex coordinates for all alternate layouts
"Image"image of the default layout
"VertexCoordinates"vertex coordinates for the default layout
  • Global graph properties include:
"ArticulationVertices"list of vertices whose removal would disconnect the graph
"AutomorphismCount"order of the vertex automorphism group
"Automorphisms"vertex permutations corresponding to automorphisms
"Bridges"list of edges whose removal would disconnect the graph
"ChromaticNumber"chromatic number
"ChromaticPolynomial"chromatic polynomial as a pure function
"CliqueNumber"number of vertices in the largest clique
"CrossingNumber"minimum crossings in an embedding of the graph
"Degrees"degrees for each vertex
"Diameter"the diameter of the graph
"Eccentricities"eccentricities of each vertex
"EdgeChromaticNumber"edge chromatic number
"EdgeConnectivity"minimum edge deletions to disconnect the graph
"Girth"length of the shortest cycle
"HamiltonianCycleCount"number of distinct Hamiltonian cycles
"HamiltonianCycles"lists of Hamiltonian cycles
"HamiltonianPathCount"number of distinct Hamiltonian paths
"HamiltonianPaths"lists of Hamiltonian paths
"IndependenceNumber"size of the largest independent set
"LineGraphName"name of the line graph corresponding to the graph
"RectilinearCrossingNumber"minimum crossings in a straight line embedding
"Spectrum"eigenvalues of the adjacency matrix
"ToroidalCrossingNumber"minimum crossings in a toroidal embedding
"VertexConnectivity"minimum vertex deletions to disconnect the graph
  • Naming-related properties include:
"AlternateNames"alternate English names
"AlternateStandardNames"alternate standard Mathematica names
"Name"English name
"NotationRules"rules for notations specifying the graph
"StandardName"standard Mathematica name
  • GraphData["class"] gives a list of named graphs in the specified class. GraphData[name, "class"] gives True or False depending on whether the graph corresponding to name is in the specified class.
  • GraphData[name, "Classes"] gives a list of the classes in which the graph corresponding to name appears.
  • Basic classes of graphs include:
"Bipartite"bipartite (two components connected by every edge)
"Connected"connected
"Nonplanar"nonplanar (requires crossings)
"Planar"planar (no crossings)
"Tree"tree (no cycles)
  • Classes based on vertex degrees include:
"Cubic"each vertex is of degree 3
"Quartic"each vertex is of degree 4
"Quintic"each vertex is of degree 5
"Regular"each vertex is of the same degree
  • Classes based on traversals include:
"Eulerian"has a closed cycle containing every edge once
"HamiltonConnected"every pair of vertices bounds a Hamiltonian path
"Hamiltonian"has a closed cycle containing every vertex once
"Hypohamiltonian"one-vertex-removed graphs are Hamiltonian
"Hypotraceable"one-vertex-removed graphs are traceable
"Noneulerian"not Eulerian
"Nonhamiltonian"not Hamiltonian
"SquareFree"free of 4-cycles
"Traceable"contains a Hamiltonian path
"TriangleFree"free of 3-cycles
"Untraceable"not traceable
  • Classes based on symmetry and regularity include:
"DistanceRegular"all vertices have identical distance sets
"EdgeTransitive"all edges have identical environments
"Identity"automorphism group is of order unity
"Semisymmetric"edge- but not vertex-transitive
"StronglyRegular"strongly regular
"Symmetric"both edge- and vertex-transitive
"VertexTransitive"all vertices have identical environments
"WeaklyRegular"regular, but not strongly regular
  • Special classes include:
"Bicolorable"two or fewer vertex colors needed
"Bicubic"bipartite and cubic
"Cage"smallest graph of a given girth
"CayleyGraph"Cayley graph
"ClawFree"free of the claw graph
"Integral"spectrum consists of integers
"LCF"describable in LCF notation (cubic Hamiltonian)
"LineGraph"line graph
"Moore"graphs with the Moore property
"Perfect"perfect graph
"SelfComplementary"isomorphic to its complement
"SelfDual"isomorphic to its dual
"Snark"snark graph
"UnitDistance"embeddable with edges of unit length
  • Classes associated with graphs include:
"Antiprism"skeleton of an antiprism
"Archimedean"skeleton of one of the 13 Archimedean solids
"ArchimedeanDual"skeleton of one of the 13 Archimedean duals
"Platonic"skeleton of one of the 5 Platonic solids
"Polyhedral"skeleton of a polyhedron
"Prism"skeleton of a prism
"RegularPolychoron"skeleton of one of the 6 regular 4-dimensional solids
  • Classes of graphs indexed by one or more integers include:
"Circulant"n vertices each with identical relative adjacencies
"Complete"all pairs of vertices are connected
"CompleteBipartite"all pairs connected across two disjoint sets of vertices
"Crown"complete bipartite K_(n,n) with horizontal edges removed
"Cycle"a single cycle through n vertices
"Empty"n vertices with no edges
"Grid"an array of points with grid connectivity
"Hypercube"an n-dimensional hypercube
"Ladder"a 2 n-vertex ladder graph
"MoebiusLadder"an n-sided prism graph with a half-twist
"Path"an n-vertex tree with no branches
"Star"a center vertex connected to n-1 vertices
"Wheel"a cycle with all vertices connected to a center
  • GraphData[name, "property", "ann"] or GraphData["property", "ann"] gives various annotations associated with a property. Typical annotations include:
"Description"short textual description of the property
"LongDescription"longer textual description of the property
"Note"additional information about the property
  • Using GraphData may require internet connectivity.
New in 6