English

Categorical Data Structures for Technical Computing

Category Theory 2024-08-07 v5 Databases Logic in Computer Science

Abstract

Many mathematical objects can be represented as functors from finitely-presented categories C\mathsf{C} to Set\mathsf{Set}. For instance, graphs are functors to Set\mathsf{Set} from the category with two parallel arrows. Such functors are known informally as C\mathsf{C}-sets. In this paper, we describe and implement an extension of C\mathsf{C}-sets having data attributes with fixed types, such as graphs with labeled vertices or real-valued edge weights. We call such structures "acsets," short for "attributed C\mathsf{C}-sets." Derived from previous work on algebraic databases, acsets are a joint generalization of graphs and data frames. They also encompass more elaborate graph-like objects such as wiring diagrams and Petri nets with rate constants. We develop the mathematical theory of acsets and then describe a generic implementation in the Julia programming language, which uses advanced language features to achieve performance comparable with specialized data structures.

Keywords

Cite

@article{arxiv.2106.04703,
  title  = {Categorical Data Structures for Technical Computing},
  author = {Evan Patterson and Owen Lynch and James Fairbanks},
  journal= {arXiv preprint arXiv:2106.04703},
  year   = {2024}
}

Comments

27 pages, 7 figures