Skip to content

Commit

Permalink
Merge branch 'main' into integrate
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelsonric authored Nov 20, 2024
2 parents 078ace2 + d48029e commit b49486f
Show file tree
Hide file tree
Showing 21 changed files with 3,429 additions and 86 deletions.
11 changes: 11 additions & 0 deletions .buildkite/jobscript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

pwd; hostname; date

module load julia

echo "Running Tests..."
julia --project -t 16 -e 'using Pkg; Pkg.status(); Pkg.test()'

echo "Building Documentation..."
julia --project=docs -t 16 -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.status(); Pkg.instantiate(); include("docs/make.jl")'
21 changes: 21 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
env:
JULIA_VERSION: "1.10.2"
GATAS_HOME: "$DEPOT"

steps:

- label: ":hammer: Build Project"
command:
- "module load julia"
- "julia --project=docs --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()'"

- wait

- label: ":scroll: Build docs and run tests"
env:
JULIA_PROJECT: "docs/"
command:
- "srun --cpus-per-task=16 --mem=64G --time=1:00:00 --output=.buildkite/log_%j.log --unbuffered .buildkite/jobscript.sh"

- wait

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Structural graph theorists and algorithmicists alike know that it's usually a sm

### But what happens if we want to compute on other kinds of mathematical structures?

This project consists of an implementation of the category-theoretic notion of [structured decompositions][2]. These provide a formalism for decomposing decomposing arbitrary mathematical objects (not just graphs) and morphisms between them into smaller constituent parts. Since the definition of a structured decompositions is functorial, one can easily lift computational problems (defined as functors mapping inputs to solution spaces) to functors between from decompositions of the inputs to decompositions of solution spaces. This package allows one to leverage insights to solve decision problems that are encoded as [sheaves][3] efficiently (i.e. in [fixed-parameter-tractable][4] time parameterized by the width of the decompositions).
This project consists of an implementation of the category-theoretic notion of [structured decompositions][2]. These provide a formalism for decomposing arbitrary mathematical objects (not just graphs) and morphisms between them into smaller constituent parts. Since the definition of a structured decompositions is functorial, one can easily lift computational problems (defined as functors mapping inputs to solution spaces) to functors between from decompositions of the inputs to decompositions of solution spaces. This package allows one to leverage insights to solve decision problems that are encoded as [sheaves][3] efficiently (i.e. in [fixed-parameter-tractable][4] time parameterized by the width of the decompositions).

[1]: https://en.wikipedia.org/wiki/Tree_decomposition
[2]: https://arxiv.org/abs/2207.06091
Expand Down
48 changes: 48 additions & 0 deletions benchmarks/BenchmarkAgainstNauty.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This file shows benchmarks against the Nauty algorithm currently implemented in CSetAutomorphisms.jl

using BenchmarkTools
using PkgBenchmark
using Profile
using Test

using CSetAutomorphisms
using CSetAutomorphisms.NautyInterface: all_autos
using CSetAutomorphisms.TestHelp: Labeled

using StructuredDecompositions.Decompositions
using StructuredDecompositions.DecidingSheaves
using StructuredDecompositions.FunctorUtils

using Catlab.Graphs
using Catlab.ACSetInterface
using Catlab.CategoricalAlgebra
using Catlab.Graphics

# The following structures and functions were pulled from DecidingSheaves.jl

struct Coloring
n
func
end

K(n) = complete_graph(Graph, n)
Coloring(n) = Coloring(n, g -> homomorphisms(g, K(n)))
(c::Coloring)(X::Graph) = FinSet(c.func(X))
function (c::Coloring)(f::ACSetTransformation)
(G₁, G₂) = (dom(f), codom(f))
(cG₁, cG₂) = (c(G₁), c(G₂))
FinFunction( λ₂ -> compose(f,λ₂), cG₂, cG₁ )
end

skeletalColoring(n) = skeleton Coloring(n)

function colorability_test(n, the_test_case)
hom = is_homomorphic(ob(colimit(the_test_case)), K(n))
dec = decide_sheaf_tree_shape(skeletalColoring(n), the_test_case)[1]
if hom == dec
return hom
else
error("is_homomorphic != decide_sheaf_tree_shape")
end
end

Loading

0 comments on commit b49486f

Please sign in to comment.