Skip to content

Instantly share code, notes, and snippets.

@MHenderson
Created June 27, 2014 11:01
Show Gist options
  • Select an option

  • Save MHenderson/0bc559d87514a4e482e7 to your computer and use it in GitHub Desktop.

Select an option

Save MHenderson/0bc559d87514a4e482e7 to your computer and use it in GitHub Desktop.
Improved greedy colouring of small graphs with ccli.
#!/bin/bash
orders=( 0 0 1 3 10 33 155 1043 12345 274667 )
type=simple
for ordering in random incdeg decdeg inorder
do
for n in {2..8}
do
src_folder=/home/matthew/workspace/graphs-collection/src/Small/$n
x=${orders[$n]}
for i in `seq 1 $x`;\
do\
ccli greedy --type=$type --ordering=$ordering $src_folder/$i.dimacs;\
done
sed -n 's/CLRS \([0-9]*\) [A-Z a-z = 0-9 .]*/\1/p' $src_folder/*.dimacs.res\
| paste -s -d"+"\
| bc\
| tee output_$type\_$ordering\_$n.txt
rm $src_folder/*.dimacs.res
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment