This repository is an attempt at finding an algorithm that solves the
following decision problem: Given a finite directed graph
The de Bruijn graph
We study this decision problem because
- it is beautiful, and
- it is computationally equivalent to an open unifiability problem in modal logic.
See our extended abstract for more information on the relation to unification in modal logic.
Leif Sabellek has two repositories with related ideas:
-
Leifa/debruijn implements some of
the same algorithms as this repository. Additionally, it contains some
very smart code that uses a SAT-solver to check whether for a given
graph
$G$ and number$n$ there is a homomorphism from$B_n$ to$G$ . -
Leifa/debruijngame is simple
graphical 1-player game in which one iteratively combines vertices in
a given graph
$G$ until one has constructed a vertex with both a reflexive$0$ -edge and a reflexive$1$ -edge. If one manages to find such a vertex then one has proven the existence of a homomorphism from some$B_n$ to$G$ .
The code from src/
is structured into the following subdictionaries:
Contains basic data structures that are not necessarily related to computing with graphs.
Contains multiple implementations of unlabeled and labeled graphs. All
unlabeled graphs implement GraphInterface
and all labeled graphs
implement LabeledGraphInterface
. These are records of functions, which
are used instead of type classes. Explicitly passing records of function
pointers, provides greater expressivity than type classes, however at
the expense of less concise code.
Provides code that allows us to turn graphs into a concise bit-representation based on arbitrary-size integers.
Contains additional data structures and algorithms that are useful when computing with graphs.
Contains code to check two conditions on
-
$G$ satisfies thepathCondition
fromCayleyGraph.hs
, and -
$G$ isConstructible
as defined inConstructible.hs
Contains code that searches for homomorphism between graphs using an arc-consistency procedure. In case the procedure stops without reaching a contradiction, an arbitrary node in the domain is chosen and for all of its possible values in the domain the procedure is started again. This approach turned out to be less efficient than Leif's coding of the homomorphism problem using SAT-solvers.
This contains an implementation of the idea behind the game in
Leifa/debruijngame. If we find
a way of combining the right kind of vertices in the graph
Contains code to automatically compute a plan to win the game mentioned above. This is incomplete and so far we only have a representation of such plans, plus some code that is able to execute plans to win the game.
Contains examples for graphs
Contains code snippets that print some useful analytic information about graphs or search for small examples of graphs with certain properties. This code is of very low quality but might become useful again later.