diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..112d290 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + branches: [ "master" ] + +jobs: + + analyze: + name: Analyze vulnerabilities + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + language: [ 'cpp' ] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + + build-and-upload: + runs-on: ubuntu-latest + needs: analyze + steps: + - uses: actions/checkout@v3 + - name: Build artifacts + run: make + - uses: actions/upload-artifact@v3 + with: + name: ri36 + path: ri36 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cf1ccf1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +ri3.o +ri36 +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 2691097..0d93168 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +![](https://img.shields.io/badge/C++-RI-blue.svg?style=flat&logo=c%2B%2B) +![](https://img.shields.io/github/stars/InfOmics/RI) +![](https://img.shields.io/github/forks/InfOmics/RI) +![](https://img.shields.io/github/workflow/status/classy-giraffe/RI/CI) + # RI ***Version: 3.6*** > RI is a general purpose algorithm for one-to-one exact subgraph isomorphism problem maintaining topological constraints. @@ -5,10 +10,9 @@
### Description -***RI*** is a general purpose algorithm for one-to-one exact subgraph isomorphism problem maintaining topological constraints. It is both a C++ library and a standalone tool, providing developing API and a command line interface, with no dependencies out of standard GNU C++ library. RI works on Unix and Mac OS X systems with G++ installed, and it can be compiled under Windows using Gygwin. Working graphs may be directed, undirected, multigraphs with optional attributes both on nodes and edges. Customizable features allow user-defined behaviors for attribute comparisons and the algorithm's flow. - +***RI*** is a general purpose algorithm for one-to-one exact subgraph isomorphism problem maintaining topological constraints. It is both a C++ library and a standalone tool, providing developing API and a command line interface, with no dependencies out of standard GNU C++ library. ***RI*** works on Unix and Mac OS X systems with G++ installed, and it can be compiled under Windows using Gygwin. Working graphs may be directed, undirected, multigraphs with optional attributes both on nodes and edges. Customizable features allow user-defined behaviors for attribute comparisons and the algorithm's flow. -***RI*** aims to provide a better search strategy for the common used backtracking approach to the subgraph isomorphism problem. It can be integrated with additional preprocessing steps or it can be used for the verification of candidate structures coming from data mining, data indexing or other filtering techniques. RI is able to find graphs isomorphisms, subgraph isomorphisms and induced subgraph isomorphisms. It is distributed in several versions divide chiefly in two groups respectively for static or dynamically changing attributes. All proposed versions are developed taking into account trade-offs between time and memory requirements. Optional behaviors such as stop at first encountered match, processing of result matches, type of isomorphism and additional features may be enabled thanks to high modularity and library's API. +***RI*** aims to provide a better search strategy for the common used backtracking approach to the subgraph isomorphism problem. It can be integrated with additional preprocessing steps or it can be used for the verification of candidate structures coming from data mining, data indexing or other filtering techniques. ***RI*** is able to find graphs isomorphisms, subgraph isomorphisms and induced subgraph isomorphisms. It is distributed in several versions divide chiefly in two groups respectively for static or dynamically changing attributes. All proposed versions are developed taking into account trade-offs between time and memory requirements. Optional behaviors such as stop at first encountered match, processing of result matches, type of isomorphism and additional features may be enabled thanks to high modularity and library's API. The ***RI*** project also aims to provide a comparison of existing exact subgraph matching algorithms on synthetic and real life graphs. An initial collection of datasets is proposed, it includes synthetic and biological graphs but further types of data regarding other research areas (i.e. engineering, computer vision, etc...) are coming. A list of proposed applications is also given. @@ -18,10 +22,15 @@ Please send us an email to get software sources or datasets (see Contacts). ### Usage ##### RI - CLI (Command Line Interface) -Before using the RI command line interface of all distributions, please rebuilt it by make -B -All versions of RI take in input the same parameters: +In order to use RI you must grab an artifact produced by the CI (check the actions tab on GitHub) or manually compile it from scratch. +On Debian-based distributions (Debian, Ubuntu, PopOS etc...): +1. Clone the repository +2. Install the dependencies (G++ and make) +```sudo apt install g++ make``` +3. Compile it (you might need to switch to the repository directory by using `cd`) +```make``` ``` - ./ri ISO_TYPE INPUT_FORMAT target_graph pattern_graph + ./ri ``` |ISO_TYPE|specify isomorphism| |---------|-------------------| @@ -37,40 +46,6 @@ All versions of RI take in input the same parameters: |geu |undirected graphs with attributes both on nodes and edges.| |vfu |Sansone et al. file format for labeled directed graphs with attributes only on nodes.| - - ##### Default graph file format The RI project provides two graph file format gfu and gfd, respectively for undirected and directed graphs with attributes only on nodes. @@ -135,19 +110,19 @@ RI is distributed under the MIT license. This means that it is free for both aca You are free to link or use RI inside source code of your own program. If do so, please reference (cite) RI and this website. We appreciate bug fixes and would be happy to collaborate for improvements. [License](https://raw.githubusercontent.com/GiugnoLab/RI/master/LICENSE) -
### Citation - Bonnici, V., Giugno, R., Pulvirenti, A., Shasha, D., & Ferro, A. (2013). - A subgraph isomorphism algorithm and its application to biochemical data. - BMC bioinformatics, 14(7), S13. +``` +Bonnici, V., Giugno, R., Pulvirenti, A., Shasha, D., & Ferro, A. (2013). +A subgraph isomorphism algorithm and its application to biochemical data. +BMC bioinformatics, 14(7), S13. - Bonnici V, Giugno R. - On the variable ordering in subgraph isomorphism algorithms. - IEEE/ACM transactions on computational biology and bioinformatics. 2016 Jan 7;14(1):193-203. -
+Bonnici V, Giugno R. +On the variable ordering in subgraph isomorphism algorithms. +IEEE/ACM transactions on computational biology and bioinformatics. 2016 Jan 7;14(1):193-203. +``` ### References - if you have used any of the RI project software, please cite the following paper: +If you have used any of the RI project software, please cite the following paper: Vincenzo Bonnici, Rosalba Giugno, Alfredo Pulvirenti, Dennis Shasha and Alfredo Ferro. A subgraph isomorphism algorithm and its application to biochemical data. BMC Bioinformatics 2013, 14(Suppl 7):S13 doi:10.1186/1471-2105-14-S7-S13. diff --git a/data.geu b/datasets/data.geu similarity index 70% rename from data.geu rename to datasets/data.geu index 93d9287..d59eb1c 100644 --- a/data.geu +++ b/datasets/data.geu @@ -9,4 +9,4 @@ a 0 2 n 0 2 f 0 3 f -2 3 f +2 3 f \ No newline at end of file diff --git a/data.gfd b/datasets/data.gfd similarity index 69% rename from data.gfd rename to datasets/data.gfd index a8f3ce1..cfa6425 100644 --- a/data.gfd +++ b/datasets/data.gfd @@ -10,4 +10,4 @@ a 0 2 0 3 1 2 -2 3 +2 3 \ No newline at end of file diff --git a/query.geu b/datasets/query.geu similarity index 65% rename from query.geu rename to datasets/query.geu index 60d9dd8..fd6e0d3 100644 --- a/query.geu +++ b/datasets/query.geu @@ -6,4 +6,4 @@ a 3 0 1 f 0 2 n -0 2 f +0 2 f \ No newline at end of file diff --git a/query.gfd b/datasets/query.gfd similarity index 65% rename from query.gfd rename to datasets/query.gfd index 8c76202..0d4d301 100644 --- a/query.gfd +++ b/datasets/query.gfd @@ -6,4 +6,4 @@ a 3 0 1 0 2 -0 2 +0 2 \ No newline at end of file diff --git a/makefile b/makefile index bcacfca..480b528 100644 --- a/makefile +++ b/makefile @@ -1,12 +1,11 @@ INCLUDES= -I ./rilib/ -I ./include/ CC=g++ -CFLAGS=-c -O3 +CFLAGS=-c -O3 -Ofast SOURCES= ri3.cpp OBJECTS=$(SOURCES:.cpp=.o) EXECUTABLE=ri36 - all: $(SOURCES) $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) diff --git a/ri36 b/ri36 deleted file mode 100755 index 265e33b..0000000 Binary files a/ri36 and /dev/null differ