Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Representation and Properties >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Representation and Properties >
Graph Representation and Properties
Graphs are first-class citizens in Mathematica, and can be used as input, output, in programs, and in documents. Undirected and directed graphs are treated uniformly and support a number of standard properties for vertices and edges. Importantly, graphs also support custom properties for modeling or computational flexibility. Graphs can be converted to a number of different representations, including matrices. Graphs can be exported with high-fidelity to numerous file formats.
Graph represent a general graph, or create it from vertices and edges
UndirectedEdge an undirected edge (UndirectedEdge)
DirectedEdge a directed edge (DirectedEdge)
GraphQ  ▪ UndirectedGraphQ  ▪ DirectedGraphQ  ▪ EdgeQ  ▪ VertexQ
Basic Properties
VertexCount, EdgeCount the number of vertices and edges in the graph
VertexList, EdgeList the list of vertices and edges in the graph
VertexIndex, EdgeIndex the index for a vertex or edge in a graph
EdgeRules the list of edges as a list of rules
Standard Properties
Property property wrapper for vertices and edges
PropertyValue get and set vertex or edge property values
AdjacencyMatrix vertex-vertex adjacency matrix
Export export graphs into several graph formats
"GraphML"  ▪ "GXL"  ▪ "Graphlet"  ▪ "Pajek"  ▪ "TGF"  ▪ "DOT"  ▪ "DIMACS"  ▪ "Graph6"  ▪ "Sparse6"  ▪ "LEDA"
MORE ABOUT
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF