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 Predicates and Properties > GraphQ >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Predicates and Properties > GraphQ >

GraphQ

GraphQ[g]
yields True if g is a valid Graph object and False otherwise.
Test whether an object is a valid Graph object:
Special graphs:
Matrix graphs:
Random graphs:
A Graphics object that contains a picture of a graph is not a valid Graph object:
Test whether an object is a valid Graph object:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Special graphs:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Matrix graphs:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Random graphs:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
A Graphics object that contains a picture of a graph is not a valid Graph object:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
GraphQ gives False for anything that is not a graph:
Test large graphs:
Test whether a graph is directed or undirected:
Test whether a graph is simple:
A graph can have self-loops:
Test whether a graph is bipartite:
Test whether a graph is weighted:
GraphQ gives False for non-explicit graphs:
For an explicit integer it is a graph object:
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF