Skip to content

Instantly share code, notes, and snippets.

@MHenderson
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MHenderson/aa494aeee9f52a6fb50d to your computer and use it in GitHub Desktop.
Save MHenderson/aa494aeee9f52a6fb50d to your computer and use it in GitHub Desktop.
Compute the chromatic number of small graphs.
*~
*.swp
results
.drake
drake.log
BASE=/home/matthew/workspace/graphs-collection/src/Small/output
compute_chromatic()
for graph in $INPUTS/*;
do
chromatic ${graph} >> $OUTPUT
done
make_distribution()
for j in `seq 1 8`
do
echo -e $j'\t' `grep -c $j $INPUT` >> $OUTPUT
done
echo -e Total:'\t' `cut -f 2 $OUTPUT | paste -sd+ | bc` >> $OUTPUT
!results/2c_chromatic.txt <- 2c_gv [method:compute_chromatic]
!results/2c_distribution.txt <- !results/2c_chromatic.txt [method:make_distribution]
!results/3c_chromatic.txt <- 3c_gv [method:compute_chromatic]
!results/3c_distribution.txt <- !results/3c_chromatic.txt [method:make_distribution]
!results/4c_chromatic.txt <- 4c_gv [method:compute_chromatic]
!results/4c_distribution.txt <- !results/4c_chromatic.txt [method:make_distribution]
!results/5c_chromatic.txt <- 5c_gv [method:compute_chromatic]
!results/5c_distribution.txt <- !results/5c_chromatic.txt [method:make_distribution]
!results/6c_chromatic.txt <- 6c_gv [method:compute_chromatic]
!results/6c_distribution.txt <- !results/6c_chromatic.txt [method:make_distribution]
!results/7c_chromatic.txt <- 7c_gv [method:compute_chromatic]
!results/7c_distribution.txt <- !results/7c_chromatic.txt [method:make_distribution]
!results/8c_chromatic.txt <- 8c_gv [method:compute_chromatic]
!results/8c_distribution.txt <- !results/8c_chromatic.txt [method:make_distribution]
!table.txt <- !results/2c_distribution.txt,
!results/3c_distribution.txt,
!results/4c_distribution.txt,
!results/5c_distribution.txt,
!results/6c_distribution.txt,
!results/7c_distribution.txt,
!results/8c_distribution.txt
paste $INPUTS | cut -f 1,2,4,6,8,10,12,14 > $OUTPUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment