Skip to content
Ed Scheinerman edited this page Jul 17, 2022 · 23 revisions

SimpleGraphs User's Guide

ALERT: Starting with version 0.8 the names SimpleGraph, SimpleDigraph, and SimpleHypergraph are changing!!! This documentation will need to be updated.

  • Instead of SimpleGraph, use UndirectedGraph or UG.
  • Instead of SimpleDigraph, use DirectedGraph or DG.
  • Instead of SimpleHypergraph, use HyperGraph or HG.

These changes were made to help this SimpleGraphs module be interoperable with Julia's Graph module that now uses the name SimpleGraph (formerly LightGraph).


The SimpleGraphs module defines three data types:

  • A robust SimpleGraph type that represents undirected graphs without loops or multiple edges.
  • A modest SimpleDigraph type that represents directed graphs in which there may be at most one directed edge (u,v) from a vertex u to a vertex v. There may also be a directed edge in the opposite direction, (v,u). Loops are permitted.
  • A modest SimpleHypergraph type.

This User's Guide deals primarily with undirected graphs.

More Information

Function descriptions in this User's Guide are terse. Use the Julia help function for more information. Type a ? and then the name of the function. For example:

help?> adjacency
search: adjacency

  adjacency(G) returns the adjacency matrix of G.

  Note: If the vertices can be sorted by sort, then the first row of the 
  adjacency matrix corresponds to the first vertex (in order) in G and so forth. 
  However, if the vertices are not sortable in this way, the mapping between 
  vertices and rows/columns of the matrix is unpredictable.

Associated Modules

Additional graph theory functionality are provided in the following modules (which require separate installation):

See also SimplePartitions.

Clone this wiki locally