graph.spad line 3402 [edit on github]
allows us to model graph theory
tensor product : the tensor product G*H
of graphs G
and H
is a graph such that the vertex set of G*H
is the Cartesian product V
(G
) times V
(H
); and any two vertices (u
, u') and (v
, v'
) are adjacent in G
times H
if and only if u' is adjacent with v'
and u
is adjacent with v
.
Cartesian product: the vertex set of G
o
H
is the Cartesian product V
(G
) times V
(H
) and any two vertices (u
, u') and (v
, v'
) are adjacent in G
o
H
if and only if either u
= v
and u' is adjacent with v'
in H
, or u' = v'
and u
is adjacent with v
in G
.
as Cartesian product but returns %.
as tensor product but returns %.
coerce FinitePoset
to graph
diagramSvg(fileName, n
, dispArrowName) creates an SVG
diagram. This is an alternative version which does not shorten lines. fileName: String is the name of the SVG
file that will be created n:
% is the graph that will be written dispArrowName: Boolean is true
to include the name of each arrow
undirectedGraph(poset)
constructs graph from a partially ordered set. This will be a graph with, at most, one arrow between any two nodes (in each direction).
constructor for graph with given list of object names. Use this version of the constructor if you don't
intend to create diagrams and therefore don't
care about x
, y
coordinates. more objects and arrows can be added later if required.
constructor for graph with given objects and adjacency matrix.
undirectedGraph(obs, ars)
constructs graph with objects obs
and arrows ars. This constructor just has pure abstract graph information without decoration information.
constructor for graph with given objects more objects and arrows can be added later if required.
constructor for graph with given objects and arrows more objects and arrows can be added later if required.
FiniteGraph(S)