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

Graph

Graph[e, v, opts]
represents a graph object where e is the list of edges annotated with graphics options, v is a list of vertices annotated with graphics options, and opts is a set of global graph options.
  • e has the form {{{i_1,j_1},opts_1},{{i_2,j_2},opts_2},…}, where {i_1,j_1},{i_2,j_2},… are edges of the graph and opts_1,opts_2,… are options that respectively apply to these edges.
  • v has the form {{{x_1,y_1},opts_1},{{x_2,y_2},opts_2},…}, where {x_1,y_1},{x_2,y_2},… respectively denote the coordinates in the plane of vertex 1, vertex 2, … and opts_1,opts_2,… are options that respectively apply to these vertices.
  • The third item in a Graph object is opts, a sequence of zero or more global options that apply to all vertices or all edges or to the graph as a whole.
  • All edge options and vertex options can be used as global options also.
  • If a global option and a local edge option or vertex option differ, then the local edge or vertex option is used for that particular edge or vertex.
  • In addition to these options, the following two options can be specified as part of the global options: LoopPosition and EdgeDirection.
  • Furthermore, all the options of the Mathematica function Plot can be used as global options in a Graph object. These can be used to specify how the graph looks when it is drawn.
  • Also, all options of the graphics primitive Arrow can also be specified as part of global graph options. These can be used to affect the look of arrows that represent directed edges.
  • See the usage message of individual options to find out more about values these options can take on.
  • Whether a graph is undirected or directed is given by the option EdgeDirection. This has default value False. For undirected graphs, the edges {i_1,j_1},{i_2,j_2},… have to satisfy i_1<=j_1,i_2<=j_2,… and for directed graphs the edges {i_1,j_1},{i_2,j_2},… are treated as ordered pairs, each specifying the direction of the edge as well.