#!/bin/sh


#if [ ! -f hi_pr ]; then
# echo ""
# echo "$0:"
# echo "   This script compares LEDA's maxflow implementation (\"mf\")"
# echo "   with the maxflow code of Cherkassky/Goldberg (\"hi_pr\")."
# echo "   You first have to download and compile CG's hi_pr code."
# echo "   You can find it at \"www.intertrust.com/star/goldberg/soft.html\""
# echo "   (package: HIPR). You should also download package PRF that contains "
# echo "   more preflow-push variants and the \"ak\" generator program."
# echo "   Make \"hi_pr\" and \"ak\" and copy both to this directory."
# echo ""
# exit
#fi

if [ ! -f mf ]; then
 echo ""
 echo "$0:"
 echo "   Before running this script you have to do a \"make\" in this"
 echo "   directory that will compile and link LEDA's maxflow program \"mf\"."
 echo ""
fi


if [ "$1" = "" ]; then
  echo "usage: $0 gen  (gen = ak,cg1,cg2)"
  exit
fi

gen="$1"
params="$2 $3 $4"


for n in 5000 10000 15000 20000 25000 30000 35000 40000 45000 50000; do
echo " "
echo "$gen $n"

echo -n "CG (hi_pr)  : "
$gen $n | hi_pr  | grep time | sed "s/c / /" | sed "s/  */ /g"

#echo -n "LEDA (mf)   : "
#$gen $n | ./mf     | grep time | sed "s/  */ /g"

#echo -n "LEDA (mfs0) : "
#$gen $n | ./mfs0 $params | grep time | sed "s/  */ /g"

#echo -n "LEDA (mfs2) : "
#$gen $n | ./mfs2 $params | grep time | sed "s/  */ /g"

#echo -n "LEDA (mfs4) : "
#$gen $n | ./mfs4 $params | grep time | sed "s/  */ /g"

#echo -n "LEDA (mfs5) : "
#$gen $n | ./mfs5 $params | grep time | sed "s/  */ /g"

#echo -n "LEDA (mfs6) : "
#$gen $n | ./mfs6 $params | grep time | sed "s/  */ /g"

echo -n "LEDA (mfs7) : "
$gen $n | ./mfs7 $params | grep time | sed "s/  */ /g"

echo -n "LEDA (mfs8) : "
$gen $n | ./mfs8 $params | grep time | sed "s/  */ /g"


done

echo " "

