You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
I will read part of the following blog post: https://blog.algebraicjulia.org/post/2020/09/cset-graphs-1/
Formally, a simple graph is a set of vertices equipped with an edge relation for which:
- iff .
- .
().
(Tangential comment: The edge relation is symmetric and irreflexive, whereas a partial order includes being reflexive and antisymmetric! Hm.)
In a simple digraph the symmetry axiom is dropped, so that the edges are directed. Graphs and digraphs are basic objects in discrete mathematics, are the source of fundamental data structures in computer science.
Despite this, the concept of a simple graph is often unsatisfactory for both theoretical and practical reasons. The category of simple graphs is badly behaved. Moreover, there is not a single concept of graph suitable for all applications, but rather that graphs belong to a rich family of related concepts.
For a category theorist, a graph consists of two sets, a vertex set , and an edge set , together with two functions . Define as and as . Thus, a graph is directed, may have multiple edges between two vertices, and may have loops, making it what a graph theorist would call a “multidigraph.”
In Catlab, the definition of a graph is captured by the schema:
using Catlab.CategoricalAlgebra
@present SchGraph(FreeSchema) begin
V::Ob
E::Ob
src::Hom(E,V)
tgt::Hom(E,V)
end
It appears that one can build a category in this language by stating the names of objects with ::Ob
and the names of morphisms with ::Hom(X,Y)
.
Having defined the schema for graphs, the module Graphs in Catlab creates a Julia data type for graphs like this:
@acset_type Graph(SchGraph, index=[:src,:tgt])
It appears that this constructs an instance of the schema, though I’m not familiar with the @acset_type
or index=[:src,:tgt]
expressions.
Then there are some very nice code examples of how to define and visualize graphs in AlgebraicJulia.
Graphs are an example of a class of structures called -sets. -sets are defined relative to a small category . In this context, the category is interpreted as a schema, describing the kinds of parts in the structure and the subpart relations between them.
The author refers to maps as “subpart relations”, because they map an entity (an edge) to two things it implicitly has (a source and target).
The interpretation is that there are two kinds of parts, of type and . Parts of type have no subparts, while parts of type have two subparts of type called and .
Given a small category , a -set is a functor .
Going to sleep now, will continue in the morning.