Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ CONTENTS:
REQUIREMENTS:
=====

Java JRE v1.6.0 or later
Java JRE at least v1.6, but not past v8.

INSTALLATION:
=====

- Uncompress grami using any compression tool
- Set `JAVA_HOME` to point to the correct version of Java (e.g., `export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/`)
- Build Java binaries using the "build" script file
- Run GraMi using "grami" script

Expand Down
8 changes: 4 additions & 4 deletions build
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
echo "Building GRAMI_UNDIRECTED_SUBGRAPHS ..."
mkdir ./GRAMI_UNDIRECTED_SUBGRAPHS/bin
javac -sourcepath ./GRAMI_UNDIRECTED_SUBGRAPHS/src -d ./GRAMI_UNDIRECTED_SUBGRAPHS/bin/ ./GRAMI_UNDIRECTED_SUBGRAPHS/src/**/*.java
$JAVA_HOME/bin/javac -sourcepath ./GRAMI_UNDIRECTED_SUBGRAPHS/src -d ./GRAMI_UNDIRECTED_SUBGRAPHS/bin/ ./GRAMI_UNDIRECTED_SUBGRAPHS/src/**/*.java
echo "DONE."

echo "Building GRAMI_UNDIRECTED_PATTERNS ..."
mkdir ./GRAMI_UNDIRECTED_PATTERNS/bin
javac -sourcepath ./GRAMI_UNDIRECTED_PATTERNS/src -d ./GRAMI_UNDIRECTED_PATTERNS/bin/ ./GRAMI_UNDIRECTED_PATTERNS/src/**/*.java
$JAVA_HOME/bin/javac -sourcepath ./GRAMI_UNDIRECTED_PATTERNS/src -d ./GRAMI_UNDIRECTED_PATTERNS/bin/ ./GRAMI_UNDIRECTED_PATTERNS/src/**/*.java
echo "DONE."

echo "Building GRAMI_DIRECTED_SUBGRAPHS ..."
mkdir ./GRAMI_DIRECTED_SUBGRAPHS/bin
javac -sourcepath ./GRAMI_DIRECTED_SUBGRAPHS/src -d ./GRAMI_DIRECTED_SUBGRAPHS/bin/ ./GRAMI_DIRECTED_SUBGRAPHS/src/**/*.java
$JAVA_HOME/bin/javac -sourcepath ./GRAMI_DIRECTED_SUBGRAPHS/src -d ./GRAMI_DIRECTED_SUBGRAPHS/bin/ ./GRAMI_DIRECTED_SUBGRAPHS/src/**/*.java
echo "DONE."

echo "Building GRAMI_DIRECTED_PATTERNS ..."
mkdir ./GRAMI_DIRECTED_PATTERNS/bin
javac -sourcepath ./GRAMI_DIRECTED_PATTERNS/src -d ./GRAMI_DIRECTED_PATTERNS/bin/ ./GRAMI_DIRECTED_PATTERNS/src/**/*.java
$JAVA_HOME/bin/javac -sourcepath ./GRAMI_DIRECTED_PATTERNS/src -d ./GRAMI_DIRECTED_PATTERNS/bin/ ./GRAMI_DIRECTED_PATTERNS/src/**/*.java
echo "DONE."

echo "All done successfully!"
25 changes: 12 additions & 13 deletions grami
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ while test $# -gt 0; do
echo "GraMi help"
echo " "
echo "-h, --help show brief help"
echo "-f, graph filename (*.lg)"
echo "-s, minimum frequency"
echo "-t, graph type: 0 for undirected graphs, 1 for directed graph"
echo "-p, mining type: 0 for subgraphs mining, 1 for patterns graph"
echo "-f, graph filename (*.lg); file must be in the Datasets directory [REQUIRED]"
echo "-s, minimum frequency [REQUIRED]"
echo "-t, graph type: 0 for undirected graphs, 1 for directed graph [REQUIRED]"
echo "-p, mining type: 0 for subgraphs mining, 1 for patterns graph [REQUIRED]"
echo "-d, distance threshold, only valid for patterns"
echo "-l, maximum number of repetitions allowed for each distinct label in the frequent subgraphs/patterns results"
echo "-approxA, approximation parameter Alpha"
Expand Down Expand Up @@ -89,21 +89,21 @@ done
#printing some output to the users
echo "Dataset: $file"

if [ $type -eq 1 ]
if [ "$type" -eq 1 ]
then
echo "[DIRECTED]"
else
echo "[UNDIRECTED]"
fi

if [ $patterns -eq 1 ]
if [ "$patterns" -eq 1 ]
then
echo "Frequenct Pattern Mining, with minimum distance: $distance"
else
echo "Frequent Subgraph Mining"
fi

if [ $labels -eq -1 ]
if [ "$labels" -eq -1 ]
then
echo "No constraints on labels"
else
Expand All @@ -114,26 +114,25 @@ echo "Minimum frequency: $frequency"

#specify which application to run and application parameters
#Grami Directed Patterns
if [ $type -eq 1 ] && [ $patterns -eq 1 ]; then
if [ "$type" -eq 1 ] && [ "$patterns" -eq 1 ]; then
prog="GRAMI_DIRECTED_PATTERNS"
fi

#Grami Directed Subgraphs
if [ $type -eq 1 ] && [ $patterns -eq 0 ]; then
if [ "$type" -eq 1 ] && [ "$patterns" -eq 0 ]; then
prog="GRAMI_DIRECTED_SUBGRAPHS"
fi

#Grami Undirected Patterns
if [ $type -eq 0 ] && [ $patterns -eq 1 ]; then
if [ "$type" -eq 0 ] && [ "$patterns" -eq 1 ]; then
prog="GRAMI_UNDIRECTED_PATTERNS"
fi

#Grami Undirected Subgraphs
if [ $type -eq 0 ] && [ $patterns -eq 0 ]; then
if [ "$type" -eq 0 ] && [ "$patterns" -eq 0 ]; then
prog="GRAMI_UNDIRECTED_SUBGRAPHS"
fi

#Running Grami
echo "Starting GraMi ...";
java -cp ./$prog/bin Dijkstra.main freq=$frequency filename=$file datasetFolder=./Datasets/ distance=$distance type=$type mlabels=false maxLabelAppearance=$labels approximate=$alpha approxConst=$beta
echo "GraMi Finished."
$JAVA_HOME/bin/java -cp ./$prog/bin Dijkstra.main freq=$frequency filename=$file datasetFolder=./Datasets/ distance=$distance type=$type mlabels=false maxLabelAppearance=$labels approximate=$alpha approxConst=$beta && echo "GraMi Finished." || echo "Error: Run with -h for information."