# Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
WOLFRAM LANGUAGE GUIDE

# Graph Construction & Representation

Graphs are first-class citizens in the Wolfram Language 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.
Graphs can be constructed in a variety of ways. They can be built from vertices and edges directly in a symbolic form. They can come from built-in curated collections of theoretical or empirical graphs. Special graphs can be generated from parametric specifications. Random graphs following a variety of graph distributions allow you to build simulated internets or citation graphs and test algorithms. Graphs can be fully specified by several types of matrices, or they can be imported from numerous supported file formats. Graphs can also be constructed in several steps by performing operations on graphs.

## ReferenceReference

Graph represent a general graph, or create it from vertices and edges

UndirectedEdge an undirected edge ()

DirectedEdge a directed edge ()

### Basic Properties

VertexList, EdgeList the list of vertices and edges in the graph

VertexIndex, EdgeIndex the index for a vertex or edge in a graph

### Graph Properties »

PropertyValue get and set vertex or edge property values

### Import and Export Graphs

Import, Export import and export graphs

### Curated Graphs

GraphData collection of theoretical graphs

ExampleData collection of empirical graphs

### Parametric Graphs

CompleteGraph generate a complete or a complete -partite graph

### Structured Graphs

PathGraph general directed or undirected path

TreeGraph general directed or undirected tree

PlanarGraph general directed or undirected planar graph

### Graphs from Data

RelationGraph generate a graph based on data and a relation

NearestNeighborGraph generate the k-nearest neighbor graph for general elements

NestGraph generate a nested function graph

ClusteringTree generate a tree from hierarchical clustering of elements

### Random Graphs »

RandomGraph generate random graphs following a graph distribution

### Operations and Modifications of Graphs »

Subgraph extract subgraphs