Graph

Graph[{e1, e2, ...}]
yields a graph with edges .

Graph[{v1, v2, ...}, {e1, e2, ...}]
yields the graph with vertices and edges .

Graph[{..., wi[vi, ...], ...}, {..., wj[ej, ...], ...}]
yields a graph with vertex and edge properties defined by the symbolic wrappers .

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples (5)Basic Examples (5)

An undirected graph:

In[1]:=
Click for copyable input
Out[1]=

A directed graph:

In[1]:=
Click for copyable input
Out[1]=

Style vertices and edges:

In[1]:=
Click for copyable input
Out[1]=

Use wrappers to input directly:

In[2]:=
Click for copyable input
Out[2]=

Label vertices and edges:

In[1]:=
Click for copyable input
Out[1]=

Use different vertices and edges:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »