graph.spad line 2233 [edit on github]
Category of directed graphs, allows us to model graph theory
"*"
(a,b
) returns a 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(a, b)
returns a 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
.
closedCartesian(a, b, f)
builds Cartesian product of a and b
and then maps it back to % using f
.
closedTensor(a, b, f)
builds tensor product of a and b
and then maps it back to % using f
.
coerce FinitePoset
to graph
coerce List
to graph
coerce PermutationGroup
to graph
directedGraph(poset)
constructs graph from a partially ordered set. This will be a graph with, at most, one arrow between any two nodes.
directedGraph(ob)
is a constructor for graph with given list of object names and no arrows. Use this version of the constructor if you don't
want to create specific x
, y
coordinates. more objects and arrows can be added later if required.
directedGraph(ob, am)
constructs graph with objects ob
and adjacency matrix am.
directedGraph(obs, ars)
constructs graph with objects obs
and arrows ars. This constructor just has pure abstract graph information without decoration information.
directedGraph(perms)
constructs graph from a list of permutations: perms
.
directedGraph(ob)
is a constructor for graph with given objects ob
, more objects and arrows can be added later if required.
directedGraph(ob, ar)
constructs graph with objects ob
and arrows ar, more objects and arrows can be added later if required.
The complement or inverse of a graph is a graph on the same vertices such that there is an arrow if and only if there is not an arrow in its compliment. That is, it is the compliment of the arrows but is not the set complement. for more information see: http://en.wikipedia.org/wiki/Complement_graph
FiniteGraph(S)