Statistics
| Branch: | Revision:

root / custompackages / graph-parser / src / script.sh @ d5b7a27f

History | View | Annotate | Download (1.55 KB)

1
## TUTORIAL:
2
## The script take 2 command-line arguments:
3
## $1: specify whether to calculate betweenness centrality as an unweighted graph (false) or weighted graph (true). This argument is for both Heuristic BC and Brandes BC
4
## $2: specify whether to include targets when calculating betweenness centrality (for the Brandes BC)
5

    
6
## If no argument is supplied, then the default is "./script.sh true true"
7

    
8
#########
9
## YOU CAN MODIFY THIS PART
10
#########
11
# Change the variables to run the Betweenness Centrality for weighted or unweighted graph.
12
if [ -z "$1" ] # No argument supplied
13
then
14
    WEIGHTED_GRAPH="true"; # 2 possible values: [true | false]
15
else
16
    WEIGHTED_GRAPH="$1";
17
fi
18

    
19
if [ -z "$2" ] # No argument supplied
20
then
21
   TARGETS_INCLUSION="true"; # 2 possible values: [true | false]
22
else
23
    TARGETS_INCLUSION="$1";
24
fi
25

    
26
#########
27
## TRY TO AVOID MODIFYING ANYTHING BELOW THIS LINE
28
#########
29
make
30

    
31
## Remove all the previous output
32
# rm ../output/*.out
33

    
34
## Running the script
35
../bin/main $WEIGHTED_GRAPH $TARGETS_INCLUSION
36

    
37
## Plotting the results
38
if [ $WEIGHTED_GRAPH = "true" ]
39
then
40
    SUFFIX="weighted"; # the suffix used in the filename
41
else
42
    SUFFIX="unweighted";
43
fi
44

    
45
## declare an array variables
46
declare -a arr=("simple" "ninux_unweighted_connected" "ninux_30_1" "jsoninfo_topo" "olsr-netjson")
47

    
48
# loop through the array and format the option for gnuplot
49
# gnuplot -e "FILENAME='simple'; SUFFIX='$SUFFIX'" plot_BC_comparison.gp
50
for i in "${arr[@]}"
51
do
52
    option="FILENAME='"$i"_"$SUFFIX"'; SUFFIX='$SUFFIX'";
53
    gnuplot -e "$option" plot_BC_comparison.gp
54
done