58. graphs

58.1 Introduction to graphs

The graphs package provides graph and digraph data structure for
Maxima. Graphs and digraphs are simple (have no multiple edges nor
loops), although digraphs can have a directed edge from u to
v and a directed edge from v to u.

Internally graphs are represented by adjacency lists and implemented as
a lisp structures. Vertices are identified by their ids (an id is an
integer). Edges/arcs are represented by lists of length 2. Labels can be
assigned to vertices of graphs/digraphs and weights can be assigned to
edges/arcs of graphs/digraphs.

There is a draw_graph function for drawing graphs. Graphs are
drawn using a force based vertex positioning
algorithm. draw_graph can also use graphviz programs available
from http://www.graphviz.org. draw_graph is based on the maxima
draw package.

58.2.5 Visualization

The algorithm used to position vertices is specified by the optional
argument program. The default value is
program=spring_embedding. draw_graph can also use the
graphviz programs for positioning vertices, but graphviz must be
installed separately.

Defines the program used for positioning vertices of the graph. Can be
one of the graphviz programs (dot, neato, twopi, circ, fdp),
circular, spring_embedding or
planar_embedding. planar_embedding is only available for
2-connected planar graphs. When program=spring_embedding, a set
of vertices with fixed position can be specified with the
fixed_vertices option.