Skip to content
Ed Scheinerman edited this page Oct 3, 2022 · 23 revisions

SimpleGraphs User's Guide

ALERT

Significant changes introduced in SimpleGraphs version 0.8

The names SimpleGraph, SimpleDigraph, and SimpleHypergraph have changed.

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

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


The SimpleGraphs module defines three data types:

  • UndirectedGraph type represents undirected graphs without loops or multiple edges. This may be abbreviated UG.
  • DirectedGraph type represents directed graphs in which there may be at most one directed edge (u,v) from a vertex u to a vertex v. This may be abbreviated DG. There may also be a directed edge in the opposite direction, (v,u). Loops are permitted.
  • HyperGraph type for hypergraphs. This may be abbreviated HG.

This User's Guide deals primarily with undirected graphs. Our support for directed graphs is modest, and support for hypergraphs is quite minimal.

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 registered packages:

  • DrawSimpleGraphs: draw graphs on the screen using Plots.
  • SimpleGraphAlgorithms: additional graph algorithms that typically rely on [integer] linear programming.
  • ImplicitGraphs: deal with graphs in which the vertices and edges are implicitly defined by two functions: one that tests for vertex membership and one that returns a list of the (out) neighbors of a vertex.

Users may also be interested in the following additional (and modestly maintained) graph theory modules available at my Github site:

  • SimplePlanarGraphs
  • SimpleGraphRepresentations
  • CoinRepresentations
  • WordGraphs
  • Mazes
  • SimplePosets
  • SimplePosetAlgorithms