Skip to content

Instantly share code, notes, and snippets.

View MHenderson's full-sized avatar

Matthew Henderson MHenderson

View GitHub Profile
@MHenderson
MHenderson / 8x8_hsols.minion
Last active November 14, 2016 13:11
8x8 HSOLS in MINION 3
MINION 3
**VARIABLES**
DISCRETE l[8,8] {0..8}
**SEARCH**
PRINT ALL
**CONSTRAINTS**
---
title: "Combinatory Exercises"
author: "Matthew Henderson"
date: "13 August 2016"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@MHenderson
MHenderson / edge_colouring.py
Last active August 29, 2015 14:06
Greedy edge-colouring of graph6 format graphs.
#!/usr/bin/env python
"""
Usage:
$ geng -qc 3 | edge_colouring.py
2
3
"""
from sys import stdin
@MHenderson
MHenderson / Drakefile
Created September 24, 2014 10:54
Greedy edge-colouring of small, connected graphs.
ORDER_MIN=2
ORDER_MAX=9
; Let X be the set of all non-isomorphic, connected graphs of order at least
; ORDER_MIN and at most ORDER_MAX
; Count the total number of colours used by greedy edge-colourings of all
; graphs in X.
count_colours()
for j in `seq $ORDER_MIN $ORDER_MAX`
@MHenderson
MHenderson / moore.py
Last active August 29, 2015 14:06
Filter Moore graphs from standard input of graphs in graph6 format.
#!/usr/bin/env python
"""
Usage:
$ geng -qc 4 | moore.py
C~
"""
from sys import stdin
@MHenderson
MHenderson / Drakefile
Last active August 29, 2015 14:05
Chromatic indices of small graphs with few edges.
ORDER_MIN=2
ORDER_MAX=9
SIZE_MIN=1
SIZE_MAX=10
GENG="geng -qc"
compute_chromatic()
for graph in $INPUT/*;
@MHenderson
MHenderson / moore
Created August 23, 2014 10:25
Filter Moore graphs from an input string of whitespace-delimited graphs in graph6 format.
#!/bin/bash
# Usage:
# echo `geng -qc 5` | moore.sh
#
# Note: Do not use for values greater than 6.
read g6raw
g6proc=$(echo $g6raw |
awk '{ print "\"" $1 "\"" "," }' RS=' ' ORS=' ' |
@MHenderson
MHenderson / .gitignore
Last active August 29, 2015 14:05
Chromatic numbers of regular graphs on at most 10 vertices.
*~
*.swp
results
.drake
drake.log
data
results
@MHenderson
MHenderson / .gitignore
Last active August 29, 2015 14:04
Compute the chromatic number of small graphs.
*~
*.swp
results
.drake
drake.log
@MHenderson
MHenderson / chromatic.sh
Last active July 2, 2019 21:24
A script to compute the chromatic number of graphs in Graphviz DOT format.
#!/bin/bash
file_gv=$1
n_edges_re='s/\([0-9]*\) %.*/\1/p'
n_edges=`gc -e $file_gv\
| sed -n "${n_edges_re}"\
| tr -d ' '`