-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.sh
More file actions
47 lines (39 loc) · 778 Bytes
/
demo.sh
File metadata and controls
47 lines (39 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
if [ ! -d 'results' ]; then
mkdir 'results'
fi
echo $#
if [ $# -ge 2 ]; then
V=${1}
E=${2}
else
V='10'
E='20'
fi
if [ $# -ge 3 ]; then
input='results/input'${3}'.txt'
apout='results/apasp'${3}'.txt'
fwout='results/floyd'${3}'.txt'
else
input='results/input.txt'
apout='results/apasp.txt'
fwout='results/floyd.txt'
fi
echo ''
echo 'V='${V}', E='${E}
echo -n 'Gererate a new graph at '${input}'...'
rm ${input}
./gen ${V} ${E} >${input}
echo ''
echo ''
echo -n 'Run APASP at '${apout}'...'
rm ${apout}
time ./apasp <${input} >${apout}
echo ''
echo -n 'Run baseline(Floyd-Warshall) at '${fwout}'...'
rm ${fwout}
time ./FW <${input} >${fwout}
echo ''
echo 'Validation check...'
python checker.py ${fwout} ${apout}
echo